Skip to main content
Version: 20 R7 BETA

VP SET PRINT INFO

VP SET PRINT INFO ( vpAreaName : Text ; printInfo : Object { ; sheet : Integer } )

ParameterTypeDescription
vpAreaNameText->4D View Pro area name
printInfoObject->Object containing printing attributes
sheetInteger->Sheet index (current sheet if omitted)

Description

The VP SET PRINT INFO command defines the attributes to use when printing the vpAreaName.

Pass the name of the 4D View Pro area to print in vpAreaName. If you pass a name that does not exist, an error is returned.

You can pass an object containing definitions for various printing attributes in the printInfo parameter. To view the full list of the available attributes, see Print Attributes.

In the optional sheet parameter, you can designate a specific spreadsheet to print (counting begins at 0). If omitted, the current spreadsheet is used by default. You can explicitly select the current spreadsheet with the following constant:

  • vk current sheet

Example

The following code will print a 4D View Pro area to a PDF document:

var $printInfo : Object

//declare print attributes object
$printInfo:=New object

//define print attributes
$printInfo.headerCenter:="&BS.H.I.E.L.D. &A Sales Per Region"
$printInfo.firstPageNumber:=1
$printInfo.footerRight:="page &P of &N"
$printInfo.orientation:=vk print page orientation landscape
$printInfo.centering:=vk print centering horizontal
$printInfo.columnStart:=0
$printInfo.columnEnd:=8
$printInfo.rowStart:=0
$printInfo.rowEnd:=24

$printInfo.showGridLine:=True

//Add corporate logo
$printInfo.headerLeftImage:=logo.png
$printInfo.headerLeft:="&G"

$printInfo.showRowHeader:=vk print visibility hide
$printInfo.showColumnHeader:=vk print visibility hide
$printInfo.fitPagesWide:=1
$printInfo.fitPagesTall:=1

//print PDF document
VP SET PRINT INFO ("ViewProArea";$printInfo)

//export the PDF
VP EXPORT DOCUMENT("ViewProArea";"Sales2018.pdf";New object("formula";Formula(ALERT("PDF ready!"))))

The PDF:

See also

4D View Pro print attributes
VP Convert to picture
VP Get print info
VP PRINT