Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
192
Добавлен:
11.05.2015
Размер:
4.96 Mб
Скачать

Returns

TRUE if the call is successful.

FALSE if the call fails.

CRPEJob::OutputToWindow

Use OutputToWindow to set the output of the print job to the preview window which will have the specified attributes. This method does not print the report to the window, but specifies that when the report is printed, it will appear in a preview window. To actually print the report, use CRPEJob::StartJob, Page 459.

Syntax

OutputToWindow (title CHAR (*), left SMALLINT, top SMALLINT, width SMALLINT, height SMALLINT, style INTEGER, parentWindow ixWindow) RETURNING BOOLEAN

Parameters

title

Specifies the title that you want to appear in the title bar.

 

 

left

Specifies the x coordinate of the upper left hand corner of the preview window, in

 

device coordinates.

top

Specifies the y coordinate of the upper left hand corner of the preview window, in

 

device coordinates.

 

 

width

Specifies the width of the preview window, in device coordinates.

height

Specifies the height of the preview window, in device coordinates.

style

Specifies the style of the window being created. Style setting can be combined using

 

the bitwise Or operator ( | ). Refer to the CWnd class in the Microsoft Foundation

 

Class Library reference for possible window styles.

 

 

parentWindow

Specifies a pointer to the CWnd object for the window that is the parent of the preview

 

window. Specify NULL if the preview window will not have a parent window.

 

 

Returns

TRUE if the call is successful.

FALSE if the call fails.

Related Topics

PEOutputToWindow, Volume 2, Chapter 1

Crystal Class Library for NewEra Reference

436

CRPEJob::PrintControlsShowing

Syntax

PrintControlsShowing () RETURNING BOOLEAN, SMALLINT

Remarks

Checks if the print controls are displayed in the preview window. Use CRPEJob::ShowPrintControls, Page 458, to change whether or not print controls will appear in the preview window.

Returns

BOOLEAN

TRUE if the call is successful, FALSE if something goes wrong.

SMALLINT

Returns a pointer to a TRUE value if the print controls will be shown in

 

the preview window, FALSE if they will be hidden.

 

 

Related Topics

PEPrintControlsShowing, Volume 2, Chapter 1

CRPEJob::PrintWindow

Syntax

PrintWindow () RETURNING BOOLEAN

Remarks

This method prints the report displayed in the preview window to the printer. If you are customizing preview window controls, use this method to enable the user to preview the report in the preview window, and then, if everything looks satisfactory, to print the report to the printer (in response to a user event - button click, menu command, etc.).

Returns

TRUE if the call is successful.

FALSE if the call fails.

Related Topics

PEPrintWindow, Volume 2, Chapter 1

Crystal Class Library for NewEra Reference

437

CRPEJob::SelectPrinter

Syntax

SelectPrinter (driverName CHAR (*), printerName CHAR (*), portName CHAR (*), mode FOREIGN) RETURNING BOOLEAN

Parameters

driverName

Specifies the name of the printer driver for the printer being selected.

 

 

printerName

Specifies the name of the printer being selected (as indicated in the Printers Control

 

Panel).

 

 

PortName

Specifies the name of the port the printer is attached to. For example: “LPT1:”.

 

 

mode

A pointer to a DEVMODE class. The default implementation of

 

CRPEJob::SelectPrinter ignores this parameter. For more information, see

 

DEVMODE, Volume 2, Chapter 1.

 

 

Remarks

This method specifies the printer and/or print characteristics for the print job. You can use this method to enable the user to select a printer other than the default printer at print time. One way of doing this is to have your application call the Windows common Print Setup dialog box.

Returns

TRUE if the call is successful.

FALSE if the call fails.

Related Topics

PESetPrintDate, Volume 2, Chapter 1

CRPEJob::SetFont

Syntax

SetFont (sectionCode SMALLINT, scopeCode SMALLINT, faceName CHAR (*), fontFamily SMALLINT, fontPitch SMALLINT, charSet SMALLINT, pointSize SMALLINT, isItalic SMALLINT, isUnderlined SMALLINT, isStruckOut SMALLINT, weight

SMALLINT) RETURNING BOOLEAN

Crystal Class Library for NewEra Reference

438

Parameters

sectionCode

Specifies the section of the report for which you want to set the font. Use

 

one of the following values:

 

 

 

 

 

Value

Meaning

 

 

 

 

 

 

 

PEP_ALLSECTIONS

Sets the line height for all sections.

 

PEP_HEADERSECTION

Sets the line height for the Page

 

 

Header section.

 

 

 

 

