cancel
Showing results for 
Search instead for 
Did you mean: 

Visual Studio 2008 using Crystal Reports 2008

Former Member
0 Kudos

I'm trying to pass parameters to a Crystal Reports 2008 rpt file but keep getting a runtime message saying "Missing Parameter Values".

Has anyone experienced this problem?

Does anyone have a snippet of code where values are being passed from C#.Net to a crystal 2008 report.

Thanks in advance....

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Steven,

You can select version and download code samples from [here|https://boc.sdn.sap.com/codesamples]

Here is code for parameters :

{

string Reportpath = Server.MapPath("CrystalReport.rpt");

ParameterFields boParameterFeilds = new ParameterFields();

ParameterField boParameterFeild = new ParameterField();

ParameterValues boParametervalues = new ParameterValues() ;

ParameterDiscreteValue boParameterDiscreteValue = new ParameterDiscreteValue();

ParameterRangeValue boParameterRangeValue = new ParameterRangeValue();

CrystalReportViewer CR;

CR = new CrystalReportViewer();

CR.ReportSource = CrystalReportViewer1.ReportSource;

boParameterFeilds = CrystalReportViewer1.ParameterFieldInfo;

boParameterFeild = boParameterFeilds["Country"];

boParametervalues = boParameterFeild.CurrentValues;

boParameterDiscreteValue = new ParameterDiscreteValue();

boParameterDiscreteValue.Value = "Canada";

boParametervalues.Add(boParameterDiscreteValue);

boParameterDiscreteValue.Value = "USA";

boParametervalues.Add(boParameterDiscreteValue);

boParameterFeild = boParameterFeilds["sales"];

boParametervalues = boParameterFeild.CurrentValues;

boParameterRangeValue.EndValue = "10000";

boParameterRangeValue.StartValue = "25000";

boParametervalues.Add(boParameterRangeValue);

CrystalReportViewer1.ParameterFieldInfo = boParameterFeilds;

}

Hope this helps !!

Regards,

Shweta

Former Member
0 Kudos

Hai Shetha Sharma,

I have the same kind of application development going on, and I am at the point where I coded the C# language file to do a Response.Redirect(urlInformation),

Now this 'urlInformation' is a string that looks like this:

"http://servername/openDocument.aspx?parameter1&parameter2&parameter3 etc..

my application has about 12 parameters like that. These parameters are selected by the user on the web form.

Now as per the above answer in this post, you have hard coded the Parameter values, where as I am pulling the parameters values also from the Crystal Reports Data, so here are my question(s) that need to be resolved.

(1.0) Is it possible to pass the parameters as string values appended to the UrlInformation string like the above and pass this set of values to Crystal REports such that dynamically data is chosen and displayed on the Embedded SWF file(s).

(2.0) Should I embed the SWF file(s) or work with Non embedded SWF file(s).

Someone pPlease reply if you have had similar questions in the past or now.

Thank you,

Vijaya.

Answers (0)