This is a migrated thread and some comments may be shown as answers.

Unable to get Report Parameter value anymore

0 Answers 18 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 2
Mark asked on 03 Jun 2020, 02:06 PM

Hello, I am using an older version of the Telerik Reporting tool (R1 2017 SP2)  and in earlier versions than that I was able to get the values for parameters that were passed.

Code that passes and generates the report:

var typeReportSource = new Telerik.Reporting.TypeReportSource();
typeReportSource.TypeName = string.Format("ReportLogic.{0}, ReportLogic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", ReportName);
foreach (var Parameter in Parameters)
{
    typeReportSource.Parameters.Add(Parameter.Name, Parameter.Value);
}
 
var result = reportProcessor.RenderReport("PDF", typeReportSource, null);

 

Report code:

void QuoteRequest_ItemDataBinding(object sender, EventArgs e)
{
     var id = Convert.ToInt32(this.ReportParameters[0].Value);
 
      // Transfer the value of the processing instance of ReportParameter
      // to the parameter value of the sqlDataSource component
      using (var db = new PetaPoco.Database())
      {
                var pcqp = new Repository(db).GetAllDynamicFields(id);
      }
}

Before this was able to pull a value,

In the earlier versions this was able to pull a value from this.ReportParameters[0].Value. But when I updated to this version it would just pass back a null value. Is there a reason why this could have happened? 

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Mark
Top achievements
Rank 2
Share this question
or