Hello,
I have a report that has two parameters. When accessing the report parameters from the report CS file, the parameters are in the collection, but the values are blank. Any help would be much appreciated.
Thanks,
Virgil
ReportViewer.aspx
1.<form id="form1" runat="server">2. <div>3. <telerik:ReportViewer ID="ReportViewer1" runat="server">4. </telerik:ReportViewer>5. </div>6.</form>
ReportViewer.aspx.cs
01.protected void Page_Load(object sender, EventArgs e)02.{03. int tableId = int.Parse(Request["tableId"]);04. int reportType = int.Parse(Request["reportType"]);05. 06. string typeName = typeof(BG0001).AssemblyQualifiedName;07. 08. var reportSource = new Telerik.ReportViewer.Html5.WebForms.ReportSource();09. reportSource.Identifier = typeName;10. reportSource.IdentifierType = Telerik.ReportViewer.Html5.WebForms.IdentifierType.TypeReportSource;11. reportSource.Parameters.Add("TableId", tableId);12. reportSource.Parameters.Add("ReportType", reportType);13. 14. this.ReportViewer1.ReportSource = reportSource;15.}
The generated markup
<input id="ReportViewer1_hidden" name="ReportViewer1_hidden" type="hidden" value="{"documentMapVisible":true,"parametersAreaVisible":true,"scale":1,"scaleMode":"SPECIFIC","viewMode":"INTERACTIVE","printMode":"AUTO_SELECT","reportSource":{"report":"TestReports.Reports.BG0001, TestReports.Reports, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null","parameters":{"TableId":38,"ReportType":3}},"pageNumber":1}">
The code inside the BG0001 report
01.public BG0001()02.{03. //04. // Required for telerik Reporting designer support05. //06. InitializeComponent();07. 08. this.ProcessReportParams();09. 10.}11. 12.protected void ProcessReportParams()13.{14. this.teamId = int.Parse(this.ReportParameters["TableId"].Value.ToString());15. this.reportType = int.Parse(this.ReportParameters["ReportType"].Value.ToString());16.}
Intermediate window test of parameter values
01.?this.ReportParameters["TableId"]02.{Telerik.Reporting.ReportParameter}03. AllowBlank: false04. AllowNull: false05. AutoRefresh: false06. AvailableValues: {(none)}07. Mergeable: true08. MultiValue: false09. Name: "TableId"10. Text: ""11. Type: Integer12. Value: ""13. Visible: true