Tip using ReportDocument.SetParameterValue Method 
Author Message
 Tip using ReportDocument.SetParameterValue Method

I have spent countless hours trying to assign parameter values to a report
via the ReportDocument object, without having the viewer display the
parameters dialog, so I thought I'd share with the group one observation I
have made.

You must assign the datasource to the ReportDocument (as it says in the
documentation somewhere).
You ALSO have to refresh the ReportDocument object BEFORE setting any
parameters (which as far as I can tell is not mentioned in any
documentation)....

thus

Dim oRpt As New ReportDocument
oRpt.Load("report.rpt")
oRpt.SetDataSource(dsReport)

oRpt.Refresh()

oRpt.SetParameterValue("Param1", P1Value)
oRpt.SetParameterValue("Param2", P2Value)
CrystaReportViewer1.ReportSource = oRpt

works fine, but

Dim oRpt As New ReportDocument
oRpt.Load("report.rpt")
oRpt.SetDataSource(dsReport)
oRpt.SetParameterValue("Param1", P1Value)
oRpt.SetParameterValue("Param2", P2Value)
CrystaReportViewer1.ReportSource = oRpt
will prompt for parameters...

has anyone else had this problem using .NET 2003?

Andy



Mon, 05 Dec 2005 10:24:13 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. sending windows.document.form.item.value properties into functions

2. DIRE NEED OF HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

3. How to pass NET dataset to Crystal using ReportDocument Class

4. http://www.vb-world.net/tips/api.html

5. Try this link: http://216.26.168.92/tips/tip76.html

6. HIDDEN FILE....PS..................................................................................................

7. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!ATTENTION!!!!!!!!!!!!!!!!!!!!!!!!!!!

8. Closing down .............................................................................................................

9. tool tips on class methods, properties, etc.

10. EVENT with paramters passed by reference: be able to change a val ue

 

 
Powered by phpBB® Forum Software