Solved! Go to Solution.
private function initLayoutTemplates(serviceInfo:PrintServiceInfo):void
{
var layoutTemplatesVisibility:Boolean = true;
layoutTemplatesFI.label = configXML.labels.layouttemplateslabel[0] || hostBaseWidget.getDefaultString("printLayoutTemplatesLabel");
var layoutTemplates:IList = serviceInfo.layoutTemplates;
//Go through the layouttemplates and remove the ones listed as removetemplate
var removelist:Array = [];
for each (var removeXML:XML in configXML.layouttemplates.removetemplate){
removelist.push(removeXML.toString());
}
if (removelist.length > 0){
var ltLen:int = layoutTemplates.length;
var layoutTemplate:String;
for (var rt:int = ltLen - 1; rt >= 0; rt--){
layoutTemplate = layoutTemplates.getItemAt(rt) as String;
if (removelist.indexOf(layoutTemplate) > -1){
layoutTemplates.removeItemAt(rt);
}
}
}
if (configXML.layouttemplates[0])
{
printParameters.layoutTemplate = configXML.layouttemplates.@defaultvalue[0] || configXML.layouttemplates[0];
layoutTemplatesVisibility = configXML.layouttemplates[0].@visible[0] != "false";
}
shouldShowTemplateOptions = layoutTemplatesVisibility && (layoutTemplates && layoutTemplates.length > 1);
var shouldUseServiceInfoDefault:Boolean = (!printParameters.layoutTemplate && serviceInfo.defaultLayoutTemplate);
if (shouldUseServiceInfoDefault)
{
layoutTemplatesDDL.selectedItem = serviceInfo.defaultLayoutTemplate;
}
}
<configuration>
<!-- change this URL to your own Export Web Map Task (requires ArcGIS Server 10.1), or just remove the taskurl tag to get quick printing -->
<taskurl>http://servicesbeta2.esri.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task</taskurl>
<layouttemplates>
<removetemplate>MAP_ONLY</removetemplate>
</layouttemplates>
</configuration>