Hi,
I am trying to create print templates which enable the user to add more text to a layout than just the title and author. I have added elements to the mxd and named them and tried to call them using CustomTextElements, but do not know how to make the text box for the user to enter the text into appear within the print widget. I'm sure I'm missing something simple?! I am using the Web Appbuilder in ArcGIS Portal 10.4 and also have access to WAB for Developers 2.0.
Please help,
Thanks,
Helen
Helen,
Check out this link to Publishing Additional Services for Printing. It's a tutorial that will walk you through the steps to get set up allowing users to customize the custom text elements of their web maps.
Michael
Thanks Michael,
That's exactly the tutorial I used to publish my print services and custom templates. However, I need more information on the custom text elements, unless I'm missing something, this tutorial doesn't cover this?
Helen
At the Developer Conference this year I saw a presentation on this very subject. One of the presenters was Tanu Hoque and he was an enormous help via email. Maybe try connecting with him to sort it all out.
Question, are you running server 10.4? I believe if it's an earlier version of server there are additional steps that need to be taken.
Below is the info Tanu forwarded to me:
You need to create a script tool with following parameters
nb: the name of the first parameter shouldn't matter.
Again, this script/task only to provide metadata information for each layout templates… which helps Web App Builder’s print widget to show those options in it.
This requires running a python file to generate the script tool and I do not see a way to attach the script (GetLayoutTemplateInfo.py).
Thanks Michael Miller. I'm glad i was able to help.
Helen Whiteley, it is step# 8 in "Preparing and publishing the service" section in that help that describe how to add that additional task to the printing service in 10.4. WAB printing widget (though i'm not sure which version) looks for that GetLayoutTemplateInfo task in the printing service; if it finds it, it uses metadata from each layout and show text boxes to allow you set values for your custom text elements.
This is something new in 10.4.
Hope this helps.
Thanks Tanu Hoque, that's great to know it is possible to easily add custom text elements. However... I am following the steps in 'Tutorial: Publishing additional services for printing' to the letter - I am running the GetLayoutTemplateTask and adding it as a result in Service Properties. The added in elements do show on the maps, but there is nowhere in the print widget for me to manually enter text to fill these elements, which, if I understand your explanation correctly, there should be? I have tried both restarting the existing service as well as publishing a new one, but I still only receive the 'Author' and 'Copyright' options under Layout Metadata, under Advanced.
However - I have taken a copy of one of the default templates at Program Files\ArcGIS\Server\Templates\ExportWebMapTemplates, added a Custom Text Element to this, restarted the service - and this works as it should, with an extra text box displaying below Layout metadata, so the issues are only with print services I have published myself.
Any idea what I'm doing wrong??
Thanks,
Helen
My bad, I misunderstood.
So, if I understand it correctly:
if those are correct, i have few questions:
Hi Tanu,
That is correct. The custom text elements do show up on the output maps, but not in the WAB print widget.
Unfortunately the print service is not public. Executing the Get Layout Templates from the REST endpoint returns the correct JSON eg
{
"results": [{
"paramName": "Output_JSON",
"dataType": "GPString",
"value": [
{
"layoutOptions": {
"hasAuthorText": false,
"hasCopyrightText": false,
"hasTitleText": true,
"hasLegend": true,
"customTextElements": [
{"Test": "Text"},
{"SubTitle": "Text"}
]
},
"pageSize": [
296.92659385318774,
209.97375328083996
],
"layoutTemplate": "A4_Landscape",
"activeDataFrameSize": [
273.05060000000003,
146.0503
]
},
and the script tool was pointing to the correct folder when I ran it.
I have used Fiddler to record the requests and get a 'no entry' sign next to the request in question which apparently means Session was aborted by the client, Fiddler, or the Server.
# | Result | Protocol | Host | URL | Body | Caching | Content-Type | Process | Comments | Custom |
---|---|---|---|---|---|---|---|---|---|---|
506 | 200 | HTTPS | cp-gis-iis.infprod.tca | /arcgis/rest/services/Geoprocessing_Services/WorkingTemplates/GPServer/Get%20Layout%20Templates%20Info/execute?f=json | 495 | private, must-revalidate, max-age=0 | text/plain;charset=utf-8 | iexplore:3740 |
I'm an amateur with Fiddler, so don't know how to delve deeper.
Having a look in the Chrome web traffic information it seems that the Get Layout Info task is timing out: n {message: "Timeout exceeded", response: Object, status: undefined, responseText: undefined, xhr: XMLHttpRequest…} It does take a long time for the print widget to populate the layout information. I have tried increased the times and pooling in the Service Properties, but to no avail. I have tried publishing different print services, but have the same issue with them all. Have you any ideas what might be causing this and how to solve it?
Thanks,
Helen
hmm... so you are saying if you execute it from the REST service directory, it works fine. But the same service when used with the Printing widget, it times out!!
how long does it take for it to finish when you execute it from the REST service directory?
are you templates empty or they contain some layers?
if it is all about timing out, I'm sorry I don't think i have much expertise in that area to help could you please contact Esri Support and have someone take a look at that?
Did you ever get this resolved i am having the same issue