Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing parameter into Data Report

Status
Not open for further replies.

hkung

Programmer
Jan 9, 2001
19
0
0
MY
Hi all,

I have a data report,eg:datarpt1 . i would like to pass a parameter eg:para1 from a form, eg:form1 into the data report as part of the header string. In other words, the header string should be dynamic. Is this possible? Any help will be greately appreciated, thanks in advance!
 
If you are using CrystalReport 8.0, when you install the software, it creates a lot of demos files. They are in C:\ProgramsFiles\Seagate Software\Crystal Reports\Samples\Code\Visual Basic
Goog Luck
 
hkung,

u will first need to specify the parameters in the Command i.e is SQL query u create. then just call the report ->

DataEnvironment1.Command1 Param1,Param2,Param3
then.....
whateverreport.show

Hope this helps else.... write back

Regards
Niraj [noevil]
 
i'm using VB 6 Data Report, not Crystal report.Anyway, thanks hortensiam and Nira...
This is what i need to do exactly..i have DataEnvironment1 with Command1. Para1 is one of the value from a select statement in Command1. Now, i need to pass the value of Para1 to the data report so that the report header will consist of this para1's value. How should i do it? I tried to drag the value of Para1 to the Report Header section but it's not allowed :(
Thanks a lot for the help..
 
Ok, here u go

For Parameters....
DataEnvironment1.Command1 Param1,Param2,Param3

So u might have these params stored in variables

Under a dataenvironment you will have different reports so to display different values for the labels and stuff...

Report.Section(1).Controls(1).Caption = "Bingo!!!" OR use
Report.Section(1).Controls(1).Caption = <<variable used for param>>

Hope this solves... else write back

Regards
Niraj [noevil]
 
yes, it works...thank you so much Niraj :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top