PEP_GROUPHEADER

Sets the line height for the Group

 

 

Header section.

 

PEP_DETAILSECTION

Sets the line height for the Details

 

 

section.

 

 

 

 

PEP_GROUPFOOTER

Sets the line height for the Group

 

 

Footer section.

 

PEP_GRANDTOTALSECTION

Sets the line height for the Grand

 

 

Total section.

 

 

 

 

PEP_FOOTERSECTION

Sets the line height for the Page

 

 

Footer section.

 

 

scopeCode

Specifies whether the font selected is to apply to fields, to text, or to

 

both. To specify both, use the bitwise Or operator: |. The following

 

values are possible:

 

 

 

 

 

 

 

 

Value

Meaning

 

 

 

 

 

 

 

PEP_FIELDS

Sets the default font for fields in

 

 

the report section specified.

 

PEP_TEXT

Sets the default font for all text

 

 

(that has not been entered as a text

 

 

field value) in the report section

 

 

specified.

 

 

faceName

Specifies the actual face name of the font you want to use. The face name

 

you pass can typically come from a font dialog box, be hard coded in the

 

application, or be chosen by the application from the fonts supported on

 

the printer. For example: “Times New Roman”.

fontFamily

Specifies the font family for the font you want to use. Use one of the

 

following values:

 

 

 

 

 

 

 

 

Value

Meaning

 

 

 

 

 

 

 

FF_DONTCARE

No font family or family does not

 

 

matter.

 

 

 

Crystal Class Library for NewEra Reference

439

 

Value

Meaning

 

 

 

 

 

 

 

FF_ROMAN

Variable pitch font with serifs.

 

 

 

 

FF_SWISS

Fixed pitch font without serifs.

 

FF_MODERN

Fixed pitch font, with or without

 

 

serifs.

 

 

 

 

FF_SCRIPT

Handwriting-like font.

 

 

 

 

FF_DECORATIVE

Fancy display font.

 

 

fontPitch

Specifies the font pitch you wish to use. Use one of the following values:

 

Value

Meaning

 

 

 

 

 

 

 

DEFAULT_PITCH

Retains the default pitch for the

 

 

font.

 

 

 

 

FIXED_PITCH

Fixed pitch, each character is the

 

 

same width.

 

VARIABLE_PITCH

Variable pitch, the width of each

 

 

character varies.

 

 

 

 

 

charSet

Specifies the character set you wish to use. Use one of the following

 

values:

 

 

 

 

 

Value

 

 

 

 

 

ANSI_CHARSET

 

DEFAULT_CHARSET

 

SYMBOL_CHARSET

 

 

 

HANGEFUL_CHARSET

 

 

 

OEM_CHARSET

 

 

 

SHIFTJIS_CHARSET

 

CHINESEBIG5_CHARSET

 

 

 

 

pointSize

Specifies the desired point size for the selected font. Use 0 to indicate no

 

change.

 

 

isItalic

Specifies whether the font selected should be italicized. Use 1 for italics,

 

0 for no italics, or PEP_UNCHANGED to leave the italics as set up in the

 

report.

 

 

isUnderlined

Specifies whether the font should be underlined. Use 1 to underline, 0

 

for no underline, or PEP_UNCHANGED to leave underline settings as

 

specified in the report.

 

 

Crystal Class Library for NewEra Reference

440

isStruckOut

Specifies whether or not the font should appear in strikethrough format.

 

Use 1 for strike-out, 0 for no strike out, or PEP_UNCHANGE to leave

 

strike-out settings as specified in the report.

 

 

weight

Specifies the weight of the font. Possible values are:

 

 

 

 

 

Value

 

 

 

 

 

FW_DONTCARE

 

 

 

FW_EXTRALIGHT

 

FW_NORMAL

 

 

 

FW_SEMIBOLD

 

 

 

FW_EXTRABOLD

 

 

 

FW_ULTRALIGHT

 

 

 

FW_DEMIBOLD

 

FW_BLACK

 

 

 

FW_THIN

 

 

 

FW_LIGHT

 

 

 

FW_MEDIUM

 

FW_BOLD

 

 

 

FW_HEAVY

 

 

 

FW_REGULAR

 

 

 

FW_ULTRABOLD

Remarks

This method sets the font and font characteristics for the specified section. Use any time you need to change a default font at runtime in response to user input, or to specify a built-in printer font.

Returns

TRUE if the call is successful.

FALSE if the call fails.

Related Topics

PESetFont, Volume 2, Chapter 1

Crystal Class Library for NewEra Reference

441

Соседние файлы в папке crystal