Toll Free: (877) 723-1442 U.S. and Canada
Support
ActiveX / COM
Visual C++ / MFC
Customer Spotlight
Corporate Partners
Contact Sales

Call center available M-F 9:00 - 6:00 US Eastern Time.

U.S. and Canada
(877) 723-1442

International
(517) 625-5729

Email

Printing a Report

Author: Mike Palmatier
Posted: May 3, 2006
Environment: Visual C++ 6.0

To print a report all you need to do is derive your current view from CXTPReportView. Then you can use the standard CView print methods to print the report.

class CReportSampleView : public CXTPReportView

The code below shows what your message map might look like for printing functions.

BEGIN_MESSAGE_MAP(CReportSampleView, CXTPReportView)

    // Standard printing commands

 

    ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)

    ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)

    ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)

END_MESSAGE_MAP()

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Other products and/or company names may be trademarks or registered trademarks of their respective owners.