Solved

Is there a better VS Windows Forms Print Preview Control

Posted on 2011-03-04
4
340 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

762 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

18 Experts available now in Live!

Get 1:1 Help Now