Crystal Report parameter dialog box


M

mounilkadakia

I have a CrystalReportViewer(crv) on my form. I also have a dataset
(dtsReportData) populated with the required data and i have a
ReportDocument (rdReport) object. The data source for the crystal
report (CR 11) is a stored procedure.

This is what i am doing:-

rdReport.Load("ReportLocation"); //ReportLocation is the file path.
rdReport.SetDataSource(dtsReportData);
crv.ReportSource = rdReport;

When the Crystal Report Viewer loads up, it brings up a dialog box
asking to enter the various parameters. I do not have different forms
(to accept the report parameters from the user) for different reports.
I have only 1 form which is dynamically generated with the required
controls (labels/textboxes/datetimepickers etc ) depending on which
report the user selects in the application.

Can any one shed some light on why this is happening and how can i get
around it? If anyone has had a similar problem and has managed to
solved it, i would love to hear how you did it.

TIA,
Mounil.
 
Ad

Advertisements

J

Jay Taplin

To me your code does not look like VB code, but I'll try to give you
pointers in what I have done with VB...

I do the same thing in most of my apps. My form is dynamic, allowing for
the display of all reports from the software.

If first load the report into a Report object, set the parameter values
(mReport.Report.ParameterFields.Item([ParamName]).AddCurrentValue) and then
assign the report object to the CrystalReportViewer.

Jay Taplin, MCP
 
Ad

Advertisements

M

mounilkadakia

Hi Jay,
Thanks a lot for your reply. I am using C#. I posted this
question on various relevant NG's but did not get any reply so thought
of posting it here.

I developed my app in VS 2003 and it was all running very smoothly. I
recently migrated it to VS2005 and then I started getting this problem.
Although I dont think this is a VS 2005 issue; but something with CR
itself.

I'll try to explain my problem in detail.

I am using Crystal Reports XI; VS 2005; SQL Server 2000;

For all my reports, the reports' datasource is a Stored Procedure. And
in most cases than not, these are paramaterised SP's.


In my application, I have a listbox with a list of available reports.
The user then selects to view one report. This then loads up a
dynamically generated form with a tabpage for each of the parameters
that the Stored Procedure needs. The user then enters values for each
of the parameters. I then create a SQL statement( something like
....execute MyStoredProc value1 value2) where value1 etc are the values
the user entered for the parameters on the dynamyically generated form.
The resultant recordset is then stored into a DataSet object.

I then load the report into a ReportDocument object ie
rdReport.Load("ReportLocation"); assign DataSet to as the
ReportDocuments Datasource ie rdReport.SetDataSource(dtsReportData);
and finally assign the ReportDocument to the CrystalReportViewer.

As i mentioned earlier, this was all working smoothly untill now...I am
getting the default CR "Enter Parameters" dialog and I havent got a
clue as to what has triggered this behaviour.

Do you know what might be happening here? Also, are you able to provide
a more elaborate code snippet?

Thanks a lot,
Mounil.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top