Hi again!
I want to find out how to pass parameters to Crystal Reports from a SQL database through VB 6. I am doing reports for my app and I need to know where to begin.
Sample code would be great if you have it. Thanks in advance for your help.
Printable View
Hi again!
I want to find out how to pass parameters to Crystal Reports from a SQL database through VB 6. I am doing reports for my app and I need to know where to begin.
Sample code would be great if you have it. Thanks in advance for your help.
Hi,
In your project components activate the crystal report control.
Put the CR control on a form and change the properties.
[code]
CrystalReport1.ReportFileName = "yourreport"
CrystalReport1.Action = 1
I always create a tempory print table for my reports
by using a sql statement.
That's all.
Cheers
Bye
FrmMain.CrystalReport1.Reset
FrmMain.CrystalReport1.Connect = "dsn=;uid=;pwd=" FrmMain.CrystalReport1.Destination = 0
FrmMain.CrystalReport1.WindowState = 2 'Window Maximize
FrmMain.CrystalReport1.DiscardSavedData = True
FrmMain.CrystalReport1.ReportFileName ="c:\ss\rrr.rpt"
FrmMain.CrystalReport1.Formulas(i) = formula name="gfgfgfgf"
FrmMain.CrystalReport1.Action = 1
hope i helped
[Edited by shachar on 11-14-2000 at 01:49 PM]
Thanks for the input. I may be a little confused, but how do you pass parameters/fields? I'm sorry but I've never used crystal reports before and I am trying to understand what happens? Also, can you suggest a good book on this topic? Or on VB6 and Crystal Reports?
Thanks again.
ok
In the first place I'm using a separate Crystal Report
program instead the one supplied by VB.
What to do in a few steps.
Open Crystal Report and choose new.
From the report gallery you can choose custom report
with data file.
Choose the database file and you receive a report
screen where to put data and text.
Insert fields from the table into the Details section.
There is also a possibility to insert text fields for
titles, formula fields, total fields and so on...
After finishing just look with preview to check the layout.
There is a great online help in the report generator.
Good Luck
Ray
i cannot remember what is the way of using parameters but if you are building your report on a store procedure you will have under crystal reports something like command... or param.... i dont realy remember but if you still have the problem reply and i will try my best to help you
Hi again!
I need to know what command line(s) I need to add in VB in order to pass one parameter (i.e. ID number) from VB6 to a Crystal Report. The version I have is 6.0. I have already set up the report in Crystal and it is opening in the application, but it is giving me all the records. Basically, I just want Crystal to print the data that is on the form where the user is viewing the data. Any ideas/suggestions? I hope this isn't confusing. Thank you in advance.
I think you would like to know about this..
with Crystal1
.ReportFileName = App.Path & "\RCDLossDaily.rpt"
.Destination = crptToWindow
.ParameterFields(0) = "PName1;" & Value & ";TRUE"
.ParameterFields(1) = "PName2;" & strStop & ";TRUE"
.Action = 1
End with
Set True = CR will not prompt to enter parameter
Marex, Shachar, & Superdorm,
Thank you for all your help. I was able to solve my problem.
Thank you to infinity! :)