Hi,
I am trying to print using a custom report template built using ArcGIS Pro. The goal of the report template is to display a map of a selected parcel and attributes describing the property.
The datasource is a large parcel dataset that is consumed in a custom javascript application that uses the print component. I followed directions to create the report template and publish a new print service with the template as a report option. In my app I am able to update the reportOptions "sourceId" to point to my parcel layer and then pass the updates to the print component as a printTemplate.
My Question: Is there anyway to pass a definition query or a filter as a report option to only display a selected feature in my source layer instead of everything in view? Or do I have to apply the definition query directly my source layer?
thanks,
Britt
@Noah-Sager I watched your presentation from this year's Dev summit. Appreciate all the great info. It really helped to get me started. Any chance this question is in your wheelhouse?
Solved! Go to Solution.
The short answer is yes, you can do what you're talking about. The key to it is implementing a RequestInterceptor that captures the print service request before it's sent, and modifies the request to include the definitionExpression that you want for your request, but not necessarily for the layer presently in your map. That way you don't have to assign it directly to the layer.
Note, interceptors are added to the "interceptors" property of esriConfig.request.
The short answer is yes, you can do what you're talking about. The key to it is implementing a RequestInterceptor that captures the print service request before it's sent, and modifies the request to include the definitionExpression that you want for your request, but not necessarily for the layer presently in your map. That way you don't have to assign it directly to the layer.
Note, interceptors are added to the "interceptors" property of esriConfig.request.
Joel, thank you for the direction and helpful links. I'll give it a try.
-Britt
Joel, I added this to my print component in my app and it did the trick. Thanks again!