Click here to Skip to main content
15,887,302 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How can I create a parameterized rdlc report with reportviewer control used?
And how do I do it with entity datasource?

I need to display the report through report viewer control in my mvc3 application.

Help needed regarding this issue.


Thanks.
Posted
Updated 28-Sep-11 0:52am
v2
Comments
LittleYellowBird 28-Sep-11 6:51am    
Hi, I've changed your title to remove the capitals (using all capitals is rude and just anoys people) plus I'va added a few to your question to make it more readable. Hope you soon get an answer.

private void Page_Load(object sender, System.EventArgs e)
{
CrystalReportViewer1.DataBind();
SetParameterFields();
}

protected void SetParameterFields ()
{
ParameterField f1 = CrystalReportViewer1.ParameterFieldInfo[0];
ParameterDiscreteValue v1 = new ParameterDiscreteValue();
v1.Value = Request.QueryString["Whatever"]; //Or Session("Whatever")
f1.CurrentValues.Add(v1);
CrystalReportViewer1.RefreshReport();
}
 
Share this answer
 
hi......i am sending code snippet frm my project mab be it can help you out

ReportDocument crystalReport = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
crystalReport.Load(Server.MapPath("INV_Inv_IW_Register.rpt"));
crystalReport.SetDatabaseLogon(clsGlobal.UserName,clsGlobal.Password, clsGlobal.ServerName,clsGlobal.DataBase);
CRSalesEnquiry.getDBInfo(crystalReport);
crystalReport.SetDataSource(dt);
crystalReport.SetParameterValue("S_DATE", S_DATE);
crystalReport.SetParameterValue("E_DATE", E_DATE);
CRVINV_Inv_IW_Register.ReportSource = crystalReport;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900