Print Page | Close Window

CXTPReportControl PrintPreview

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=22087
Printed Date: 15 November 2024 at 6:24pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPReportControl PrintPreview
Posted By: vjedlicka
Subject: CXTPReportControl PrintPreview
Date 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



Replies:
Posted By: SuperMario
Date Posted: 02 December 2013 at 9:02am
GetReportCtrl().EnablePreviewMode(!GetReportCtrl().IsPreviewMode());
GetReportCtrl().Populate();


Posted By: vjedlicka
Date 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


Posted By: Michl
Date 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
    }
}




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net