|
Creates a text file formatted for printing.
syntax
SavePrintText(
fileName,
data,
width
[,grid = "-,|,-,|,-,|,="]
[,titleRows = 0]
[,leftHeader = ""]
[,centerHeader = ""]
[,rightHeader = ""]
[,leftFooter = ""]
[,centerFooter = ""]
[,rightFooter = ""]
[,leftSpace = 0]
[,topSpace1= 0]
[,topSpace2= 0]
[,bottomSpace1 = 0]
[,bottomSpace2= 0]
[,pageRows = 0]
[,bNewPage = F]
)
Parameters
fileName
|
|
Type:
|
character
|
|
File name.
|
data
|
|
Type:
|
Two-dimensional array
|
|
Specify the data to be output as a two-dimensional array.
|
width
|
|
Type:
|
Numeric Array
|
|
Specify the width of each field (number of half-width characters) using an array.
|
grid
|
|
Type:
|
character
|
|
Characters to use as lines. Specify in the following order:
[Top line],[Left line],[Bottom line],[Right line],[Horizontal line],[Vertical line],[Title separator]
Example 1) "-,|,-,|,-,|,-"
Example 2) ",,,,-,|,-"
Example 3) ",,,,-,|,="
Example 4) "-,,-,,-,,-"
Example 5) ",|,,|,,|,-"
Example 6) ",,,,,,"
|
titleRows
|
|
Type:
|
Number
|
|
Number of title rows. Of the data passed in data, the number of rows specified in titleRows will be treated as titles.
|
leftHeader
|
|
Type:
|
character
|
|
Header text is displayed left justified.
|
centerHeader
|
|
Type:
|
character
|
|
The header text that appears in the center.
|
centerHeader
|
|
Type:
|
character
|
|
The header text that appears in the center.
|
rightHeader
|
|
Type:
|
character
|
|
Right-justified header text.
|
leftFooter
|
|
Type:
|
character
|
|
Footer text that is displayed left justified.
|
leftFooter
|
|
Type:
|
character
|
|
Footer text that is displayed left justified.
|
centerFooter
|
|
Type:
|
character
|
|
Footer text displayed in the center.
|
centerFooter
|
|
Type:
|
character
|
|
Footer text displayed in the center.
|
rightFooter
|
|
Type:
|
character
|
|
Right-justified footer text.
|
leftSpace
|
|
Type:
|
Number
|
|
Space on the left side. Specify in half-width characters.
|
topSpace1
|
|
Type:
|
Number
|
|
Space above the header text. Specify in half-width characters.
|
topSpace2
|
|
Type:
|
Number
|
|
Space between the header text and the table. Specify in half-width characters.
|
bottomSpace1
|
|
Type:
|
Number
|
|
Space between the footer text and the table. Specify in half-width characters.
|
bottomSpace2
|
|
Type:
|
Number
|
|
Space below the footer text. Specify in half-width characters.
|
pageRows
|
|
Type:
|
Number
|
|
Number of rows per page. When set to 0, the grid will be displayed until data is available. When set to 1 or more, the grid will be displayed for the specified number of rows even if no data is available.
|
bNewPage
|
|
Type:
|
Boolean
|
|
FALSE - Do not break the page. TRUE - Break the page at the number of rows specified by pageRows.
|
Return Value
|
|
Type:
|
Boolean
|
|
FALSE - Failure. TRUE - Success.
|
Explanation
Create a text file formatted for printing. When printing, use a monospaced font such as "MS Gothic" or "MS Mincho." (In Notepad, you can specify the default font to be used in the "Format" and "Font" menus.)
|
Example
|
var vData = c(c("Title1", "123", "ABC"), c("Title2", "456", "DEF"), c("Title3", "789", "GHI"));
::SavePrintText("c:\print.txt", vData, c(10,15,20), ",|,,|,,|,-", 1, "", "Header");
::OpenApplicationFile("c:\print.txt"); //Display notepad
|
The result is as follows:
Title1
|
Title2
|
Title3
|
123
|
456
|
789
|
ABC
|
DEF
|
GHI
|
|
Supported
reference
LoadTextFile
SaveTextFile
LoadCsvFile
SaveCsvFile
SavePrintText
GetTempFolder
GetTempFile
GetCurrentFolder
GetModuleFolder
GetFileSize
GetFileLastWriteTime
GetLogicalDrives
GetDriveType
EncryptFile
DecryptFile
SetClipboardData
GetClipboardData
|