Thank you for responding.My appologies. I was refering to the new Printing feature in ArcServer version 10.1.Here is what I came up with, in case anyone needs it.[HTML]private void ExportMap_Click(object sender, RoutedEventArgs e)
{
if (printTask == null || printTask.IsBusy) return;
// Define the LegendOptions. This will show specified Layers in the printed map's legend area.
LegendOptions myLegendOptions = new LegendOptions();
// Define a List<LegendLayer> objects to put in the LegendOptions.
List<LegendLayer> myLegendLayers = new List<LegendLayer>();
// Loop through all of the Layers in the Map Control.
foreach (var myLayer in MyMap.Layers)
{
// Create a new LegendLayer object to put in the List<LegendLayer> collection.
LegendLayer myLegendLayer = new LegendLayer();
// Set the LegendLayer.LayerId to the Layer.ID to add it to the printed map's legend area.
myLegendLayer.LayerId = myLayer.ID;
if (myLayer.ID == "Water Rights" || myLayer.ID == "OWRD Layers")
{
// Add a single LegendLayer into the List<LegendLayer> collection.
myLegendLayers.Add(myLegendLayer);
}
}
// Set the LegendOptions.LegendLayer to the new constructed List<LegendLayer> objects.
myLegendOptions.LegendLayers = myLegendLayers;
PrintParameters printParameters = new PrintParameters(MyMap)
{
LayoutOptions = new LayoutOptions() { Title=MapTitle.Text,
Copyright = "Map generated by Or Water Resources Department", LegendOptions = myLegendOptions},
ExportOptions = new ExportOptions() { Dpi = 96, OutputSize = new Size(MyMap.ActualWidth, MyMap.ActualHeight) },
LayoutTemplate = (string)LayoutTemplates.SelectedItem ?? string.Empty,
Format = (string)Formats.SelectedItem,
};
printTask.ExecuteAsync(printParameters);
}
[/HTML]