Skip to Content
0
Former Member
Dec 13, 2011 at 07:24 PM

Passed parameters handling during CRViewer_ReportRefresh event.

13 Views

VS2010 and CR 2010 sp2.

All of my reports get passed a location based on where the user is located. That information inside the report then sets the codes for pulling data from the tables.

Example: Report1

RptLoc parameter is passed in code

Start Date parameter is user input

End Date parameter is user input

On the initial run it works great. User never gets prompted for the RptLoc parameter and is prompted for the dates. If the user hits the refresh button it no longer works.

If you put no code in CRViewer_ReportRefresh then it prompts you for all 3 parameters. The dates will still be set but RptLoc is blank.

If you repass the RptLoc parameter (rpt.SetParameterValue("RptDetails", "Site1")) in the CRViewer_ReportRefresh you still get prompted for all 3 parameters. But all 3 are now empty.

I have also tried in the CRViewer_ReportRefresh event.

rpt.close

CRViewer.ReportSource = Nothing

rpt = New ReportDocument

rpt.Load(strRptName)

rpt.SetParameterValue("RptDetails", "Site1")

CRViewer.ReportSource = rpt

This will still prompt for all 3 parameters too.

Help?

Dan...