cancel
Showing results for 
Search instead for 
Did you mean: 

Passed parameters handling during CRViewer_ReportRefresh event.

Former Member
0 Kudos

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...

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Parameters you do not want to be prompted for must be set in code - before calling the viewer - as you are doing now. However, refreshing the viewer via the toolbar button will prompt for all parameters. This is an expected behavior. What you are looking to do, will best be done by creating your own parameter prompting and refresh button. E.g.; do not use the viewer refresh button.

Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup

Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

Former Member
0 Kudos

Thanks Ludek.

That being the case do you have any sample code in vb.net on how to get the values that are currently in the parameter fields?

Thanks,

Dan...

former_member183750
Active Contributor
0 Kudos

I don't have an app on hand, but there is a description in the dev help file:

http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_dg_2010_en.zip

Just do a search for 'parameterfields' and you'll get a section called "Create a ListBox Controll that Displays Default Parameters". Good info here. Also, the following KBs may help:

[1537998 - How to get the count of parameters in Crystal report using Crystal Reports .NET SDK|

[1202315 - How do I get a parameters default value's description via the NET SDK?|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233303332333333313335%7D.do]

[1504651 - How to determine if a parameter field is used in a Crystal Report using the .NET SDK|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333533303334333633353331%7D.do]

- Ludek

Answers (0)