Select a Printer in Toolcode.

Dear All,

I could not find the way to select a printer in forte ToolCode.

(not in PrintDialog box by end user)

"windowsystem.DefaultPrintOptions" has only a default printer option but

Our configuration(based on NT, Win95) has more than a printer. so I want

to know

the way to access the printers to be registered in Toolcode without

changing

default printer by a end user. (like Printers Collection in VB)

hongwook woo.

[490 byte] By [709319] at [2007-11-25 5:00:53]
# 1

Hi,

there is no possibilities to change printer from tool code. We askd Forte'

some times ago but they said we have to use some OCX to control printer

from code. We tried to use comdlg.ocx but it doesn't offer any possibility

to change printer.

Using Forte' printing classes we found another problem (we are using

empyPage): when you choose "print in landscape" from PrintDialogBox there

is no problem and the print of our emptyPage is correctly fitted in the

page. Instead if you don't use printDialog (as the method we enclosed) here

is what happens:

1) the emptyPage modifies its dimension correctly

2) printDocument mantains portrait dimensions

Here is a test method that draws a rectangle in a page. You can see that we

are printing on the log the dimensions (height and width) of the page and

of the printDocument: those of the emptyPage change correctly, instead

those of the printDocument remain as if we are printing in portrait mode.

If you substitute the use of myPrintOptions and use the defaultPrintOptions

with printDialog, all is correct: also printDocument dimensions are

changing as for a landscape print.

Did you ever found anything like that?

We asked Forte' also for this problem and we are waiting for their reply. I

will keep you informed on the matter.

ePage : emptyPage = new;

doc : printDOcument = new;

ReportFont : PortableFontDescriptor;

ogg : printOptionsDesc = new;

ogg.StartPage = 1;

ogg.EndPage = 32767;

ogg.NumCopies = 1;

ogg.orientation = PO_LANDSCAPE;

ePage.Window.WindowSystem.DefaultPrintOptions = ogg;

task.lgr.putline(ePage.Window.WindowSystem.defaultPrintOptions.orientation)

;

doc = ePage.Window.WindowSystem.OpenPrintDocument(PrintOptions = ogg,

docName = 'Report',

hasCancelDialog = TRUE);

doc.PrintOptions.Orientation = PO_LANDSCAPE;

ReportFont = ePage.Window.WindowSystem.GetPortableFont(PointSize = 12 *

10,

TypeFace = TF_COURIER,

isBold = FALSE,

isItalic = FALSE);

doc.SetWorkingPage(page = ePage, heightPolicy=SP_EXPLICIT,

widthPolicy=SP_EXPLICIT);

ePage.Window.Page.DefaultFont = ReportFont;

ePage.Window.Page.LineSpacing = TS_SINGLESPACE;

ePage.Window.Page.FillColor = C_WHITE;

ePage.Window.Page.PenColor = C_BLACK;

ePage.Window.Page.heightPolicy = SP_EXPLICIT;

ePage.Window.Page.widthPolicy = SP_EXPLICIT;

task.lgr.put('Height of the page (printdoc) = ');

task.lgr.putline(doc.PrintOptions.height);

task.lgr.put('width of the page (printDoc) = ');

task.lgr.putline(doc.printOptions.width);

task.lgr.put('height of EmptyPage = ');

task.lgr.putline(ePage.window.page.height);

task.lgr.put('Width of EmptyPage = ');

task.lgr.putline(ePage.window.page.width);

ePage.WIndow.Page.drawRectangle(width = ePag.Window.Page.width,

height = ePage.Window.Page.height,

startX = 0,

startY = 0,

penColor = C_BLACK,

fillColor = c_WHITE,

lineStyle = LS_DEFAULT,

lineWeight = W_DEFAULT);

doc.PrintWorkingPage();

eage.Window.WindowSystem.ClosePrintDocument(printDoc = doc);

epage.Window.Page.ClearPage();

Alessandra Solano

CSI PIEMONTE

C.so Unione Sovietica, 216

Turin . Italy

MailTo: Alessandra.Solano@csi.it

_

cool@ns.kcclab.co.kr il 04/11/97 23.31.44

Rispondere, prego a cool@ns.kcclab.co.kr

Per: kamranamin@yahoo.com

cc:(ccr: Alessandra Solano/CSI/IT)

Oggetto: Select a Printer in Toolcode.

Dear All,

I could not find the way to select a printer in forte ToolCode.

(not in PrintDialog box by end user)

"windowsystem.DefaultPrintOptions" has only a default printer option but

Our configuration(based on NT, Win95) has more than a printer. so I want

to know

the way to access the printers to be registered in Toolcode without

changing

default printer by a end user. (like Printers Collection in VB)

hongwook woo.

709319 at 2007-6-30 22:00:53 > top of Java-index,Application & Integration Servers,Integration Servers...