Skip to main content

Documentation for report scripting



  • Ryan Cooney

    Berend Veldkamp, can you provide some details about the use case you are trying to solve that needs access to the map service URL?

    I don't believe it is possible to log debug information to the report log. The script runs in a specific security context that seems to disallow that. I was able to attach a Visual Studio debugger to the running instance as described here This is something that should only be done in a development environment though.

    A cheeky workaround for logging is to put a Label control somewhere on you report and have your script write any log messages to the Text property of that control so they show up in the report output.

    You can get at the data sources of the report like this. Also documented here

    I am not aware of any way to get the identity of the user. If this is possible it would not be via any supported API. I will take a look at whether we can expose the user name via expressions.

  • Berend Veldkamp

    Hi Ryan,

    One of our customers wishes to include filenames when adding attachments to a report. To do this, I'd need to copy the functionality of the multiple feature attachment control, and include a label. Someone posted an idea, but that was two years ago.

    In the mean time I've found out how to get the datasource, but apparently that's a SqlDataSource, and not a feature service. If the attachment information is there, it's hard to figure out where exactly.

    If I can get the ArcGIS token, retrieving the identity of the user would be trivial, it's a request to the /self REST endpoint.


    So far I've used a label as a poor man's debugging tool, but it's cumbersome. And in any AfterPrint event it doesn't work at all. 

    Do you have some more information about how to use Visual Studio to debug? I have connected VS to the remote debugging tools, and included System.Diagnostics.Debugger.Break(); in my reporting script. I think that line gets hit, because VS is trying to load a temporary file (ogqc4ups.0.cs), which I think would be the script I wrote. It should be in C:\Windows\Temp, but I can't seem to find that file on the reporting server.



Please sign in to leave a comment.