Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Filter list of parameter fields being prompted Post Reply Post New Topic
Author Message
nix1016
Groupie
Groupie


Joined: 07 Jun 2010
Online Status: Offline
Posts: 40
Quote nix1016 Replybullet Topic: Filter list of parameter fields being prompted
    Posted: 28 Nov 2016 at 6:45pm
With all of our reports we have a list of parameters being passed from our program and then a list that is entered by the user during runtime. With the user prompted parameters, their names all start with 'Prompt'. This is fine when we preview the reports since any parameters set using SetParameterValue(paramname,paramvalue) do not show up.

However, when the report is directly printed or exported, then we need to call up Crystal Report Viewer to prompt the user for the User-selected prompts. Currently the code to do this is:

crReport = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
crReport.Load(filename);
crReport.Refresh();
crReport.SetParameterValue(parameterName, parameterValue);
CrystalReportViewer1 = NEW CrystalDecisions.Windows.Forms.CrystalReportViewer();
CRViewer1.ReportSource = crReport.
CRViewer1.EnableRefresh = true.
CRViewer1.RefreshReport().

which works fine but it displays all parameters in the prompt, even the ones that have already been set using the SetParameterValue method.

Is there anyway that I can hide those? As mentioned, they all start with 'Prompt'.
Also, I found this
article which explains that I'm not meant to use the RefreshReport() method, however I cannot for the life of me find a way to bring up the prompt without using that method. I've tried CRViewer1.Refresh(), CRViewer1.Visible = TRUE, CRViewer1.Show() all to no avail.

Any advice? Thanks!

Edited by nix1016 - 28 Nov 2016 at 6:46pm
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.