Select to view content in your preferred language

Print function and  incorrect json

827
5
Jump to solution
11-27-2012 01:01 PM
ChrisBradberry
Deactivated User
I am working with the 10.1 print task and I get some odd results.  The problem is that when I send maps to the server, the returned output would be a map that I had previously sent.  It is as if it cycles through all the previous maps -- I had to keep clicking the export map button until I got to the correct output.

I checked the json with fiddler, and it is for the current display on the screen.  But when the pdf shows up, it is a previous map.  Is there a way to clear out the old json before starting the new map?

Does anybody have any ideas? 

I am using Silverlight 4,  api 3.0, ArcGIS 10.1 and VS 2010

Thanks, Chris
0 Kudos
1 Solution

Accepted Solutions
KurtWille
Deactivated User
I found that this solution overcame the client cache problem:

private void printTask_PrintCompleted(object sender, PrintEventArgs e)
{
//open exported map in new browser window
Random random = new Random();
Uri u = new Uri(e.PrintResult.Url + "?Unused=" + random.Next().ToString());
System.Windows.Browser.HtmlPage.Window.Navigate(u, "_blank");
}

View solution in original post

0 Kudos
5 Replies
JohanCarlsson
Regular Contributor
0 Kudos
ChrisBradberry
Deactivated User
Johan,

Yes, I disabled the client caching.  I have found that it only seems to do this from my computer and not the clients, both in debugging and production versions.

Chris
0 Kudos
JohanCarlsson
Regular Contributor
Johan,

Yes, I disabled the client caching.  I have found that it only seems to do this from my computer and not the clients, both in debugging and production versions.

Chris


Do you get the same results if you try a local print, i.e. remove your url to the print task?
0 Kudos
ChrisBradberry
Deactivated User
Johan,

I tried it this morning and it worked as expected.  I need to put this aside for the time being.  Thanks for the help.
0 Kudos
KurtWille
Deactivated User
I found that this solution overcame the client cache problem:

private void printTask_PrintCompleted(object sender, PrintEventArgs e)
{
//open exported map in new browser window
Random random = new Random();
Uri u = new Uri(e.PrintResult.Url + "?Unused=" + random.Next().ToString());
System.Windows.Browser.HtmlPage.Window.Navigate(u, "_blank");
}
0 Kudos