Posted 15 March 2018, 8:16 pm EST
Hi,
Since the HTML5 Viewer is a client side viewer, all the report processing is done internally through the ActiveReports.ReportService.asmx service. For your requirement to debug the script, you would need to use a custom ReportService which inherits from the ActiveReports ReportService and create an object of SectionReport with its EnableScriptDebugging property set to true.
public class CustomReportService : GrapeCity.ActiveReports.Web.ReportService
{
[WebMethod]
protected override object OnCreateReportHandler(string reportPath)
{
switch (reportPath)
{
case "Reports/Invoice.rpx":
SectionReport rpt = new SectionReport();
XmlTextReader xtr = new XmlTextReader(Server.MapPath(reportPath));
rpt.LoadLayout(xtr);
rpt.EnableScriptDebugging = true;
rpt.Run();
return rpt;
default:
return base.OnCreateReportHandler(reportPath);
}
}
}
To be able to debug through the script, add the following line of code in the ReportStart event in the script section:
public void ActiveReport_ReportStart()
{
System.Diagnostics.Debugger.Launch();
}
Now, put a breakpoint on the rpt.Run() line and run the application. When the breakpoint on rpt.Run() is hit, press F11 to step into the report script to debug.
You would also need to change the reportservice url in the HTML5 Viewer:
viewer = GrapeCity.ActiveReports.Viewer({
element: '#viewerContainer',
reportService: {
url: 'CustomReportService.asmx'
},
Hope it helps
-Abdias