Posted 12 April 2022, 2:57 am EST
Greetings,
I am currently trying to integrate Active Reports Designer into a web app with the intent of editing Report headers which are stored in a database as XML.
The desktop equivalent (from active reports v9, which is what our desktop app uses) is the method which looks like arDesigner.loadReport(xmlReader, DesignerReportType.Section).
For the web case what I have gathered currently from the documentation is that first I need to use UseCustomStore from the aspnet Designer service, which requires me to write an implementation of IResourcesService. This has a method GetReport which is called by the front end and which is used to get the Report to be displayed in the designer.
However this method returns a Report object but currently the only way I know how to loadXml into a Report is via the LoadLayout method of the SectionReport object, but I can’t figure out any way of getting a Report from a SectionReport.
I tried using ReportExtension.FromXML() but my XML is not in the right format
Currently my implementation of GetReport looks like the following:
Stream stream = _reportApp.GetHeaderXMLFromDatabase(dto.Mode); //db access code
SectionReport sReport = new SectionReport();
using (XmlTextReader reader = new XmlTextReader(stream))
{
sReport.LoadLayout(reader);
}
//from here I need to get a Report object somehow
Is there any way to get this approach to work? Can I get from a SectionReport to Report or am I barking up the wrong tree and need to do something like UseFileStore in this case?