I have a main report looking like this (see below). It has 2 row groups + the detail group. The row groups is a hierarchy of countries and cities, where cities are initially hidden but can be toggled on from the country field (+). The detail group contains a population number. Now, I want to put a subreport in the field below the number (this field is part of the details group), so that when the cities are collapsed, the subreport shows the data for the country, whereas when the cities are expanded, the subreport is shown for each city and with data for that city.


Country City Population


[+] Denmark 2050000 * Subreport to go here ! *


[+] France 4025000 * Subreport to go here ! *


[-] Italy Milano 1600000 * Subreport to go here ! Rome 2300000 Subreport to go here ! Torino 1250000 Subreport to go here ! Total 5150000 Subreport to go here ! *


[+] Netherlands 3825000 * Subreport to go here ! *


[-] Norway Kristianstad 320000 * Subreport to go here ! Larvik 450000 Subreport to go here ! Oslo 800000 Subreport to go here ! Total 1570000 Subreport to go here ! *


[+] Spain 5250000 * Subreport to go here ! *


[+] Sweden 1800000 * Subreport to go here ! *


Total 23670000 * Subreport to go here ! *


But when I do that, and try to test the report in the Preview pane of BIDS, I get the error message "An error occurred during local report processing. Object reference not set to an instance of an object.".

I have managed to make the report work, including the subreport, if I set the "Hidden" = False and "ToggleItem" = blank in the "Visibility" pane of the Group Properties dialog for the Country and City row groups. So there is nothing wrong with the subreport or with the parameters between main report and subreport. But as soon as I switch on the "Display can be toggled by this report item" feature for the City group, the report fails with abv. error.

Anyone able to help? Have struggled with the issue for 2 days now ...

0

There are 0 best solutions below