Json into XMLDataSource

Posted by: scosovic on 13 May 2024, 11:33 am EST

    • Post Options:
    • Link

    Posted 13 May 2024, 11:33 am EST

    Hi,

    Have ActiveReports18 installed. Working with standalone (rpx) reports where the parameter is being set with the OuterXml of an xml file which is then loaded into XMLDataSource to render the report. I also have some custom work done inside the report script to handle the logic related with different sub-elements of the xml passed in.

    I would like to use the same report (rpx), but load the same parameter with json data (for different reasons) instead of xml as it is currently done.

    If I pass the json instead of xml, how would I, inside the report script - ActiveReport.ReportStart, convert that json into xml? I would like to keep everything else in the report as it is. I assume the easiest would be to convert json to xml.

    I know how one would convert json into xml in C#, but I did not see that ActiveReports18 supports Newtonsoft.Json, or any other System.XXX.Json assembly I could use to do this.

    I’d appreciate the suggestion. Thank you…

  • Posted 14 May 2024, 7:03 am EST

    Hi Sanir,

    To use external references in your XML Based SectionReport, you need to load the RPX report in a SectionReport class and use the ‘AddScriptReference()’ method to add the references to the scripts that you want to use in your RPX report.

    Please find attached a sample using Newtonsoft Pacakge within RPX SectionReport for your reference.

    Regards,

    Anand

    SectionReport18_NewtonsoftReference.zip

Need extra support?

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

Learn More

Forum Channels