Solved

Is there a better VS Windows Forms Print Preview Control

Posted on 2011-03-04
4
341 Views
Last Modified: 2012-06-27
We have an application developed in C++.NET 2003.

All of its reports generate to the standard windows forms PrintPreview control.

Our customers are always asking if they can export these to PDF or Excel and we keep having to say no because there are over 100 reports and we don't have the time to build the functionality everywhere.

Is there a different, custom, control out there that works largely in the same way as the standard print preview control but can export the data?
0
Comment
Question by:batbertram
  • 2
4 Comments
 
LVL 12

Assisted Solution

by:Hairbrush
Hairbrush earned 333 total points
ID: 35035405
Hi there

Have you thought about providing your client with a printer driver that prints to PDF?  There are many such drivers available.  I've used http://www.verypdf.com/pdfcamp/pdfcamp.htm but googling for "PDF printer driver" will reveal many alternatives, including probably better ones than VeryPDF.

Is the existing preview control that you're using this one? System.Windows.Forms.PrintPreviewControl
or this one? System.Windows.Forms.PrintPreviewDialog
0
 

Author Comment

by:batbertram
ID: 35035470
We do that in some places as a workaround to solve the PDF problem but it doesn't help us with Excel or CSV.

We are using the PrintPreviewDIalog if that helps.

We'd even consider upgrading our project to VS 2010 if there was a solution available.
0
 
LVL 10

Accepted Solution

by:
John Claes earned 167 total points
ID: 35035703
Hey,

PDF
I'm using cute Pdf.  (http://www.cutepdf.com/)
this is a Pdf printer, everything you print upon it will become a Nice PDF- and you can choose where to save.

Excel
That is something that isn't that simple.
You have to retreive the Query that was executed and then export the RecordSet as a Csv.

regards

poor beggag
0
 
LVL 12

Assisted Solution

by:Hairbrush
Hairbrush earned 333 total points
ID: 35036027
Hmm I am struggling to think of an easy way to achieve the "Export to Excel" functionality.  If you could stomach converting your 100 reports into RDL format then you could use Microsoft's excellent report viewer (http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a941c6b2-64dd-4d03-9ca7-4017a0d164fd&displaylang=en) amply described here:  http://www.gotreportviewer.com/
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
object oriented programming comparison 5 55
how to read json value 2 31
Error on link 14 38
Variable Event ? 3 23
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now