Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Is there a better VS Windows Forms Print Preview Control

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

856 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