Print sample solution from devsummit09

1047
11
01-14-2011 06:57 AM
GabiVoicu
Occasional Contributor
We are using the print sample solution for .net published in 09 at dev summit. Is this sample supposed to work with ArcGIS server 10 and api 2.1 as well?
Anyone else is still using this sample - what changes we should make to still be able to use the print solution .net with the new versions
http://www.arcgis.com/home/item.html?id=197fdc9367ec4a78aa15ce94ae7323ab


Thank you
0 Kudos
11 Replies
Kathleen_Crombez
Occasional Contributor III
I am also trying to impliment the .Net version of this. I have the layers blending to the output image, but the graphics are not yet working.

a few things to remember when setting up this application:

In the Web.config:

<appSettings>
    <add key="OutputPath" value="C:\\arcgisserver\\arcgisoutput\\" />
    <add key="OutputUrl" value="http://www.[your domain]/arcgisoutput/" />
  </appSettings>


Note: OutputPath should be changed to the actual physical location of the arcgisoutput folder if the default settings were not accepted.

replace [your domain] with your virtual location of arcgisoutput
example: value="http://www.maps.ccgisc.org/arcgisoutput/"

in IIS manager browse to Default Web Site (or whatever your application is called) make sure you have a virtual directory called arcgisoutput. If you do not have virtual directories set up, refer to the post install and configuration instructions.

in layout.aspx in the init() function:

//configure custom PrintableLayer
        esri.config.defaults.io.proxyUrl = "http://www.maps.ccgisc.org/proxy.ashx";
        var layer = new my.PrintableLayer("http://www.maps.ccgisc.org/MergeAndOutput.ashx", {
          layers:appState.map.layers,
          extent: new esri.geometry.Extent(appState.map.extent)
        });


remember to replace the link location with the virtual location of your own application.
remember to update the references to the javascript api and stylesheet to version 2.1
(the body of this file can also be modified to style your print page.)

in printing.js:

printingHiddenFrame.src = "../hiddenframe.html";

needs to match your relative location from the printing.js file.

good luck!
0 Kudos
GabiVoicu
Occasional Contributor
Have you been able to use the sample with ArcGIS 10? We did implement the sample and had it working with 9.3 but we would like to upgrade to 10 and discovered that print not working with 10?!

Thank you
0 Kudos
TomSchuller
Occasional Contributor III
Hy,
I wrote a PrintSOE with currently a FlexWidget as client.
The SOE is exposed as REST with json.

There would be easy to set it up in a JS client.

You can find it here:
http://www.arcgis.com/home/item.html?id=6809086326ea4c76bf026a32bb9dd698

Tom
0 Kudos
AaronDrake
New Contributor
This was working fine for us @ 9.3.1; however, upon upgrading to AGS 10 it will not print if we use our aerials layer.  I am getting a 500 internal server error when the aerials are printed.  All other layers (basemap, etc) print fine.

Here is the error output (via Firebug):
[NullReferenceException]: Object reference not set to an instance of an object.
   at MergeAndOutput.BlendNoSave(Graphics baseGraphics, Bitmap topimg, Double transparency) in d:\Inetpub\mPrint\printing\dotnet\MergeAndOutput.ashx:line 303
   at MergeAndOutput.Blend(Bitmap baseimg, Bitmap topimg, Double transparency, String output, Int32 width, Int32 height) in d:\Inetpub\mPrint\printing\dotnet\MergeAndOutput.ashx:line 250
   at MergeAndOutput.Blend(Dictionary`2 dict) in d:\Inetpub\mPrint\printing\dotnet\MergeAndOutput.ashx:line 208
   at MergeAndOutput.ProcessRequest(HttpContext context) in d:\Inetpub\mPrint\printing\dotnet\MergeAndOutput.ashx:line 28
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


Any ideas?
0 Kudos
nicogis
MVP Frequent Contributor
if you want interested I have posted this soe:
http://resources.arcgis.com/gallery/file/ArcObjects-.NET-API-Code-Gallery/details?entryID=C1D79B4A-1...

I have added a sample with api javascript esri
0 Kudos
GabiVoicu
Occasional Contributor
super fantastic...we have been waiting for this...we will try it...thank you thank you

THANK YOU DOMENICO
0 Kudos
JulianInskip
Occasional Contributor
Hi Domenico and Gabi.

I have managed to register the dll and get my service "Print ready". How do I get the sample viewer in the zip file to work (ie. select template)? Do I reference my service (http://server01/ArcGIS/rest/services/PrintREST/Printing2/MapServer/exts/Print/applications/0) or what URL is used?

If possible, could you also give me some pointers on how to use this in a Flex viewer?

Thank you very much.
Julian.

PS. This seems to be the solution we are looking to implement.
0 Kudos
nicogis
MVP Frequent Contributor
in service directory you can see your applications and templates (if you add new templates or applications restart service because list of templates/applications is built in costruct soe) :

your applications
http://localhost/<your instance ags>/rest/services/<yourservice>/MapServer/exts/Print?f=pjson

see all template of application (for example with id=0)
http://localhost/<your instance ags>/rest/services/<yourservice>/MapServer/exts/Print/applications/0?f=pjson

for print template with id=0 in the application with id=1
http://localhost/<your instance ags>/rest/services/<yourservice>/MapServer/exts/Print/applications/1/templates/0/printtemplate



I have added a sample in javascript . You can see this soe http://resources.arcgis.com/gallery/file/arcobjects-net-api/details?entryID=87BEC705-1422-2418-34B5-... that it has a sample for flex and so you can see how call a rest soe service with flex
0 Kudos
GabiVoicu
Occasional Contributor
Have you ever fixed those print issues?

...just curious - we never did

Thank you very much


This was working fine for us @ 9.3.1; however, upon upgrading to AGS 10 it will not print if we use our aerials layer.  I am getting a 500 internal server error when the aerials are printed.  All other layers (basemap, etc) print fine.

Here is the error output (via Firebug):
[NullReferenceException]: Object reference not set to an instance of an object.
   at MergeAndOutput.BlendNoSave(Graphics baseGraphics, Bitmap topimg, Double transparency) in d:\Inetpub\mPrint\printing\dotnet\MergeAndOutput.ashx:line 303
   at MergeAndOutput.Blend(Bitmap baseimg, Bitmap topimg, Double transparency, String output, Int32 width, Int32 height) in d:\Inetpub\mPrint\printing\dotnet\MergeAndOutput.ashx:line 250
   at MergeAndOutput.Blend(Dictionary`2 dict) in d:\Inetpub\mPrint\printing\dotnet\MergeAndOutput.ashx:line 208
   at MergeAndOutput.ProcessRequest(HttpContext context) in d:\Inetpub\mPrint\printing\dotnet\MergeAndOutput.ashx:line 28
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


Any ideas?
0 Kudos