Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - CXTPReportControl PrintPreview
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPReportControl PrintPreview

 Post Reply Post Reply
Author
Message
vjedlicka View Drop Down
Senior Member
Senior Member


Joined: 04 September 2007
Status: Offline
Points: 122
Post Options Post Options   Thanks (0) Thanks(0)   Quote vjedlicka Quote  Post ReplyReply Direct Link To This Post Topic: CXTPReportControl PrintPreview
    Posted: 01 December 2013 at 1:16pm
How do I switch CXTPReportControl to print-preview mode?
Thank you
Vaclav
---------------------
ToolkitPro 20.1.0
VS2010-2022, Windows 11
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 02 December 2013 at 9:02am
GetReportCtrl().EnablePreviewMode(!GetReportCtrl().IsPreviewMode());
GetReportCtrl().Populate();
Back to Top
vjedlicka View Drop Down
Senior Member
Senior Member


Joined: 04 September 2007
Status: Offline
Points: 122
Post Options Post Options   Thanks (0) Thanks(0)   Quote vjedlicka Quote  Post ReplyReply Direct Link To This Post Posted: 02 December 2013 at 3:21pm
Is that all I need to do to display a print preview?
I added those two lines as the last statements in the CReportItemControlsDlg::OnInitDialog() method (sample ReportItemControls) and nothing happened.
Thank you
Vaclav
---------------------
ToolkitPro 20.1.0
VS2010-2022, Windows 11
Back to Top
Michl View Drop Down
Senior Member
Senior Member


Joined: 14 September 2007
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote Michl Quote  Post ReplyReply Direct Link To This Post Posted: 14 May 2014 at 4:41am

void CFrame::OnPrintPreview()
{
    CPrintPreviewState* pState = new CPrintPreviewState;
    pState->dwStates = 0;        //Auch die StatusBar soll im Print-Preview-Modus ausgeblendet werden!
    if (!m_pviewReport->DoPrintPreview(XTP_IDD_PREVIEW_DIALOGBAR, m_pviewReport, RUNTIME_CLASS(CXTPPreviewView), pState))
    {
        TRACE0( "Error: DoPrintPreview failed.\n" );
        AfxMessageBox( AFX_IDP_COMMAND_FAILURE );
        delete pState;      // preview failed to initialize, delete State now
    }
}

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.