How to pass editable "Title" from Print Widget to the custom print service?

873
7
03-27-2023 07:49 AM
RoseZhou2
Occasional Contributor

Hello,

In this Print Widget documentation , it says we can provide editable settings for the title:

  • Title—Specify the printed file name, and the map title when applicable

How to make the "Title" to show as the map title in printed map? What should be added in the print layout template?

Thanks

Rose

0 Kudos
7 Replies
RoseZhou2
Occasional Contributor

More info:

In my print layout template, I have a dynamic titleText like this:

<dyn type="layout" property="metadata" attribute="title" emptyStr=""/>

But the title entered in Print Widget did not pass into the template.

Thanks

Rose

0 Kudos
ShengdiZhang
Esri Regular Contributor

Hi @RoseZhou2 ,

It should work.

Can you check the Get Layout Template Info task of your print service? You can access it using a URL with the following format:

https://webadaptorhost.domain.com/webadaptorname/rest/services/Utilities/PrintingTools/GPServer/Get%20Layout%20Templates%20Info%20Task 

Execute the task, and see if the "hasTitleText" is true in the layout options.

ShengdiZhang_0-1680248255320.png

Shengdi

0 Kudos
RoseZhou2
Occasional Contributor

@ShengdiZhang Thanks for your response!

I confirm that the "hasTitleText" is true in the layout options. I tested the same print service using a Web AppBuilder application, the entered "title" in the Print widget was shown up correctly in the printed PDF. It seems that it's an issue in ExB.

Regards

Rose

0 Kudos
ShengdiZhang
Esri Regular Contributor

I tested the ExB print widget, using ESRI's default print service, and the map title changes when I enter a different name in the Title input box.

ShengdiZhang_0-1680487882291.pngShengdiZhang_1-1680487913915.png

Would you mind sharing your print service with me (via Direct Message) so I can take a look?

Thanks,

Shengdi 

0 Kudos
RoseZhou2
Occasional Contributor

Thanks @ShengdiZhang  for looking into this!

I added a new Print widget in my application, then the map title changed based on what's user's input in the Print widget. So it must be cached somewhere. 

But I encountered a new issue. The "Include legend" checkbox can't be turned on anymore. Please see the screen shot below. Not sure if it's related.

RoseZhou2_0-1680527243044.png

 

Thanks

Rose

0 Kudos
ShengdiZhang
Esri Regular Contributor

Thank you for bringing this issue to our attention. It is a known issue and we plan to include the fix in the next release.

0 Kudos
PierreloupDucroix
Occasional Contributor II

Hi,

when looking at my Get Layout Templates Info Task result, I can see "hasTitleText": false.

How can I set it to True ? I don't see any parameter when publishing the GPservice.

[EDIT] there were two dynamic attributes in my dynamic text element (Title and page format), this was the cause of hasTitleText being False. Setting "Title" dynamic text alone allowed hasTitleText to be True.

Thanks

0 Kudos