Skip to main content

Report with map showing all selected features (Code Gallery Sample)

Comments

7 comments

  • Permanently deleted user

    Hi Ralph,

    This sample uses a MainMap control to display the map with the selected features. This means that it will display the map at whatever extent you are currently viewing in the application. So if you have clicked on the first result, or used the workflow to set the extent to the first result, when the report is run, it will display with the first result centered. If you set the map extent zoomed out a ways, it will display how you expect with all of the selected features showing.

    -Victoria

    0
  • Permanently deleted user

    Hi Victoria

    I was driving the report using by supplying a geometry to the Geocortex.Workflows.Activities.Report and selecting on a point layer of addresses

    /customer/servlet/servlet.FileDownload?file=00P6000000e88EpEAI

    So I don't actually interact with the extent at all of the select items.

    At the stage of running the report via the workflow there are no selected features. 

    The map extent is enough to select all of the points to be reported on.

    I would assume that something is in the Report activity that is doing the extent changing that you describe to have the described consequences. Doing it this way kept it all very simple as compared to using the TemplateReport activity.

    Any further thoughts would be appreciated.

    Thanks

    Ralph Price

    0
  • Permanently deleted user

    What do have specified for Report Extent Type? Whatever you put in that field will determine the extent of the Map image used in the report. If you leave it blank, I believe it will use the current extent of the map.

    -Victoria

    0
  • Permanently deleted user

    Hi Victoria

    I had Geocortex.Essentials.Client.ReportParameters.ReportExtentType.CurrentExtent. I have now removed that setting

     

    I am assuming that the sub-report should be configured as a Report against my address layer that the Main Report runs against.

    What options should be turned on for it.?

    • perform data linking?
    • include feature maps?
    • output formats?
    • visible?

    I did have it working for just a moment with CensusMap.rpx but the name made no sense so changed the name updated the main report and then managed to break the whole thing  and getting this in the "system.Date.log":

    <Event Timestamp="2012-06-28T12:42:49.1267326+12:00" Level="DEBUG" Identity="Guest"><Message>InvalidOperationException: Generating a map image for a map-to-dataset transformation failed because the Map reference was null.

     

       at Geocortex.Essentials.Reporting.Transforms.MapDataTransformer.GetObjectDataTable()

     

       at Geocortex.Essentials.Reporting.Transforms.MapDataTransformer.Execute()

     

       at Geocortex.Essentials.Reporting.ReportRunner.GetReportContextData(ReportContext reportContext, ImageTable imageTable)

     

       at Geocortex.Essentials.Reporting.ReportRunner.GetReportContextData(ReportContext reportContext, ImageTable imageTable)

     

       at Geocortex.Essentials.Reporting.ReportRunner.RunInternal()

     

       at Geocortex.Essentials.Rest.Resources.RunLayerTemplateReportOperation.Run(RunTemplateReportOptions options)

     

       at Geocortex.Essentials.Rest.Resources.RunTemplateReportOperation.RepresentAsJson()

     

       at Geocortex.Essentials.Rest.Resources.ResourceBase.WriteJson()

    TargetInvocationException: Exception has been thrown by the target of an invocation.

     

       at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct&amp; sig, MethodAttributes methodAttributes, RuntimeType typeOwner)

     

       at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)

     

       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)

     

       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

     

       at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)

     

       at Geocortex.Essentials.Rest.EssentialsRestRequestDispatcher.ProcessRequestUnderContext()

    RestException: Exception has been thrown by the target of an invocation.

     

    Generating a map image for a map-to-dataset transformation failed because the Map reference was null.

    </Message>

     

    </Event>

    Thanks

    Ralph

    0
  • Permanently deleted user

    Hi Ralph,

    You don't need to configure the subreport as a separate report on your layer. Because it is the main report that call it, and you will likely not want it to be available as a report template in the viewer, it only needs to live in the same folder as the main report. 

    Make sure that the Tag field on the subreport control in the main report matches the name of the map subreport, including .rpx. If you don't add the subreport to the reports on the layer in Essentials, no one will see the name of the subreport.

    -Victoria

    0
  • Permanently deleted user

    Hi Victoria

    that makes things much tidier. It also means that I can use the same subreport with more the one layer reports without adding configuration for it each time

    However I am getting this message in the logs when I run the report:

    <Event Timestamp="2012-06-29T08:30:47.1045747+12:00" Level="WARN" Identity="Guest"><Message>Encountered a sub-report definition with ID "CensusMap" in the report definition "0", but the sub-report does not exist in the report template. Removing the erroneous sub-report definition...</Message></Event>

    The REST manager, I assume, thinks that it has an definition of the report 'cached' but the current version of the main report does not have any reference to 'CensusMap' in it .

    Do you know when the rpx file is read and  how to trigger it to get read again. Or is this something that is getting cached at the client browser end. I have beeen clearing Temp Internet files in my browser as well.

    Thanks

    Ralph Price

     

    0
  • Permanently deleted user

    Generating a map image for a map-to-dataset transformation failed because the Map reference was null.

    I was getting this error to. When you have added your report to the config/manager and you did not include the subreport it won't work. You have to add the report with the sub report already avaible.

    So don't make the main report -> add it -> test it -> success -> edit the main -> add the sub report -> test this won't work.

    Fast solution remove and add you report again. It will include a extra tag in your XML holding the sub reports (you won't see this in the manager).

    0

Please sign in to leave a comment.