Articles and Tutorials

Printing a Report

Author: Mike Palmatier
Platform: 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()

Articles and Tutorials