WAB Print Widget & AGS Print Service Handshake

329
6
07-14-2020 02:50 PM
Arne_Gelfert
Regular Contributor

This is Part 3 of a series of Q&A around customizing Print widget and printing service. For context, Part 1 and Part 2

So far...

  1. COMPLETE - Managed to publish custom print services with custom layout templates that meet my needs.
  2. COMPLETE - Managed to hook the print widget into that service and limit user input to a choice of "layout template" and "output filename'.
  3. Question: What's the use of taking user input for an output filename if the printResultDijit's url  is linked some gobbledeegook PDF in the print service output directory ? I've not been managed to tell the print service what kind of file names it should generate for the printing output. Is that possible? The "My Favorite Output" link actually takes you to some PDF with a very different name.

My understanding of the Share as Web Tool menu is that the parameter Output File does not actually specify the name of the file that will be generated but rather than name of the variable for that name??

If I enter "gobbledeegook", that actually changes the name of the parameter...

Long story short, how can I turn a download link such as:

arcgisoutput/Custom_GP_Services/MyGPService_GPServer/_ags_ea388fcde7ab4bb498c2004ee55ec796.pdf‍

into something like

arcgisoutput/Custom_GP_Services/MyGPService_GPServer/no_gobbledeegook.pdf‍

or - if that's not possible - at least:

arcgisoutput/Custom_GP_Services/MyGPService_GPServer/no_gobbledeegook_except_ags_ea388fcde7ab4bb498c2004ee55ec796.pdf
0 Kudos
6 Replies
Noah-Sager
Esri Regular Contributor

This is a current limitation of printing with the 3x API, which Web App Builder is based on. If you are using 4x, or Experience Builder (which is based on 4x), then this property will take effect if the application and the print service are on the same origin.

fileName: TemplateOptions | ArcGIS API for JavaScript 4.16 

title: TemplateOptions | ArcGIS API for JavaScript 4.16 

0 Kudos
Arne_Gelfert
Regular Contributor

Thanks, Noah! Good to know although - arghh !! When will all this 3.x/4.x go away? Until very recently, I have been told by ESRI staff to not even worry about ExperienceBuilder. Sounded more like the Experimental Builder. So I've ignored it. I will stop ignoring it.

0 Kudos
TanuHoque
Esri Regular Contributor

Hi Arne,

I'm just curious to know what purpose would no_gobbledeegook name serve for your use case?

THanks.

Tanu

0 Kudos
Arne_Gelfert
Regular Contributor

Tanu, thanks for chiming in... if any of my users actually want to save the file or attach to email, it would be great if they didn't have to completely rename it... especially since the Print widget context menu suggests that the file will have a name.... It's not a major issue because I can generate the file I need but it's not fully thought through in my view.

TanuHoque
Esri Regular Contributor

Thanks Arne.

I see why you need that it makes sense.

0 Kudos
Arne_Gelfert
Regular Contributor

Great. Look forward to fixing this down the road with ExperienceBuilder!

0 Kudos