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