Converting from code-based section reports to Page Reports/RDL

Posted by: mpeterson on 30 July 2020, 1:59 am EST

    • Post Options:
    • Link

    Posted 30 July 2020, 1:59 am EST

    I have 300+ legacy code-based section reports, and I guess it’s time to look at migrating them to the newer, better supported format.

    I tried running the Import wizard in AR14, but it doesn’t see the RPX files - probably because there aren’t any. Am I going to need to open each individual report, export the format to RPX, and then run the Import Wizard? If so - this is going to be very tedious.

  • Posted 30 July 2020, 5:14 pm EST

    Hello,

    There is no direct way to convert Code-based report. You can use the following line of codes to convert the section report to RDL report:

    var sectionReport = new SectionReport() { Name = reportName };
    sectionReport.LoadLayout(new XmlTextReader(new StreamReader(OpenReportResourceStream(reportName + RPX_FILE_EXTENSION), Encoding.UTF8)));
    var pageReport = new RpxConverter().ConvertToRdl(sectionReport, false);
    var stream = new MemoryStream();
    using (var writer = XmlWriter.Create(stream, new XmlWriterSettings() { NewLineHandling = NewLineHandling.Entitize, NewLineChars = "\n", Indent = true, IndentChars = "\t" }))
    pageReport.Save(writer);
    

    You need to add the “GrapeCity.ActiveReports.Imports.RPX.dll” to use the above code from the following location:

    C:\Program Files (x86)\GrapeCity\ActiveReports 14\Tools

    Also, note that the problem could be that conversion has a lot of limitations and often requires manual conversion afterwards so it makes this unusable in some cases.

    Thanks,

    Mohit

  • Posted 30 July 2020, 11:29 pm EST

    Thanks - will give it a try. I tried to convert several yesterday, and yes - this is going to be painful.

    I mainly report on custom objects - so AR is not tied to the back-end database directly. I generally don’t have a lot of code in the code-behind (10-20 lines usually), but it is there. Hopefully you’ll get section-based reports working with .NET standard soon, which will give me a bit more time to migrate. :slight_smile:

  • Posted 3 August 2020, 7:14 pm EST

    Hello,

    Yes, we have plan to support in SectionReport in .Net Standard in AR14.2 or AR15.

    Thanks,

    Mohit

Need extra support?

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

Learn More

Forum Channels