Select to view content in your preferred language

Flex 3.1/3.2 advanced printing - layer names are not present in exported map legend

2640
6
04-27-2013 05:43 PM
ScottMcGee
Regular Contributor
Is anyone using the advanced printing capabilities of Flex 3.1/3.2 to export a web map to a JPG, PDF, or other file format, using a custom map template MXD?

I'm doing this and everything works well, except that the legend items in the exported map do not have the layer names, which essentially makes the entire legend worthless. All I get in the exported map legend is the symbol patches and the associated attribute value. But I also need the name of the data layer from which the symbol patches and attributes are derived.

I have seen nothing in the Flex Help that addresses this issue.

Any ideas?
Tags (2)
0 Kudos
6 Replies
ScottMcGee
Regular Contributor
Well, it's been about a month since I posted the message above, and there have been no responses yet. I'm still trying to figure this out. So far, it doesn't seem possible to get the layer names in the legend of the exported PDF map. Without the layer names in the legend, the exported maps make no sense. Which pretty much makes the Print widget worthless.

If anyone from ESRI is reading this, have you heard of this issue before? Is it a bug? Or am I just not doing something correctly?

P.S. I'm now using Flex 3.3.
0 Kudos
TylerSchrag
Deactivated User
We are having the same issue, but with a javascript app. My feeling is that this has to do with the print service as well, and not necessarily the environment, though. I was originally thinking that messing with the legend settings in the template mxd might fix the problem... but no luck there.
0 Kudos
ScottMcGee
Regular Contributor
We are having the same issue, but with a javascript app. My feeling is that this has to do with the print service as well, and not necessarily the environment, though. I was originally thinking that messing with the legend settings in the template mxd might fix the problem... but no luck there.



Tyler,

Yeah, I've also spent many hours experimenting with the layers and legend settings in my template MXDs, and nothing I've done in the MXDs has resulted in having the layer names in the legend of the exported PDF.

I came up with a rather inelegant workaround to the problem by simply adding the layer name to the description of each legend item. This works, but results in a lot of redundant wording in the legend (see attached file Legend-Original.png).

I then did a mock-up in Photoshop to illustrate the way that I want the legend to appear (see attached file Legend-Fixed.png).

It looks like it's not possible with any version of Flex to get the layer names in the legend. I guess we'll have to wait until ESRI has a chance to fix this.

[ATTACH=CONFIG]24654[/ATTACH]  [ATTACH=CONFIG]24655[/ATTACH]
0 Kudos
TanuHoque
Esri Regular Contributor
I'd use create an arcpy script, publish that as my custom printing service and use that with my PrintTask in my web app.
These are what arcpy script would do:

  • calll ConverWebMapToMapDocument() with your layout template to create a mapdocument object

  • use LegendElement and apply legend style of your choice

  • export to pdf or any other format


here are some help links help you with the script.
http://resources.arcgis.com/en/help/main/10.1/#/Advanced_printing_for_web_maps/01540000056t000000/
http://resources.arcgis.com/en/help/main/10.1/#/Tutorial_Basic_high_quality_web_map_printing_exporti...
http://resources.arcgis.com/en/help/main/10.1/#/ConvertWebMapToMapDocument/00s30000006n000000/
http://resources.arcgis.com/en/help/main/10.1/#/LegendElement/00s300000041000000/
http://resources.arcgis.com/en/help/main/10.1/#/ExportToPDF/00s300000027000000/

hope this helps.
0 Kudos
AimeiChen
Frequent Contributor
I also spent some time on reset the legend in my template MXD but nothing works. With the link you provided here, I copied some python scripts and tried to run, but failed. If you happen to have the python code to share with us that'd be great!

Thanks,

Amy


I'd use create an arcpy script, publish that as my custom printing service and use that with my PrintTask in my web app.
These are what arcpy script would do:

  • calll ConverWebMapToMapDocument() with your layout template to create a mapdocument object

  • use LegendElement and apply legend style of your choice

  • export to pdf or any other format


here are some help links help you with the script.
http://resources.arcgis.com/en/help/main/10.1/#/Advanced_printing_for_web_maps/01540000056t000000/
http://resources.arcgis.com/en/help/main/10.1/#/Tutorial_Basic_high_quality_web_map_printing_exporti...
http://resources.arcgis.com/en/help/main/10.1/#/ConvertWebMapToMapDocument/00s30000006n000000/
http://resources.arcgis.com/en/help/main/10.1/#/LegendElement/00s300000041000000/
http://resources.arcgis.com/en/help/main/10.1/#/ExportToPDF/00s300000027000000/

hope this helps.
0 Kudos
JoeHewitt
Regular Contributor


If you happen to have the python code to share with us that'd be great!



This would be great indeed.
0 Kudos