Select to view content in your preferred language

Formatting Custom Text Elements in Print Task

7889
14
06-19-2014 10:35 AM
MichaelVolz
Esteemed Contributor
I am creating a parcel search app where the selected parcel's information is added to a print-out with a custom print task.  I am using customTextElements to achieve this goal.  For the layout I have a field alias name and then I want the value next to it and then a carriage return for the next field alias and its value and so forth for all the parcel fields that I would like to display.

I have 2 issues with this setup.
1.) I would want the starting point of the values to line up vertically.  I started out with a few spaces between the alias and the value, but aliases are different lengths so the start of the values did not line up vertically.  I tried some formatting (<p> </p>, %nbsp;,<blockquote> </blockquote>), but none of them worked.

2.) I want the value to wrap if it can not fit in the row provided, but I want it to continue to be lined up with the values.  Currently, it wraps to the beginning of the next line which where the field alias is displayed.

Any help or hints to solve these issues are greatly appreciated.
0 Kudos
14 Replies
MichaelVolz
Esteemed Contributor

Kevin:

I copied your code into an html file on my IIS server, but I do not see a print button.  This is the same behavior that occurs when the proxy file is not set up correctly in my testing environment.

Is the proxy in your sample pointing to your own specific proxy file that has been modified specifically for your environment?

I also ran into a problem where it appeared that I would need to destroy print widget after each print, but I was never able to get that to work.

Updated response 6/19/2015

Our organization is running into an issue where each time the print task is called a new print button is generated and the old print button is still there, so after 3 prints the print button appears 3 times.  We have tried to destroy the printer object but we are having difficulty in finding the appropriate location for this piece of code.  It seems we either place the destroy in a location where the print button does not yet exist or the call to destroy the print object never fires.

Did you ever solve this problem that was similar in your code?

0 Kudos
MichaelVolz
Esteemed Contributor

Bumping this thread up to see if any progress was made on this issue by Kevin or anyone else who is familiar with this print workflow.

0 Kudos
by Anonymous User
Not applicable

Hi Michael,

I had it basically working. There was an issue with one of my lines of text based on a variable but that was not related to this, but another portion of my site. It only needed about another day or few of work but that was one day past the deadline. I have not worked on that project since. I will probably be back on it at some point this summer.

I will post the particular code to gitHub and a link to the production site as a demo link as well.

However, this is also an area ESRI should work on in the API. The Print widget should support this object from Arc more fully, out of the box.  At least add the ability to support HTML.  For now, I had to 'hack' it into a table with the newline character.  Ability to add text or tables onto a Printout I would imagine would be quite popular with us users. I can see how great it would be, too, if they wire it up to WebApp Builder Developer and allow us to create this kind of functionality from the WebApp Builder graphical user interface! 

0 Kudos
MichaelVolz
Esteemed Contributor

Kevin:

You were able to resolve the issue of it only working on your first search?  I ask because my organization is having an issue with a new button getting creating each time someone chooses a template from the Print dropdown box.  We would like to be able to either destroy the button or hide it until someone clicks the Print dropdown box again to generate additional printouts, but are difficulty getting this to work.

0 Kudos
by Anonymous User
Not applicable

hmm I will have to get back in to this and remember etc. But that disappearing button etc I solved easily. That was a matter of destroying and recreating the dijit if I recall off the top of my head correctly.  I will reply back sometime soon perhaps next week when i can take a look. And it worked  each time, ie more than once.

0 Kudos