SubReports from different layers
I would like to make a report that has the attributes of features from different layers (for example parcels, zoning, school district, neighborhood association, etc). I thought that if I made a report for each layer I could include all of those as subreports in a main report. I created two reports (one for parcels, one for zoning) which both work when used seperatley. Then I tried adding a "SubReport" control in the Report Designer to the parcels report that used the Tag field set to the name of the zoning report file (zoningSubReport.rpx). I add both reports to the Site, each attached to its layer (Map -> Layer -> Report Tab -> Add Report). When I try and run the report in a SilverLight Viewer (Tasks -> Run Report -> pick report -> click on map) I get the error: The report operation could not complete successfully. Please contact your system administrator for assistance. When I check the logs I get this:
<Event Timestamp="2013-06-21T11:51:17.6848666-06:00" Level="ERROR" Identity="Guest"><Message>Exception has been thrown by the target of an invocation.
Specified datatable 'zoningSubReport' does not exist in the dataset.</Message></Event>
Am I missing the method for getting the subreport "registered" or recognized with the site? Is it possible for one report to have subreports that work with seperate layers? That seems like the point of subreports, but I guess I am doing it wrong. Any help would be appreciated.
Thanks,
Mike
-
Am I understanding your goal correctly in that you're trying to run a report that pulls information from underlying layers (e.g. a parcel report that also reports the school district it is spatially located in)? If so, the easier way to retrieve this information is through data links, not rpx files.
The error you're getting is likely being thrown because the supreport you're trying to run isn't attached to the main report layer, so that layer isn't aware of the subreport's existence. To return values from other data sources, you can use data links to connect to other databases and tables using both attribute joins and spatial relationships.
Are your data stored in a spatial database (e.g. SQL Server 2008 or later)? If so, you can create a spatial query as a data link and use it in your subreport to retrive underlying layers' attributes. I can supply a quick example if you are using SQL Server, as I have both tabular and spatial data links that are being used in a parcel report to pull information from other tables and databases.
0 -
Yes, that's right - I need data from different layers in one report. I don't know much about data links, so I will have to read up on that.
The data comes from feature classes in a file geodatabase, as served through ArcGIS Server 10.1.
I thought that to attach the subreport to the main report I just had to specify the location of the subreport file in the Tag property (of the subreport control) of the main report.
Thanks for your help. I will check out data links today and see what I can figure out.
Mike
0 -
Well, I think I struck out. I tried setting up a Data Link with our SDE server, which is using SQL Server 2005. I got the Data Connection to work. But it seems like you can only set up a data link using an attribute link. But I need a spatial link. The user is clicking on the map to generate the location to search for the attributes of all the different layers. Is there any way to do this?
Thanks,
Mike
0 -
Mike
Have you looked in the code gallery under Workflows and Forms at the "Where I Live" Drill-down workflow with subreports?
Jimmy Brink
0 -
Hi Mike,
A Layer Report is designed to be run from only one layer. By adding the report to a particular layer configuration, when that report is run, it will only look within the layer that it belongs to for the fields to display in the report.
If you need to combine data from multiple layers into one report, you must use a workflow to assemble the data from each layer into individual data tables, which would then make up a data set that can be passed to the main report. You will still need to use sub reports for each layer, as each rpx file can only read one data table. The Tag field on the subreport control must contain the path to the subreport rpx file, and the Report Name field must contain the name of the data table that will be used by that subreport.
Please take a look at the code gallery sample workflow and reports (https://support.geocortex.com/using-a-workflow-to-generate-a-multi-layer-report-with-map-1) located here for more information.
-Victoria
0 -
Thanks Jimmy for the pointer to the Where I Live workflow, I have been working on that to see if I can get it to work for me.
And thanks Victoria for the explanation. I didn't see anywhere in the Help that stated what you said - reports can only work with one layer, even subreports. I will take a look at the Geocortex workflow as well.
Thanks,
Mike
0 -
Hello Victoria, can you provide the link again to https://support.geocortex.com/using-a-workflow-to-generate-a-multi-layer-report-with-map-1. The one mentioned above is broken. 0 -
For historical purposes, the new link is -
https://support.geocortex.com/essentialsGSCCodeGallery?sub-nav=codegall&main-nav=essentials&#!/feedtype=SINGLE_ARTICLE_SEARCH_RESULT&id=kA460000000bllT
Regards,
Wayne Richard
Latitude Geographics Group Ltd.
Head Office: 300 – 1117 Wharf Street Victoria, BC Canada V8W 1T7
Tel: (250) 381-8130 | Fax: (250) 381-8132 | wrichard@latitudegeo.com
Developers of Geocortex web-based mapping software | www.geocortex.com
An Esri Platinum Business Partner0
Please sign in to leave a comment.
Comments
8 comments