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.
What about customTextElements ?
You can also create the object like this:<fx:Object myCustomTextElement="{customcontent}"/>
[Bindable] private var customcontent:String ='This is line one.\nThis is line two.'; [Bindable] private var customTextElems:Object; private function init():void{ customTextElems = new Object; customTextElems.myCustomTextElement = customcontent; this.printParameters.layoutOptions.customTextElements = customTextElems; printTask.getServiceInfo(); } <esri:PrintParameters id="printParameters" format="PDF" layoutTemplate="MyCustomTemplate" <esri:layoutOptions> <esri:LayoutOptions author="Author: ArcGIS for Flex Team" copyright="Copyright: © ArcGIS for Server" title="My Map"> </esri:LayoutOptions> </esri:layoutOptions> </esri:PrintParameters>
<esri:PrintParameters id="printParameters" format="PDF" layoutTemplate="MyCustomTemplate" map="{map}" > <esri:layoutOptions>[INDENT]<esri:LayoutOptions author="Author: ArcGIS for Flex Team" [/INDENT] [INDENT] copyright="Copyright: © ArcGIS for Server" [/INDENT] [INDENT] title="My Map"> [/INDENT] [INDENT=2]<esri:customTextElements> [/INDENT] [INDENT=3]<fx:Object> [/INDENT] [INDENT=4]<fx:myCustomTextElement> [/INDENT] [INDENT=5]<fx:String id="actualText">{customcontent}</fx:String> (error raised �??Data binding expression not allowed here�?�) [/INDENT] [INDENT=4]</fx:myCustomTextElement> [/INDENT] [INDENT=3]</fx:Object> [/INDENT] [INDENT=2]</esri:customTextElements> [/INDENT] [INDENT]</esri:LayoutOptions> [/INDENT] </esri:layoutOptions> </esri:PrintParameters>
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.