How to display Crystal Report

K

Kamal Ahmed

Hi all,
I dont know how to display a parameterized Crystal report in Asp.Net page...
e.g. I give input of Student Code range and then click on View to display
Crystal Report.

Could anyonw help me ??
 
E

Elton Wang

Hi Kamal,



Following code snippet demonstrates how to add a parameter to CR and to show
the report in ReportViewer



CrystalDecisions.CrystalReports.Engine.ReportDocument report = new
CrystalDecisions.CrystalReports.Engine.ReportDocument();
report.Load(report_name);
CrystalDecisions.Shared.ParameterValues rptValues = new
CrystalDecisions.Shared.ParameterValues();
CrystalDecisions.Shared.ParameterDiscreteValue rptValue = new
CrystalDecisions.Shared.ParameterDiscreteValue();
rptValue.Value = Parameter_Value;
rptValues.Add(rptValue);
report.DataDefinition.ParameterFields[0].ApplyCurrentValues(rptValues);
//***
// Set report logon info or data source
//***
CRViewer.ReportSource = report;
CRViewer.RefreshReport();

HTH

Elton Wang
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top