patrickbrooke ANY help on how to integrate that into a Silverlight app that is using VB. This forum entry has confused me even more as I am seeign a few different ways to do it...I love the option to choose a map title etc...
Can you help by informing how to incorporate into silverlight?
Thanks
I was working with Patrick when we implemented this solution, and now that he's big timed us and moved on I'm the one doing all this in our shop.The way we found to utilize this geoprocessing service was to create the list of parameters in our code behind and then populate them with the appropriate values. It works really good, but we haven't figured out how to format the JSON string that the "visible layers" parameter is expecting, so currently we can only control the visible layers on the template side. Our C# code to populate the parameters looks like this:List<GPParameter> jobParameters = new List<GPParameter>();
jobParameters.Add(new GPDouble("xMin", boundingExtent.XMin));
jobParameters.Add(new GPDouble("yMin", boundingExtent.YMin));
jobParameters.Add(new GPDouble("xMax", boundingExtent.XMax));
jobParameters.Add(new GPDouble("yMax", boundingExtent.YMax));
jobParameters.Add(new GPString("Spatial_Reference", MyMap.SpatialReference.WKID.ToString()));
jobParameters.Add(new GPDouble("Map_Scale", Mapscale));
jobParameters.Add(new GPString("Visiblelayers", "None"));
jobParameters.Add(new GPString("Layout", theTemplate));
jobParameters.Add(new GPBoolean("Include_Attributes", false));
jobParameters.Add(new GPString("Map_Title", pdfTitle));
jobParameters.Add(new GPString("PointGraphics", ""));
jobParameters.Add(new GPString("PolyGraphics", ""));
(We have a separate "if" statement in the code for LineGraphics, because one of our templates utilizes them based on a selection, but it's done the same way.)Then we submit the job to the GP service with the following code:Geoprocessor ExportTask = new Geoprocessor("http://......../rest/services/ExportPDF_GP/GPServer/ExportToPDF");
ExportTask.JobCompleted += new EventHandler<JobInfoEventArgs>(ExportTask_JobCompleted);
ExportTask.Failed += new EventHandler<TaskFailedEventArgs>(ExportTask_Failed);
ExportTask.SubmitJobAsync(jobParameters);
The event handlers control some busy indicators and the failed throws an error message, but the completed sets the URL of the PDF that's created, which can then be accessed and opened with an on-click event. I know there are tons of gaps in this explanation, but this tool works really great for us and we're excited about how well our users are utilizing it. If you have any questions about how we create any of the variables the parameters are using I'll be happy to answer them.