Update datasource for a section report preview in jsviewer

Posted by: cfmlicensing on 9 December 2021, 5:04 pm EST

  • Posted 9 December 2021, 5:04 pm EST


    I can successfully load a code based section report using a CustomStore into jsviewer. The datasource is created externally to the report, is there anyway to supply a datasource to the report once it has been returned to the jsviewer via 'OpenReport' ?
  • Replied 15 December 2021, 9:44 pm EST

    In the CustomStore where you're returning the code based section report, you can set the Datasource property of the report like below:

    public object GetReport(string reportName = "SectionReport")
    List<Class1> data = new List<Class1>();
    SectionReport1 rpt = new SectionReport1();
    rpt.DataSource = data;
    return rpt;
  • Replied 20 December 2021, 8:52 am EST

    Thankyou. The SectionReport is currently setup and returned the way that you have described in GetReport.
    What I need to be able to achieve is a method to effectively repeat this part 'rpt.DataSource = data;' once the jsviewer has received the report. Is there anyway this can be done?
  • Marked as Answer

    Replied 30 December 2021, 6:25 am EST

    JSViewer only displays the already rendered report, hence it is not possible to change the Datasource once JSViewer has received the report. You can change the datasource before it is passed to the JSViewer.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels