ReportToPDF error: Element 'activity' does not exist in element 'activity'

Ask general questions here.
rk325
Posts: 23
Joined: Mon Mar 27, 2023 6:02 pm

ReportToPDF error: Element 'activity' does not exist in element 'activity'

Post by rk325 » Tue May 09, 2023 8:28 pm

I am developing with Ranorex exclusively in C#. I use the Ranorex Report module to generate output, e.g. Report.Log, Report.Error, etc. And it works, it creates 2 files with extensions .rxlog and .rxlog.data.
I tried to incorporate the ReportToPDFModule, but I get the error message:
Ranorex.Core.FastXml.XmlDocException
HResult=0x80131500
Message=Element 'activity' does not exist in element 'activity'.
Source=Ranorex.ReportToPDF
StackTrace:
at Ranorex.Core.FastXml.XmlNode.Child(String name)
at Ranorex.PDF.PDFCreator.CreateHeader(XmlNode rootActivity)
at Ranorex.PDF.PDFCreator..ctor(XmlNode rootNode, String xml, RanorexGraphics rg)
at Ranorex.PDF.Program.Main(String[] args)
at Ranorex.PDF.Creator.CreatePDF(String input, String output, String xml, String details)
at Ranorex.AutomationHelpers.Modules.ReportToPDFModule.ConvertReportToPDF(String pdfReportPath, String xml, String details) in C:\myproject\Ranorex\myprojectRx\RanorexAutomationHelpers\Modules\ReportToPDFModule.cs:line 154
at Ranorex.AutomationHelpers.Modules.ReportToPDFModule.CreatePDF() in C:\myproject\Ranorex\myprojectRx\RanorexAutomationHelpers\Modules\ReportToPDFModule.cs:line 104
I compared my version of the .rxlog.data file with the one created by the Ranorex solution: it is true, mine is missing those 'activity' elements inside 'activity', just as the error message above says.
Maybe I am missing a correct link to this module, or not using correctly the calls to 'Report' to report in my C# code?

Note that I can open my .rxlog file within Ranorex Studio and can see what I am recording there. But I need to convert that to PDF.
I start "reporting" within my Main method with just:

Report.Start();

Then through out my code I just use Report.Log or Report.Error as needed.

Anyone has managed to correctly convert to PDF reports created with C#? I do not use the Ranorex Studio at all, just Visual Studio.

Thanks,