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

Parameters not getting sent from mvc -> report instance

1 Answer 61 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 27 Nov 2013, 05:27 AM
I have a TypeReportSource setup which works perfectly, but the parameters added to the report source don't appear in the instantiated report class, i.e. I add 10 here from the model but when I look for them in the NeedDataSource event, the collection is empty.

Newtonsoft is installed from nuget and not in the GAC.

@{
    var typeReportSource = new TypeReportSource() { TypeName = Model.ReportQualifiedAssemblyDetail };
 
    foreach (var parameter in Model.ReportData.Parameters)
    {
        typeReportSource.Parameters.Add(parameter.Name, parameter.Value);
    }
             
    @(Html.TelerikReporting().ReportViewer()
        .Id("ReportViewer")
        .ServiceUrl("/api/reporting/")
        .TemplateUrl("/ReportViewer/templates/CustomReportViewerTemplate.html")
        .ReportSource(typeReportSource)
        .ViewMode(ViewModes.PRINT_PREVIEW)
        .ScaleMode(ScaleModes.FIT_PAGE_WIDTH))
}

Is there something I need to do to get the parameters to appear in the report class, as parameters are rendered useless if I can't actually use them.

Mark

1 Answer, 1 is accepted

Sort by
0
Mark
Top achievements
Rank 1
answered on 27 Nov 2013, 09:20 PM
My problem, missed the var report = (Telerik.Reporting.Processing.Report)sender; tucked deep in the documentation
Tags
General Discussions
Asked by
Mark
Top achievements
Rank 1
Answers by
Mark
Top achievements
Rank 1
Share this question
or