czuroski
czuroski

Reputation: 4332

Chart area not showing in print preview

I have an application which uses an asp .net chartarea to create a chart on a report. The chart displays perfectly in the browser window when it is run. When I try to print preview it or print it outright, sometimes the chart is just showing as an x, seeming that it cannot locate the chart. For some users, it works fine, others it just shows the x. This is supported project, so I cannot really change anything. I have seen the strange behavior across multiple pcs, oses and versions of ie browsers.

does anyone have any thoughts as to how I could troubleshoot this? where do I look to troubleshoot print preview issues?

Upvotes: 2

Views: 3602

Answers (1)

Andrew M
Andrew M

Reputation: 9459

Try editing your web.config (in the appsettings section) adding the value deleteAfterServicing=false to the "ChartImageHandler" key, something like as follows :

<add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;deleteAfterServicing=false;" />

Found from this question and this page

The explanation is that apparently the chart image, which is dynamically generated, is deleted almost immediately after it is first served to the browser, and subsequent requests for that particular chart will fail. Some browsers are probably caching the image, others re-requesting it for the print preview, but failing to get it.

The web.config key above should persist these images, probably at the expense of some disk space and/or memory.

Upvotes: 3

Related Questions