Click here to Skip to main content
15,914,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
public ActionResult PatronLocationGraph()
{
  var rpt = new Services.Report.ReportService("PatronLocationGraph", null);
  var service = new PatronService(DataContext);

  //rpt.ReportDocument.ParameterFields.Add("Pie Chart for All Patrons By Location");
  //Here i am assigning it but i am getting missing parameter Exception
  var vms = service.GetGroupByLocation();
  rpt.ReportDocument.SetDataSource(vms);

  return ReturnPDF(rpt.GetPDFStream(), "PatronLocationGraph");
}



I have already added a text box in the Report Designer and in Field Explorer added New Parameter Named it "ReportLabel" and drag and drop this Parameter now i am assigning the Report Label but getting Missing Parameter Exception
Posted
Updated 17-May-15 17:06pm
v3

1 solution

set the parameter value after you set the datasource
C#
var vms = service.GetGroupByLocation();
rpt.ReportDocument.SetDataSource(vms);
rpt.ReportDocument.SetParameterValue("ReportName", "Report Name ....");
return ReturnPDF(rpt.GetPDFStream(), "PatronLocationGraph");
 
Share this answer
 
Comments
Qasim Sarwar 17-May-15 21:21pm    
Dear DamithSL i am getting still the Same Exception.
Actually i have a Text Object in my Report and i want to put a string values from my Report Dynamically.
the main concern is with the report label in the designer not with the Real report name.
i have used this rpt.ReportDocument.SetParameterValue("ReportLabel","Pie Chart for All Patrons By Location");

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