Skip to main content

Request for ideas for a drill-down report

Comments

8 comments

  • Permanently deleted user

    So far, I'm thinking that I need to create one report template for each layer I want to query.  These subreports will only have labels and field values.  Then I'll have one master report which positions all the subreports, probably within the detail frame.

    Then, I'll need to make a workflow harnessing the following activities: QueryTask, FeatureSetToDataTable, TemplateReport, CreateTempFile.  Although, I'm not sure exactly how I'll string them together in a meaningful way.  But what I'm hoping is that the master report will have general items like a heading and copyright/disclaimer, while the subreports will be populated with data from the ArcGIS Server layers.

    Any other ideas or information would sure be appreciated.

    0
  • Marc Rempel

    I am needing to do something similar and thanks for describing your thought process. 

    As I understand it you need to add the datatables from the FeatureSetToDataTable activity to a DataSet for the TemplateReport.  I assume that can be done by gusing the AddToCollection activity specifying the System.Data.Dataset[] for the TypeArgument?

    Assuming that works, I understand that the output of the TemplateReport is a byte array (Byte[]).  Does anyone have ideas how to turn the Byte[] into a clickable/launchable report ?

    Marc

    0
  • Permanently deleted user

    I'm assuming that's what CreateTempFile does.  AddToCollection is a good idea.

    Where I'm at now is just trying to get a basic report working as a tool.  I want the user to click my custom tool, then click a point on a map, and then have a master report show up with only one sub-report (parcels) ready to be viewed and/or downloaded.

    Not much luck so far.

    0
  • Permanently deleted user

    I just wanted everyone to know that I've got this working now.  I've got a report that queries 7 different ArcGIS Server services (all of which are mine) and combines them into one report.  It's been fun, once I got the right piece of knowledge.

    Here are the key pieces of information that may help you generate reports out of multiple layers like I did:

    • The report does not need to be in the Print Templates area of the site, nor assigned to a Map layer on the Reports tab.
    • You DO need to make a workflow and add the workflow to your site.  Then have a viewer button call RunWorkflowById with the Id of your workflow.
    • It's up to you what the user interface looks like.  You can use a workflow container (a UI panel) or not.  I did, but now I don't.
    • At some point, I get the user's click with the Capture Geometry activity (Common ClientJ).
    • Your sequence needs to have a variable of type DataSet with a Default expression of New System.Data.DataSet.
    • I have a Parallel activity, and inside it I have one Sequence activity for each layer I want to pull data from.
    • Inside each Sequence activity, I have the following activities in this order:
      • Query Task activity (ArcGIS Server)
        • I specify Query Service Url, specific Out Fields, and Return Geometry False (for speed).
        • I store the Result in a variable whose scope is the Sequence.
      • FeatureSet to DataTable (Conversion)
        • I take the variable from Query Task and assign it to a DataTable variable, that also has the Sequence as its scope.
      • Assign (Common Server)
        • The To parameter is [myDataTable variable].TableName.
        • The Value parameter is a unique string, such as "Zones".  This String identifies the data for each subreport (see below).
      • Invoke Method (Common Server)
        • The MethodName is Add.
        • The TargetObject is [myDataSet variable].Tables.
        • Create a parameter in the Parameters list that looks like this
          • Direction = In
          • Type = System.Data.DataTable (or just DataTable)
          • Value = [myDataTable variable]
    • Below the Parallel activity, I have the following activities in this order:
      • Template Report (Common Server)
        • DataSet is myDataSet variable.
        • Output Format is Geocortex.Reporting.ReportFormat.Pdf.
        • Report Data must be a new variable.  The Workflow Designer helps you create it of the right type.
        • The Template Uri is the full path to the master report on the hard drive, with forward slashes instead of backslashes.  My experience is that this Uri doesn't understand Essentials replacement tags with curly braces.
      • Create Temp File (Common Server)
        • Content is the variable from Template Report.
        • Content Type is "application/pdf".
        • FileName is whatever you want.
        • Partial Url is a new string variable you create.
      • Display Hyperlink (Common Client): Hyperlink URI is a fixed path to your REST directory, then a plus sign, then the variable name from Create Temp File.  Set the Hyperlink Text, Target, Title, and Message as you will, but you can leave Add/Remove Buttons alone, and you'll automatically get a Close button.

    Now that you know what to do with the workflow, here's what needs to be true for the reports:

    • The master report must be in a directory accessible to Essentials.
    • The Master report is an .rpx file and contains all the map surrounds, such as title, graphics, page number, etc.
    • Inside the master report, you'll have one Subreport for each layer that you queried using Query Task.  Set the properties like this:
      • ReportName should be equal to the string you gave the TableName property in the Assign task in the workflow.
      • Tag should be equal to the name of the subreport's file name, complete with .rpx extension.  The subreport file should be in the same directory as the master file.
      • The (Name) of the subreport component can be anything.
      • You'll probably want the subreports to CanGrow, CanShrink, and Visible all set to True.
    • The subreport can look how you want it.  Many of my subreports are just one line with a field label on the left and a value label on the right.
    • Data-bound labels should have their DataField property set to the name of the field in the web service that you queried with the Query Task.  Don't surround it with quotes even though it's a string.

    Hopefully this is good information to get any of you started on such a task.  I still am not quite sure how I'll get a map in the report, but I haven't tried either.  It could be as simple as adding a Main Map to the master report, but may involve a task or two from workflow since a report map is really a DataTable in a DataSet associated with the report.

    I hope this post is really popular and I become famous!!  :)

    "Roj"

    0
  • Marc Rempel

    Thanks Roger,

    You just saved me a lot of trial and error.  Enjoy the fame.

    Regards,

    Marc

     

    0
  • Permanently deleted user

    Thanks for the tips Roger - much appreciated.. I'm sure I can put some of those actions to good use.

    mate - you'd be even more famous if you posted onto the "Code Gallery".

    We had some training last week in workflows with our local distributor and we did some of this stuff with selections on geometry and then passing to reports with subreports and maps... I'll see what I can dig up. It may be useful???

    cheers

    G

    0
  • Permanently deleted user

    I'll submit stuff to the code gallery when I'm happy with the final result.  I would like to know what you learned about getting maps into a sub-report, though.  I don't know how to get or populate a DataTable with map information that the report needs.  And do I associate the map with a layer in Essentials Manager or not?  Still open to suggestions and ideas to try.

    "Roj"

    0
  • Permanently deleted user
    I am using your example from the Code gallery to create a similar workflow that will generate a report for address assignments. I am getting the following alert when I try to run the report.

     

    "There was a workflow error running activity: Exception has been thrown by the target of an invocation. Workflow 'Address Assignment Report' failed. Unhandled exception: 'Access to the path '\\geoctxdev001\essentials\Trans\RESTElements\Sites\Resources\TemplateReports' is denied.' in activity '1.29: Create Master Report'. 

     

    Does anyone have any ideas why access to this path is being denied? I have verified in securities/permissions that all domain users and all application packages have Full control. I have no problem accessing the network path in my browser. It seems to me like this might be some issue with permissions for essentials?  Any ideas would be appreciated. Thanks.
    0

Please sign in to leave a comment.