Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CExtGridWnd print Collapse All
Subject Author Date
Andrew Banks Aug 1, 2007 - 11:40 AM

Hi,

I cant find anything to change portrait/landscape and paper size in the print function of CExtGridWnd .

I know I can use print setup to change these, but, for the users, they dont want to do this everytime.

In other words, If i have a grid that can be printed on legal, landscape mode and not produce multiple pages for the across dimension,
then it would be more user friendly.

Do you have this?

Technical Support Aug 1, 2007 - 12:54 PM

The File | Print Setup menu command in the ReportGrid and SimpleGrids sample applications allows you to change the Portrait/Landscape page orientation. If you have a CExtPPVW-based control, then its m_pWndPP->m_pPpvPrintPreviewInfo->m_pPD->m_pd property (which is the PRINTDLG data structure) can be used to change the paper orientation programmatically. The PRINTDLG::hDevMode member specifies the memory containing the DEVMODE,/code> data structure which have the <code>DEVMODE::dmOrientation member (DMORIENT_PORTRAIT or DMORIENT_LANDSCAPE values can be specified in it). Additional tricks about printer settings are described in this article.


Andrew Banks Aug 1, 2007 - 1:32 PM

Thanks, however, just prior to
CExtPPVW < CExtGridWnd > :: OnCmdMsg( nID,nCode,pExtra,pHandlerInfo ) with nID == ID_FILE_PRINT

m_pWndPP is NULL.

Therefore, m_pWndPP is being set before printing.

What do I need to override to get to a non-NULL m_pWndPP.

Technical Support Aug 6, 2007 - 8:06 AM

We confirm the NULL value issue. Please override the CExtPPVW_Printable::OnInitializePrintPreviewToolBar() virtual method. This method is invoked to create the built-in toolbar after the print preview window environment has been created and configured.