Print Page | Close Window

Filter list of parameter fields being prompted

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22158
Printed Date: 25 Apr 2024 at 3:11pm


Topic: Filter list of parameter fields being prompted
Posted By: nix1016
Subject: Filter list of parameter fields being prompted
Date 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
http://search.sap.com/ui/notes?id=0001217834&boj=/sap/bc/bsp/spn/scn_bosap/notes.do?access=69765F6D6F64653D3939382669765F7361706E6F7465735F6E756D6265723D30303031323137383334&ssocompatible - 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!



Print Page | Close Window