Select to view content in your preferred language

Help with coding the Print Widget config xml file

2539
4
Jump to solution
04-24-2013 06:34 AM
AlisonPage
Regular Contributor
I'm trying to figure out the proper way to include/exclude formats in the Print Widget config but the explanation in the tag reference is not very good. What I want to do is remove "pdf" from the list of formats but include the other ones. Below is the current config but it's not working:

<?xml version="1.0" ?> <configuration>     <!-- change this URL to your own Export Web Map Task (requires ArcGIS 10.1), or just remove the taskurl tag to get quick printing -->     <taskurl>http://sampleserver6.arcgisonline.com/ArcGIS/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task</taskurl>     <layouttemplates visible="true">         <layouttemplate>MAP_ONLY</layouttemplate>         <layouttemplate>Tabloid ANSI B Landscape</layouttemplate>         <layouttemplate>Tabloid ANSI B Portrait</layouttemplate>     </layouttemplates>   <formats visible="true">png32,png8,jpg,gif,eps,svg,svgz</formats> </configuration>  <!--     See Print widget tag reference at     http://links.esri.com/printwidget -->


Thank you,
Alison
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RhettZufelt
MVP Notable Contributor
Allison,

Are your services public and visible to the world?  If not, you will not be able to use the ESRI print task server as it needs to be able to download your layers, etc. to generate the map.

I was stuck with the basic print (comment out the task URL) task until I installed 10.1.  Currently, the only thing my 10.1 is doing is serving this print task..

R_

View solution in original post

0 Kudos
4 Replies
RhettZufelt
MVP Notable Contributor
Due to a "known limitation" in the server, this is not possible without modifying the source code.

This has been covered here:  http://forums.arcgis.com/threads/77407-PrintWidget-Format-amp-Layout_Teplates-dropdownlist?p=274746#...

R_
0 Kudos
AlisonPage
Regular Contributor
I've modified the ExportWebMapForm.mxml as specified in the forum thread you linked me to.. I don't have ArcGIS 10.1, only ArcGIS 10. I've done the following and am receiving the error below:

In ExportWebMapForm.mxml:
<mx:FormItem id="layoutTemplatesFI"
                 width="100%"
                 includeInLayout="{shouldShowTemplateOptions}"
                 visible="{shouldShowTemplateOptions}">
  <!--
        <s:DropDownList id="layoutTemplatesDDL"
                        dataProvider="{printTask.getServiceInfoLastResult.layoutTemplates}"
                        requireSelection="true"/>
  -->
  <s:DropDownList id="layoutTemplatesDDL"
      width="100"
      requireSelection="true">
   <mx:ArrayCollection>
    <fx:String>MAP_ONLY</fx:String>
    <fx:String>Tabloid ANSI B Landscape</fx:String>
    <fx:String>Tabloid ANSI B Portrait</fx:String>
   </mx:ArrayCollection>
  </s:DropDownList>
    </mx:FormItem>

    <mx:FormItem id="formatsFI"
                 width="100%"
                 includeInLayout="{shouldShowFormatOptions}"
                 visible="{shouldShowFormatOptions}">
        <!--
  <s:DropDownList id="formatsDDL"
                        dataProvider="{printTask.getServiceInfoLastResult.formats}"
                        requireSelection="true"/>
  -->
  <s:DropDownList id="formatsDDL"
      width="100"
      requireSelection="true">
   <mx:ArrayCollection>
    <fx:String>PNG32</fx:String>
    <fx:String>PNG8</fx:String>
    <fx:String>JPG</fx:String>
    <fx:String>GIF</fx:String>
    <fx:String>EPS</fx:String>
    <fx:String>SVG</fx:String>
    <fx:String>SVGZ</fx:String>
   </mx:ArrayCollection>
  </s:DropDownList>
    </mx:FormItem>


In PrintWidget.xml (I set it back to the original w/ just the url - which I didn't want to change b/c I don't have v10.1):

<?xml version="1.0" ?>
<configuration>
    <!-- change this URL to your own Export Web Map Task (requires ArcGIS 10.1), or just remove the taskurl tag to get quick printing -->
    <taskurl>http://sampleserver6.arcgisonline.com/ArcGIS/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task</taskurl>
</configuration>


Error that I'm receiving when I try to use the Print Widget from my map:
Error executing print task:

[RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032"]. URL: http://sampleserver6.arcgisonline.com/ArcGIS/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task/execute"]


Thanks,
Alison
0 Kudos
RhettZufelt
MVP Notable Contributor
Allison,

Are your services public and visible to the world?  If not, you will not be able to use the ESRI print task server as it needs to be able to download your layers, etc. to generate the map.

I was stuck with the basic print (comment out the task URL) task until I installed 10.1.  Currently, the only thing my 10.1 is doing is serving this print task..

R_
0 Kudos
AlisonPage
Regular Contributor
I was testing from my Development server which is why it wasn't working. I didn't realize the map services needed to be live to the world for the print function to work, my dev services are behind our firewall. I've used my live service URLs and it's working fine now.

Thanks for the help,
Alison
0 Kudos