on 2024 Oct 16 10:07 PM
Using "SAP Crystal Reports runtime engine for .NET Framework (64-bit)" version 13.0.31.4010,
and the corresponding component for VS: "SAP Crystal Reports, version for Microsoft Visual Studio" version 13.0.31.4010.
The CR viewer is CrystalDecisions.Web, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304
My report has several string type parameters. One of these parameters (called p_stu_cnt) is passed to the report. This param is displayed in the 2nd page header of the report.
When the report is rendered, it shows its value fine (e.g. "100"), but when I navigate (say, go to the next page), the parameter loses its value in the report (shows "0").
Not surprisingly, if I export, say to PDF, the lost value appears int he exported output.
I found an article https://community.sap.com/t5/technology-q-a/navigation-in-crystal-viewer-with-parameters/qaq-p/10016... that suggested setting the ReuseParameterValuesOnRefresh property of the viewer to true (it was false by default). I have done this, but no luck resolving the issue.
The value of this parameter is passed from a string variable, which is prior set to the given dataset's table row count, i.e.
string mQualifyingStudentCount = dtResults.Rows.Count;
then later passed on to the report parameter like so:
string p_stu_cnt = mQualifyingStudentCount.ToString();
report.SetParameterValue("p_stu_cnt", p_stu_cnt);
The strange thing is that if I just hardcode of my variable and pass it on to the report param, then the value is not lost! i.e:
string p_stu_cnt = '123";
report.SetParameterValue("p_stu_cnt", p_stu_cnt);
Is this a bug??!!
I appreciate your help,
Request clarification before answering.
This happens in a WEB app if you don't use sessions and postback:
See if that resolves the issue.
If it's a desktop app then likely you are using Refresh() in your code which will remove the current values.
Oh and I suggest updating to SP 36, CR for VS is only supported in the latest SP, SP 31 had issues in the viewer:
https://help.sap.com/docs/SUPPORT_CONTENT/crystalreports/3354091173.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The sample I created in the KBA works perfectly.
What you need to do is think about your work flow...
For example, if you close the session the report is no longer valid so you have to go through the whole routine again including logging onto the data source and parameters. If all you want to do is change the parameter value passed then EnableParameterPrompt in the Viewer, the user will then see a Parameter box on the left side which they'll be able to refresh and choose a new value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
31 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.