Select to view content in your preferred language

Printing in SL 2.0 comparsion

6545
59
10-04-2010 05:27 AM
LakshmananVenkatesan
Frequent Contributor
Dear All:

We have developed Print functionality in Web application using ESRI SL 1.2, ArcGIS 9.3.1. Client application willl send all visible layers, graphics (poly,line and point) as string , text symbols as string to server side and recreate a map document and construct geometry from string and generate a image and display in web page.

If we have say 100 lines as graphics, string which we generate is very big and unable to process( or send via http). Server side is done using GP Tool. Question is we have planned to move to ArcGIS 10 and SL 2.0.

What are all advantages in print functionality using ArcGIS 10 and SL 2.0  (MS SL 4.0) or rather how easy to print the map with graphics and other options ?

Please throw light on this
0 Kudos
59 Replies
DominiqueBroux
Esri Frequent Contributor
Don't forget to set the startup project to the web project.
0 Kudos
PhilDegler
Emerging Contributor
I must be doing something seriously wrong.  When I set the solution startup as MapPrinting.web, I get a directory listing when I build and run the solution.

I downloaded version 2.1 of the silverlight API as I had been using version 2.

Phil
0 Kudos
DominiqueBroux
Esri Frequent Contributor
When I set the solution startup as MapPrinting.web, I get a directory listing when I build and run the solution.

You have to set the start page of the web project to mapprinting.html or mainpage.aspx as well.
0 Kudos
NathalieNeagle
Regular Contributor
Dominique,

I worked through some problems and I think I'm close to getting your tool working with my app, which was based off the frosted tab template.

The problem I'm currently having is if I don't add this ref: xmlns:userControls="clr-namespace:MapPrinting.UserControls"

The code won't compile and states

The type 'controls:MapPrinterIndicator' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

The type 'controls:MapPrinterDialog' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

The type 'controls:MapPrinter' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

The property 'IsOpen' was not found in type 'WindowPanel'.


If I do add that ref the errors goes away but I get an error stating that ref
( xmlns:userControls="clr-namespace:MapPrinting.UserControls" )
is a duplication of this ref
( xmlns:userControls="clr-namespace:ESRI.ArcGIS.SilverlightMapApp")

which doesn't make sense to me and I'm not sure what I'm doing wrong. 

In your readme.txt file you stated I only have to add this referrence:

xmlns:printing="clr-namespace:ESRI.ArcGIS.Client.Samples.MapPrinting;assembly=MapPrintingControls"

But that doesn't seem like it is enough???
0 Kudos
DominiqueBroux
Esri Frequent Contributor
MapPrinterIndicator, MapPrinter and MapPrinterDialog are controls defined MapPrintingControls dll.
So this first problem should be solved as soon as you add a reference to the MapPrintingControls (nevertheless note that if you defined xmlns:printing=...... you should use printing:MapPrinter/MapPrinterDialog/MapPrinterIndicator and not controls:MapPrinter/....).

Concerning the WindowPanel, it's only a container for the MapPrinterDialog, so you can use any panel you want (or you can even use no panel).
In the sample application, I was using the WindowPanel defined in the namespace MapPrinting.UserControls, but this is not mandatory. This allows to move the preview but you can use any panel already defined in your map application (or even no panel as suggested in the readme : just drag and drop the MapPrinterDialog to the mainpage)
0 Kudos
NathalieNeagle
Regular Contributor
Dominique,

Thanks for the super quick reply.  So I was using the control and not the printing...once I change
xmlns:printing="clr-namespace:ESRI.ArcGIS.Client.Samples.MapPrinting;a ssembly=MapPrintingControls"

to

xmlns:control="clr-namespace:ESRI.ArcGIS.Client.Samples.MapPrinting;a ssembly=MapPrintingControls"

I was also trying to use your code from your sample to build my MapPrinterDialog and MapPrinter controls.  So I drop that and just went with this:


 <controls:MapPrinterDialog Height="410" Width="340">

                            <controls:MapPrinter x:Name="mapPrinter" Map="{Binding ElementName=Map}"/>

                            </controls:MapPrinterDialog>



The code compiles I see the Silverlight icon count from 1 to 100 and then nothing.  If I comment out this code everything is good. 

Any more suggestions?

Thanks


I just noticed when I drag the MapPrinterDialog and MapPrinter controls (in VS 2010) before I build it does underline the controls and when I hover it states:

Error HRESULT E_FAIL has been returned from a call to a com component
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Sorry I have no clue.

Check that there is no mismatch in the dlls you referenced (MapPrintingControls and your app should reference the same ArcGIS client dlls).

If you just compile the sample solution (MapPrinting + MapPrintingControls), is it working?
0 Kudos
NathalieNeagle
Regular Contributor
Dominique,

Yes I'm compiling the sample solution (the one located in the silverlight folder).  I'm building the
MapPrintingControls project that you build and I downloaded then I'm moving the dll from the MapPrintingControls/Bin/Release directory to my project and then adding a ref in VS.  At this point I can compile my code and everything is good.  I'm then adding the printing tools to the VS toolbox windw and then dragging the tools to my xaml page and filling the rest of the details to get:

<printing:MapPrinterDialog Height="410" Width="340">
                <printing:MapPrinter x:Name="mapPrinter" Map="{Binding ElementName=Map}"/>
         
            </printing:MapPrinterDialog>


I also failed to mention when I run the app in debugging mode it hangs Mainpage.gi.cs file

System.Windows.Application.LoadComponent(this, new System.Uri("/TabbedRibbon;component/MainPage.xaml", System.UriKind.Relative));


The message states:
The type 'BusyIndicator' was not found because 'clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit' is an unknown namespace. [Line: 7 Position: 30]

This only happens after I add the code:

<userControls:CollapsiblePanel x:Name="PrintWindow"  IsExpanded="True" >

            <printing:MapPrinterDialog Height="410" Width="340">
                <printing:MapPrinter x:Name="mapPrinter" Map="{Binding ElementName=Map}"/>
          
            </printing:MapPrinterDialog>
        </userControls:CollapsiblePanel>


If I comment out this code the application runs fine.

Nathalie
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Looks like you forgot to add a reference to System.Windows.Controls.Toolkit .

Remember the readme 🙂 :
2c. Add a reference to the System.Windows.Controls.Toolkit to your silverlight
application (!! Don't forget this step. !!)
0 Kudos
NathalieNeagle
Regular Contributor
Thank You!  I owe you a beer or something; maybe I will see you at the dev. conference.  I think I owe the entire silverlight team so the first round is on me.
0 Kudos