Silverlight printing sample

7313
52
05-25-2011 11:22 AM
DanDong
New Contributor
Hi everyone,

I am using the silverlight printing sample from code gallery (http://www.arcgis.com/home/item.html?id=e361c2cc69784fcba34358d0458f66e3).

According to the ReadMe, I should add a reference to the MapPrintingControls.dll (located at
MapPrintingControls/Bin/Release) to my silverlight application.

But I cannot find MapPrintingControls.dll in that path and neither the whole download folder, thus I cannot add this reference. Does anyone has clue for this? or if you have the dll, could you please share it with me 🙂 Really appreciate.
0 Kudos
52 Replies
PaulHuppé
Occasional Contributor
Hi Dominique,
I got things working quite some time ago, but I have a different question now.  When I hit the print button, and printing with a legend, the legend shown in the preview does not match the legend in its current state of the application.  I was looking at your original solution, and it does the same thing in yours.  Looking at your code, you set a "Flat" legend mode and the legend always looks the same no matter what you do to in the application legend.  Is there a way to reflect you you do in the application legend in the print preview legend? That is, if a service is open or closed in the legend it would be open or closed also in the print preview.
Thanks,
Paul
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Not sure what you mean by
the legend shown in the preview does not match the legend in its current state of the application.


If you mean that the look of the legend control is not the same in the main view than in the printed page : that's normal. There are 2 legend controls one in the main page and another one in the page style. These 2 controls can have different properties : LayerItemsMode (Flat or Tree), Color, Templates, ......

If you mean that the layers visibilities can be different in the application and in the preview. It's because a snapshot of the visible layers is done when you open the print dialog. Then, changing a layer visibility in the main window doesn't impact the preview window (as it's developed for the moment).

BTW : I noticed than the service used by the sample with the 'Tour de France 2010' is no more working. This sample would need an update (as soon as I find a service with the Tour de France 2012 🙂 ...)
0 Kudos
PaulHuppé
Occasional Contributor
Yes, I realized that after you open the print preview, if you play with the legend it will not be reflected in the preview, which is fine. But as soon as you open the print preview, the legend in it does not match want you see currently in the application.  Is there a way to at least show the legend as you see it before pressing the print preview button?
0 Kudos
DominiqueBroux
Esri Frequent Contributor
But as soon as you open the print preview, the legend in it does not match want you see currently in the application. Is there a way to at least show the legend as you see it before pressing the print preview button?

Should already be the case.

For example, if you turn off the 2 layers of the lived application and, then open the print dialog, there is no layer in the print preview legend.
Are you talking about this case?
0 Kudos
PaulHuppé
Occasional Contributor
Yes, that is what I am talking about. Maybe I need to download your solution again, because the one I have does not seem to do that. Is the latest version still in the code gallery?  Or maybe I should download from your site if you have a URL for it?
0 Kudos
PaulHuppé
Occasional Contributor
Ok, after trying again, I got your solution to behave like you said.  So, it must be something we did when we ported it in our MVVM model.
0 Kudos
PaulHuppé
Occasional Contributor
Salut Dominique,

Have you ever rewritten your printing sample using the JavaScript API?  We are moving away from Silverlight into JavaScript and would like to reuse this widget.

Thanks,
Paul
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Hi Paul,

Sorry I didn't port my print sample to the Javascript API.
The sample is very related to the .net API and not easy to port to Javascript as it is.

Bonne chance.
0 Kudos
samulineuvonen
New Contributor

Dear Dominique,

I'm using this sample in my application and otherwise it works very nicely but there is some problem with layers using PictureMarkerSymbols. They don't show on the cloned map and the symbols are also not drawn on the printable legend. Is this a bug or just something wrong with my setup? Have you ever tested with PictureMarkerSymbols? I'm using the latest version of the arcgis-samples-silverlight (from Esri/arcgis-samples-silverlight · GitHub ).

By the way, I noticed the same for ArcGISDynamicMapServiceLayers constructed with DynamicLayerInfos, but this is maybe not so suprising...

Thanks,

Samuli

0 Kudos
samulineuvonen
New Contributor

After some testing it seems the problem is somewhere else in my application. I added the same FeatureLayers to the original sample and there was no problem. Now I just have to figure out what could cause this difference. Any ideas would be welcome...

Regards,

Samuli

0 Kudos