Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to print and export a WinForms Dashboard visual representation as is

$
0
0

The following example demonstrates a workaround that allows you to print and export a Dashboard visual representation as is via the Print Preview dialog.

In this example, the Customer Support dashboard is displayed. You can invoke the Print Preview for the dashboard in one of the two modes, using the Show Preview or Show Paged Preview button. In the first mode, the paper size is adjusted to fit the dashboard. In the second mode, the dashboard gets split across the appropriate number of standard A4 pages.

To accomplish this, we have created a DashboardExporter class that implements the DevExpress.XtraPrinting.IPrintable interface. DashboardExporter instances are mapped to a DashboardViewer when they are created and then passed to the Print Preview thus bringing the dashboard to paper.

Question Comments

Added By: S Broskie at: 2/12/2013 6:40:51 AM    

I appreciate the sample. I did have one question related to the size. If I squeeze the form down, which reduces the dashboard size and then do a print preview, the sides get chopped off. What would be the best way to keep the preview and export at a consistent size without having to worry about a user shrinking the form and therefore shrinking the output? Clone the dashboard somehow and actually do the export on that internally sized clone? If so, could you augment the sample to try and export a consistent size no matter what shape the form and dashboard are in?

Thanks!

Added By: DevInfox at: 3/12/2013 8:34:23 PM    

I used this code in a new dashboard viewer, how do I tell the button to print the dashboard and what about if I have multiple dashboard

Added By: saif Mohammed at: 9/18/2013 7:14:58 AM    

Hi, does this code consider the filtered dashboards or it prints it in its original status only?

Added By: Maxim (DevExpress Support) at: 6/9/2014 8:23:26 AM    Please accept my sincere apologies for this the tardiness of my reply. Although it's been a while since you posted these comments, I want to make sure your concerns are addressed. If you opened separate tickets on these issues, please let me know, so that I can follow up on all the tickets.  If you didn't, I will answer you here right away.Added By: swapna.makthal@jpmorgan.com swapna.makthal@jpmorgan.com at: 11/6/2018 10:06:08 AM    I see vertical and horizontal scroll bars in print preview page even though my dashboard viewer doesn't have them. Can you please let me know how to solve this issue?

Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>