473,796 Members | 2,559 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB with Crystal Report Send parameter at run time

7 New Member
Hi, pls clarify these questions.

1. How can I send some values of globla variables from VB to
crystal report.
I want to show these values on report.

my database in MS Access


My query is as follows...

invoice table
customer table
purchase table

using this table when user enter the invoice number in textbox and click report button , the report include the particular invoice detail and take over related customer details also...



I want to send this values dynamically from VB(in the event of showing the
report).
If I use parameter field , System is prompting for the value at run
time.
How can I set this automatically?
Aug 13 '07 #1
3 6730
hariharanmca
1,977 Top Contributor
every thing is okay, but you never point your CR version?

and you are using Inbuild CR or external (Through VB, Calling that CR Rpt File).
Aug 13 '07 #2
nithya jayaraman
7 New Member
Hi, pls clarify these questions.

i am using external CR (Call by CR1.printreport )ver 4


1. How can I send some values of globla variables from VB to
crystal report.
I want to show these values on report.

my database in MS Access


My query is as follows...

invoice table
customer table
purchase table

using this table when user enter the invoice number in textbox and click report button , the report include the particular invoice detail and take over related customer details also...



I want to send this values dynamically from VB(in the event of showing the
report).
If I use parameter field , System is prompting for the value at run
time.
How can I set this automatically?
Hi, pls clarify these questions.

1. How can I send some values of globla variables from VB to
crystal report.
I want to show these values on report.

my database in MS Access


My query is as follows...

invoice table
customer table
purchase table

using this table when user enter the invoice number in textbox and click report button , the report include the particular invoice detail and take over related customer details also...



I want to send this values dynamically from VB(in the event of showing the
report).
If I use parameter field , System is prompting for the value at run
time.
How can I set this automatically?
Aug 17 '07 #3
hariharanmca
1,977 Top Contributor
1. Create a DSN Connection in your system.
2. Make sure connection done properly.

then copy below code.

Note : This is only for External Report and Version 9.

Expand|Select|Wrap|Line Numbers
  1. '==================== Globel declaration in any Public Module
  2. Public strReportPath As string ' Report Path with Report Name As String
  3. Public StrRecordSelection As String ' Sql Query To Pase from any forum
  4.  
  5. '==============================In Report forum 
  6. Dim crystal As New CRAXDRT.Application      ' LOADS REPORT FROM FILE
  7. Dim Report As New CRAXDRT.Report      ' Declaring REPORT FROM FILE
  8.  
  9.  
  10. Private Sub Form_Load()
  11. On Error Resume Next
  12. '    Setting
  13.     Set crystal = New CRAXDRT.Application           'MANAGES REPORTS
  14.  
  15.     Set Report = Nothing ' Closing previous report
  16.     Set Report = crystal.OpenReport(strReportPath)  ' OPEN New REPORT With String Path
  17.     '------------------------- Opening Database with the help of DSN Connection.
  18.     Report.Database.LogOnServer "pdsodbc.dll", <strDatabaseNameForSqlServer>, <strDSNName>, <strLoginName>, <strPassWord>
  19.     '-------------------------Checking Condition Sql Query is available   
  20.     If StrRecordSelection <> "" Then
  21.         Report.RecordSelectionFormula = StrRecordSelection ' Passing Recored selection query to report
  22.     End If
  23.     Report.DiscardSavedData   ' CLEARS REPORT SO WE WORK FROM RECORDSET
  24.     Cry.ReportSource = Report  ' LINK VIEWER TO REPORT
  25.     Cry.ViewReport ' Show Report
  26.  
  27.     Cry.Zoom 1
  28.  
  29.     Set crystal = Nothing
  30.  
  31.     StrRecordSelection = "" ' Clear Query in globel variable
  32.     strreportpath = ""      ' Clear Report Path in globel variable
  33. End Sub
Aug 17 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
4138
by: Omavlana | last post by:
Hi, pls clarify these 2 questions. 1. How can I send some values of globla variables from VB.NET to crystal report. I want to show these values on report. 2. I have added an SQL query in my crystal report through "Add Command" . My query is as follows...
3
2525
by: Raghuraman | last post by:
Hai I have a designed Crystal report .rpt file which has 4 access tables .. After designing the report i put a parameter field which filteres the desired records quite naturally. Every thing works fine in the crystal report design time as well as in the preview asking parameters .. But if i call it thru my VB form it works nice after removing the parameteres.
9
7153
by: Robert Schuldenfrei | last post by:
Hello NG, After a bit of a wait my bookstore, SoftPro of Waltham, MA, got in the Brian Bischof book: Crystal Reports .NET Programming. I have read a few books on CR, but I am very new to it, C#, and SQL. The book is excellent. Undaunted, I have plowed into a conversion of my old COBOL ERP system, MCS-3, into C#. I have quite a bit of Inventory Control done and working. For reports I am trying to use CR. I have a half a dozen of them...
0
3642
by: Dean Sabella | last post by:
Hi, I was trying to run a crystal report in the .net sample application given at: http://support.crystaldecisions.com/communityCS/FilesAndUpdates/ cppnet_win_subreport_basic.exe.asp (I've reproduced the relevant file below.)
0
4802
by: Simon | last post by:
Hi, I am using ASP.NET with C# and Crystal Report. I have a textbox et a asp.net button. I send a number in the texte, I push the button and I want to see the report with value related to the number in the textbox. The problem is that I need to call the crystal report function in the "override protected void OnInit(EventArgs e)" function to see my graphic and picture in the report. When I push the button, the content of the textbox is not...
3
3789
by: Deasun | last post by:
I need some help please! Crystal is driving me nuts. Heres my code so far, see below. Problem: On the .export() line it comes back with error #5 Login failed! I know the login info is good so why is the bloody thing doing this. The paths have been checked and are correct. The crystal Report is a .rpt file. Not one created in the VS.net IDE but in crystal itself.
19
3882
by: LP | last post by:
I am using (trying to) CR version XI, cascading parameters feature works it asks user to enter params. But if page is resubmitted. It prompts for params again. I did set ReuseParameterValuesOnRefresh="True" in a viewer, but it still doesn't work. Did anyone run into this problem. What's the solution? Please help. Thank you
4
2500
by: touf | last post by:
hi, I'm using Crystal reports to generate a simple report in a VB.net windows application, I've defined all my stuffs (accessMDB,query, 2 parameters) in the report design, and it's working fine, when a report is opened it prompts me to input the parameters values . But, in order to incorporate this report to my application, I have 3 quetions: 1- How can I send the parameters from my form directly (so there will be no prompt)? 2- How can...
1
2459
by: Habibur | last post by:
hi, I am using Eclipse plugin,Crystal Report Xi and Oracle 9i as Database and JDBC connection to connect Crystal Report with Database.There are many sql espression in my report file(*.rpt) and date parameter.When I run this .rpt file from Crysta Report window it is running correctly.But When I send this date parameter from JSP,then I am getting ORA1003:no statement persed error.Can anyone help me in this situation.....
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10452
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10221
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10169
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5569
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.