Select to view content in your preferred language

PrintWidget Format & Layout_Teplates dropdownlist

2351
7
Jump to solution
02-11-2013 06:59 AM
MayJeff
Deactivated User
Can you only have two choices for Formats on the dropdown list instead of 8 choices?  Samething for Layout templates as well.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
GISDev1
Deactivated User
Nice video, too bad he leaves out the important part. 

While creating his service, he points out how/where you can select the formats available. However, he skips over and fails to mention this part from the help documentation: 



So, it doesn't matter how many of the formats, templates, etc. you un-check creating the service, you will still get them all. 

The only way I have found to get around this is to only allow one option (Constant value), or not give them the option in the config. 

For the templates, you can, as long as you only have the two "desired" templates in the template folder. 

R_



I looked into this, because I did it a while back and had forgotten how I got around that bug in the API V3.1

Try this out in your ExportWebMapForm.mxml

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

View solution in original post

0 Kudos
7 Replies
GISDev1
Deactivated User
Yes, you can make as many choices as you'd like in both the Formats and the Layouts.

Check out this Esri video:
http://video.esri.com/watch/1058/arcgis-for-server-10.1-printingtools-service-tutorial
0 Kudos
RhettZufelt
MVP Notable Contributor
Nice video, too bad he leaves out the important part.

While creating his service, he points out how/where you can select the formats available.  However, he skips over and fails to mention this part from the help documentation:

Due to a known limitation with the Export Web Map tool in 10.1, you cannot filter the parameter choices available to end users.

You can hide a parameter completely from end users and force them to use the default by setting the parameter's Input mode to Constant value.



So, it doesn't matter how many of the formats, templates, etc. you un-check creating the service, you will still get them all.

The only way I have found to get around this is to only allow one option (Constant value), or not give them the option in the config.

For the templates, you can, as long as you only have the two "desired" templates in the template folder.

R_
0 Kudos
MayJeff
Deactivated User
Good to know that.  No wonder my own GP always got all the formats eventhough I just select two of the formats from the list.  Do you know is there possible to change the code to only show 2 choices for Layout template when using ESRI GP service on ExportWebMapForm.mxml?
0 Kudos
GISDev1
Deactivated User
Do you know is there possible to change the code to only show 2 choices for Layout template when using ESRI GP service on ExportWebMapForm.mxml?



The DropDownList is getting populated by whatever mxd's are located in the TemplateFolder Location which is designated in your GeoProcessing Tool which you publish on your ArcGIS Server 10.1 Instance.

Using Esri's Sample Print GP service is not ideal, as you can't customize anything.
0 Kudos
GISDev1
Deactivated User
Nice video, too bad he leaves out the important part. 

While creating his service, he points out how/where you can select the formats available. However, he skips over and fails to mention this part from the help documentation: 



So, it doesn't matter how many of the formats, templates, etc. you un-check creating the service, you will still get them all. 

The only way I have found to get around this is to only allow one option (Constant value), or not give them the option in the config. 

For the templates, you can, as long as you only have the two "desired" templates in the template folder. 

R_



I looked into this, because I did it a while back and had forgotten how I got around that bug in the API V3.1

Try this out in your ExportWebMapForm.mxml

    <mx:FormItem id="formatsFI"                  width="100%"                  includeInLayout="{shouldShowFormatOptions}"                  visible="{shouldShowFormatOptions}">   <!--         <s:DropDownList id="formatsDDL"                         width="100"                         dataProvider="{printTask.getServiceInfoLastResult.formats}"                         requireSelection="true"/>   -->   <s:DropDownList id="formatsDDL"       width="100"       requireSelection="true">    <mx:ArrayCollection>     <fx:String>PDF</fx:String>     <fx:String>JPG</fx:String>     <fx:String>PNG</fx:String>    </mx:ArrayCollection>   </s:DropDownList>        </mx:FormItem>
0 Kudos
MayJeff
Deactivated User
Thank you very much.  It works well!
0 Kudos
TerryHiggins
Deactivated User
I looked into this, because I did it a while back and had forgotten how I got around that bug in the API V3.1 

Try this out in your ExportWebMapForm.mxml 

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


This is the answer I have been looking for - however I am new at this and don't have the mxml you are referring to?
I'm using ArcGIS Viewer for Flex, 10.2 server - where would I find this file to add your suggestions to?
Thanks
Terry
0 Kudos