customTextElements and esri/widgets/Print

257
5
05-16-2019 11:18 AM
ViktoriaMagnis
New Contributor II

Is it possible to use customTextElements with the  esri/widgets/Print ?

Thanks 

Vicki 

Tags (1)
0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Vicki,

   There are a number of thread on this. Here is the one I think you need to concentrate on.

https://community.esri.com/thread/184166-how-to-print-selected-attributes-on-parcels-in-wab-applicat...

0 Kudos
ViktoriaMagnis
New Contributor II

What I trying to do is use the esri/widgets/print in 4.10 with the a esri/tasks/support/PrintTemplate so I can use the layoutOption and CustomTextElements. 

new esri.widgets.print({
view: view,
templateOptions: {
title: "Buncombe County, NC",
author: "Buncombe County",
copyright: "Buncombe County",
legendEnabled: false,

layoutOptions:
{
customTextElements: [{
"info": "1234"
}
]
}
},
// specify your own print service
printServiceUrl: "https://--/arcgis/rest/services/ExportWebMap_VT/GPServer/Export%20Web%20Map"
}),

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Yes the 4.x API supports layoutOptions and customTextElements:

layoutOptions: {
titleText: "My Print",
authorText: "Sam",
copyrightText: "My Company",
scalebarUnit: "Miles",
// the following text elements must
// exist in your print service
customTextElements: [{
"description": "My description",
"location": "My Location"
}]
}
0 Kudos
ViktoriaMagnis
New Contributor II

I am using that code but it's still not working 

widgetPrint = new Expand({
content: new Print({
printTemplate: PrintTemplate,
view: view,
templateOptions: {
title: "Buncombe County, NC",
author: "Buncombe County",
copyright: "Buncombe County",
legendEnabled: false
},
layoutOptions: {
titleText: "My Print",
authorText: "Sam",
copyrightText: "My Company",
scalebarUnit: "Miles",
// the following text elements must
// exist in your print service
customTextElements: [{
"info": "My description"

}]
},
// specify your own print service
printServiceUrl: "https://--/arcgis/rest/services/ExportWebMap_VT/GPServer/Export%20Web%20Map"
}),
view: view,
expandTooltip: "print map",
group: "top-left"

});

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Vicki,

   Sorry to have misguided you on this. The print widget does not have a PrintTemplate so you can not set the PrintTemplate.layoutOptions. As far as I know, to use customTextElements then you have to use the PrintTask and PrintTemplate, not the PrintWidget. 

0 Kudos