|
of_prepprint
|
|
Full name
|
pfc_n_cst_dssrv_report.of_prepprint
|
Access
|
public
|
Extend of
|
string
|
Return value
|
string
|
Prototype
|
public function string of_prepprint(boolean)
|
Name
|
Datatype
|
BLACK
|
Long
|
lbo_Border
|
Border
|
li_Count
|
Integer
|
li_NumObjects
|
Integer
|
li_Undo
|
Integer
|
lnv_String
|
n_cst_string
|
ls_Color
|
String
|
ls_Modify
|
String
|
ls_Objects
|
String[]
|
ls_Return
|
String
|
ls_Type
|
String
|
ls_Undo
|
String
|
WHITE
|
Long
|
public function string of_prepprint (boolean ab_convertheader);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_PrepPrint
//
// Access: public
//
// Arguments:
// ab_ConvertHeader True - change borders on header objects to be
// underline.
// False - remove header borders as well as others.
//
// Returns: String
// The output of the Modify command (the error text or "").
//
// Description: Prepare a datawindow for printing. Change all colors to black on white
// and remove borders from all columns.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved.
// Any distribution of the PowerBuilder Foundation Classes (PFC)
// source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////
String ls_Objects[], ls_Modify, ls_Return, ls_Undo, ls_Type, ls_Color
Integer li_NumObjects, li_Count, li_Undo
Border lbo_Border
n_cst_string lnv_String
Constant Long BLACK = 0
Constant Long WHITE = RGB(255, 255, 255)
// Set the color of the datawindow to white
ls_Color = ids_requestor.Describe("Datawindow.Color")
If Long(ls_Color) <> WHITE Then
ls_Modify = "Datawindow.Color=" + String(WHITE)
ls_Undo = "Datawindow.Color=" + ls_Color
End if
// Change all colors to black on white
ls_Color = of_SetColor(BLACK, WHITE, "*", "*", False)
If ls_Color <> "" Then
ls_Modify = ls_Modify + " " + ls_Color
ls_Undo = ls_Undo + " " + is_Undo[ii_UndoLevel]
ii_UndoLevel --
End if
// Change the borders
// First, get all visible objects
li_NumObjects = of_GetObjects(ls_Objects, "*", "*", True)
// Determine the type of border the header objects should have
If ab_ConvertHeader Then
lbo_Border = Underline!
Else
lbo_Border = NoBorder!
End if
li_Undo = ii_UndoLevel
For li_Count = 1 To li_NumObjects
// Call the change border function for each object
If ids_requestor.Describe(ls_Objects[li_Count] + ".Band") = "header" And &
Right(ls_Objects[li_Count], 2) = is_defaultheadersuffix Then
// The header border is determined by ab_ConvertHeader
ls_Modify = ls_Modify + of_SetBorder(lbo_Border, ls_Objects[li_Count], "", False)
Else
// All other objects should have no border
ls_Modify = ls_Modify + of_SetBorder(NoBorder!, ls_Objects[li_Count], "", False)
End if
Next
// Combine each object's undo statement into one
li_Undo ++
For li_Count = (li_Undo + 1) To ii_UndoLevel
is_Undo[li_Undo] = is_Undo[li_Undo] + " " + is_Undo[li_Count]
Next
ii_UndoLevel = li_Undo
is_Undo[ii_UndoLevel] = ls_Undo + is_Undo[ii_UndoLevel]
is_Undo[ii_UndoLevel] = lnv_string.of_GlobalReplace (is_Undo[ii_UndoLevel], "~"", "")
ls_Return = ids_requestor.Modify(ls_Modify)
Return ls_Return
end function