Print Task API3 AGS 10.1 Layout Option CustomTextElements

6780
12
07-15-2012 11:52 PM
SchoppMatthieu
New Contributor III
Hello,

I'd like to know how to handle the "customTextElements" property of the LayoutOptions (PrintTask) back in the template.mxd
"title" and "author" use standard "dynamic text" - (e.g. <dyn type="document" property="title"/>)

What about customTextElements ?

Can we send other objects like an overview map to the printing-geoprocessing service ?

Can I find somewhere some documentation about how to extend the printing geoprocessing tool ?

Cheers,
Tags (2)
0 Kudos
12 Replies
SchoppMatthieu
New Contributor III
Thank you very much for your help Dasa 🙂

I finally extended the print service with Python, add a "String" parameter called whatEver.
When the client call the service and pas a whatEver parameter, python handle it using ListLayoutElements in the mxd :


Comments = arcpy.GetParameterAsText(3)
if Comments == '#' or not Comments:
    Comments = ' '


for whatEverString in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):
    if whatEverString.name == "WhatEver":
        whatEverString.text = Comments
0 Kudos
RaduMihai
New Contributor

What about customTextElements ?


I have the same question I read all the documentations I could get my hand on however I found nothing concrete about how to use this customtextElements,there are no samples,tuts..

I am wondering in which way can this customTextElements become useful for a Javascript developer

My problem started when the question was raised: "How can I include any other optional text on the printed version of the map ?"
0 Kudos
SchoppMatthieu
New Contributor III

Finally I had to come back on this one and I've got it working :

In client side (javascript) :

printTemplate.format = MapConfig.printService.format;

printTemplate.layout = PrWidget.mapTemplatesFilteringSelect.get('displayedValue');

printTemplate.preserveScale = false;

printTemplate.layoutOptions = {

    titleText:PrWidget.titleTextBox.get("value"),

        customTextElements:[

        {Entite:PrWidget.entiteTextBox.get("value")},

        {Rue:PrWidget.rueTextBox.get("value")},

        {CodePostal:PrWidget.codepostalTextBox.get("value")},

        {Ville:PrWidget.villeTextBox.get("value")},

        {Contact:PrWidget.contactTextBox.get("value")},

        {Mail:PrWidget.mailTextBox.get("value")},

        {Telephone:PrWidget.telephoneTextBox.get("value")},

        {Fax:PrWidget.faxTextBox.get("value")}

        ]

    };

It will automatically search for text elements in the mxd template base on textElement elementName that matches the keys (if I've got a textElement which elementName in "Entite" in my mxd, then it will update it with the value I defined).

This prevent to add "extraParameters" just for updating text in the template.

0 Kudos