Null parameter in sub report causes sub-sub report to fail

631 Views Asked by At

I am using active reports version 3.2

I have a report with sub report A. Inside sub report A there is sub report B.

Report passes parameter X to sub report A Sub report A passes parameter Y sub report B

If the result of subreport A is empty then B fails throwing a null exception error while doing some regex.

I have tried several methods to fix this.

I have added a default parameter, this still fails. <%'OtherModuleRef'|Enter a module|'00000000-0000-0000-0000-000000000000'|S|False%>

I have changed the SQL to detect a null and generate a valid query. This also fails.

What else can I try?

1

There are 1 best solutions below

1
On

I could not find a good way of fixing this. Tho I did invent a workaround.

In the first sub report, on the no data event add the field the sub-sub report needs and set it to a "null" value. The report will work as normal if there is data and work if there is no data in the sub report.

Sub ActiveReport_NoData
    rpt.Sections("Detail1").Visible = False
    rpt.Fields.Add("OtherModuleRef")
    rpt.Fields("OtherModuleRef").Value = "00000000-0000-0000-0000-000000000000"
End Sub