Print Page | Close Window

Print Report, how i change page size ????

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=15103
Printed Date: 15 November 2024 at 5:02am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Print Report, how i change page size ????
Posted By: gorras
Subject: Print Report, how i change page size ????
Date Posted: 02 September 2009 at 10:21am
hello ..... I'm newie with these controls and would like to know how to change the page size (example A5), orientation, etc without ShowPrintPageSetup? because this form it presents its information in English and I need to present it in Spanish. thank a lot.



Replies:
Posted By: SuperMario
Date Posted: 02 September 2009 at 10:41am
No need to, use the provided translations:

http://codejock.com/support/articles/com/general/g_1.asp

Also check out the resource editor for untranslated text:




Posted By: mdoubson
Date Posted: 02 September 2009 at 10:35pm
I guess the answer is not expected - you need to use standard API to setup your printer with all needed information - orientation, page size (type) and so on - if you set this printer as default - all this settings will be automatically used in your print / printpreview
 
For example - this is generic function to set mode and paper type (in MFC but you can port it on any language) ON DEFAULT PRINTER

void SetLandscapeMode(BOOL bLandscapeMode, CString sPaperType)

{

PRINTDLG pd;

pd.lStructSize = (DWORD) sizeof(PRINTDLG);

if (GetPrinterDeviceDefaults(&pd))

{

DEVMODE* pDevMode = (DEVMODE*)::GlobalLock(m_hDevMode);

if (bLandscapeMode)

pDevMode->dmOrientation = DMORIENT_LANDSCAPE;

else

pDevMode->dmOrientation = DMORIENT_PORTRAIT;

int iPT = 0;

if (sPaperType == "Letter 8 1/2 x 11 in")

iPT = DMPAPER_LETTER;

else if (sPaperType == "Letter Small 8 1/2 x 11 in")

iPT = DMPAPER_LETTERSMALL;

else if (sPaperType == "Tabloid 11 x 17 in")

iPT = DMPAPER_TABLOID;

else if (sPaperType == "Ledger 17 x 11 in")

iPT = DMPAPER_LEDGER;

else if (sPaperType == "Legal 8 1/2 x 14 in")

iPT = DMPAPER_LEGAL;

else if (sPaperType == "Statement 5 1/2 x 8 1/2 in")

iPT = DMPAPER_STATEMENT;

else if (sPaperType == "Executive 7 1/4 x 10 1/2 in")

iPT = DMPAPER_EXECUTIVE;

else if (sPaperType == "A3 297 x 420 mm")

iPT = DMPAPER_A3;

else if (sPaperType == "A4 210 x 297 mm")

iPT = DMPAPER_A4;

else if (sPaperType == "A4 Small 210 x 297 mm")

iPT = DMPAPER_A4SMALL;

else if (sPaperType == "A5 148 x 210 mm")

iPT = DMPAPER_A5;

else if (sPaperType == "B4 (JIS) 250 x 354 mm")

iPT = DMPAPER_B4;

else if (sPaperType == "B5 (JIS) 182 x 257 mm")

iPT = DMPAPER_B5;

else if (sPaperType == "Folio 8 1/2 x 13 in")

iPT = DMPAPER_FOLIO;

else if (sPaperType == "Quarto 215 x 275 mm")

iPT = DMPAPER_QUARTO;

else if (sPaperType == "10x14 in")

iPT = DMPAPER_10X14;

else if (sPaperType == "11x17 in")

iPT = DMPAPER_11X17;

else if (sPaperType == "Note 8 1/2 x 11 in")

iPT = DMPAPER_NOTE;

else if (sPaperType == "US Std Fanfold 14 7/8 x 11 in")

iPT = DMPAPER_FANFOLD_US;

/*

#define DMPAPER_ENV_9 19 " Envelope #9 3 7/8 x 8 7/8 "

#define DMPAPER_ENV_10 20 " Envelope #10 4 1/8 x 9 1/2 "

#define DMPAPER_ENV_11 21 " Envelope #11 4 1/2 x 10 3/8 "

#define DMPAPER_ENV_12 22 " Envelope #12 4 \276 x 11 "

#define DMPAPER_ENV_14 23 " Envelope #14 5 x 11 1/2 "

#define DMPAPER_CSHEET 24 " C size sheet "

#define DMPAPER_DSHEET 25 " D size sheet "

#define DMPAPER_ESHEET 26 " E size sheet "

#define DMPAPER_ENV_DL 27 " Envelope DL 110 x 220mm "

#define DMPAPER_ENV_C5 28 " Envelope C5 162 x 229 mm "

#define DMPAPER_ENV_C3 29 " Envelope C3 324 x 458 mm "

#define DMPAPER_ENV_C4 30 " Envelope C4 229 x 324 mm "

#define DMPAPER_ENV_C6 31 " Envelope C6 114 x 162 mm "

#define DMPAPER_ENV_C65 32 " Envelope C65 114 x 229 mm "

#define DMPAPER_ENV_B4 33 " Envelope B4 250 x 353 mm "

#define DMPAPER_ENV_B5 34 " Envelope B5 176 x 250 mm "

#define DMPAPER_ENV_B6 35 " Envelope B6 176 x 125 mm "

#define DMPAPER_ENV_ITALY 36 " Envelope 110 x 230 mm "

#define DMPAPER_ENV_MONARCH 37 " Envelope Monarch 3.875 x 7.5 in "

#define DMPAPER_ENV_PERSONAL 38 " 6 3/4 Envelope 3 5/8 x 6 1/2 in "

*/

if (pDevMode->dmFields & DM_PAPERSIZE)

pDevMode->dmPaperSize = iPT;

::GlobalUnlock(m_hDevMode);

}

else

{

AfxMessageBox("Default printer not found!\nBroken network connection?");

}

}

I guess that this API are language-independant


-------------
Mark Doubson, Ph.D.


Posted By: gorras
Date Posted: 16 September 2009 at 10:57am
thank a lot for all answers.....



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