ReportDocument report_crp;
CrystalReportViewer crv;
CrystalReportViewer crv;
crv = new CrystalReportViewer();
report_crp = new ReportDocument();
report_crp.Load(Server.MapPath("reportname"));
#region Parameters passing to rpt file
// Passing parametrs
ParameterValues pvs = new ParameterValues();
ParameterDiscreteValue pdsv = new ParameterDiscreteValue();
ParameterFieldDefinitions pfds;
ParameterFieldDefinition pfd;
report_crp = new ReportDocument();
report_crp.Load(Server.MapPath("reportname"));
#region Parameters passing to rpt file
// Passing parametrs
ParameterValues pvs = new ParameterValues();
ParameterDiscreteValue pdsv = new ParameterDiscreteValue();
ParameterFieldDefinitions pfds;
ParameterFieldDefinition pfd;
pfds = report_crp.DataDefinition.ParameterFields;
pfd = pfds["@Param1"];
pvs = pfd.CurrentValues;
pdsv = new ParameterDiscreteValue();
pdsv.Value = Request.QueryString["Param1"].ToString();// "11/06/2010";
pvs.Add(pdsv);
pfd.ApplyCurrentValues(pvs);
pfd = pfds["@Param1"];
pvs = pfd.CurrentValues;
pdsv = new ParameterDiscreteValue();
pdsv.Value = Request.QueryString["Param1"].ToString();// "11/06/2010";
pvs.Add(pdsv);
pfd.ApplyCurrentValues(pvs);
pfds = report_crp.DataDefinition.ParameterFields;
pfd = pfds["@Param2"];
pvs = pfd.CurrentValues;
pdsv = new ParameterDiscreteValue();
pdsv.Value = Request.QueryString["Param2"].ToString();//"7373";
pvs.Add(pdsv);
pfd.ApplyCurrentValues(pvs);
pfd = pfds["@Param2"];
pvs = pfd.CurrentValues;
pdsv = new ParameterDiscreteValue();
pdsv.Value = Request.QueryString["Param2"].ToString();//"7373";
pvs.Add(pdsv);
pfd.ApplyCurrentValues(pvs);
pfds = report_crp.DataDefinition.ParameterFields;
pfd = pfds["@Param3"];
pvs = pfd.CurrentValues;
pdsv = new ParameterDiscreteValue();
pdsv.Value = Request.QueryString["Param3"].ToString();//"M01";
pvs.Add(pdsv);
pfd.ApplyCurrentValues(pvs);
//End Passing paramentes pfd = pfds["@Param3"];
pvs = pfd.CurrentValues;
pdsv = new ParameterDiscreteValue();
pdsv.Value = Request.QueryString["Param3"].ToString();//"M01";
pvs.Add(pdsv);
pfd.ApplyCurrentValues(pvs);
#endregion
crv.ReportSource = report_crp;
crv.HasExportButton = true;
crv.HasToggleGroupTreeButton = true;
crv.DisplayGroupTree = true;
crv.HasCrystalLogo = true;
crv.HasDrillUpButton = true;
crv.HasViewList = true;
crv.HasPrintButton = true;
No comments:
Post a Comment