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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I send a value to a crystal report in VB

Status
Not open for further replies.

MEL33

IS-IT--Management
Jan 7, 2004
17
US
I am calling a crystal report in my script, and need to send a value. How do I code this?

 
What are you going to do with the value? You could send it as a parameter- or are you going to set some property of the report?

I wont be here a lot longer so here is how to do it with a parameter.

You go in the report- create a parameter- set up the data type, name, etc.

Then in your code before you call up the report- you set the parameter value. It looks like this:
Code:
Dim Report As New crsOT
Report.ParameterFields(1).AddCurrentValue frmMain.dtStart.Value
crvRpt.ReportSource = Report
crvRpt.ViewReport
That is straight from a project of mine using CR 8.5. frmmain.dtstart.value is a date picker on a form- you can substitute your variable, text box, or whatever holds the value you want to send over.

If you are going to put that parameter into the title or something though- it easier just to manipulate that in the code rather than go the round about route.

 
This is how the program is currently setup to print:
With rptrirp0410
.Action = 1 'Print Report
.PageZoom (125) 'Must be set after .Action
End With

How do I add the parameter to this? And is there an action to email along with print?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top