printobject

Controls printing via Crystal Viewer

 

 

 

Property

CR 11

Description

crreport


 

Properties

Property

Description

exportoptions

 

Property

only CR11

Description

applicationfilename

x

set the application-filename for the print job

charfielddelimiter

x


charstringdelimiter

x


destinationtype

x

follow values are aviable:

application

disk

mail

mailvim

lodusdomino

microsoftexchange

nodestination

please do not work with this property.We don't check this with be.as.

diskfilename


if export to file: the filename

formattype


describe the format of the file

charseparatedvalues

crystalreport

textrichtext

excel

html40

noformat

pdf

tabseparatedtext

text

wordforwindows

xml

 

For Crystal 11

commaseparatedvalues

crystalreport70

datainterchange

textrichttext

excel50

excel50tabular

excel70

excel70tabula

excel80

excel80tabular

excel97

explorer32exted

html32standard

html40

lotus123wk1

lotus123wk3

lotus123wks

odbc

paginatedtext

recordstyle

reportdefinition

tabseparatedvalues

 

pdfexportallpages

x

true/false

pdffirstpagenumber

x

n

pdflastpagenumber

x

n

frompage


define first page for print (not Crystal 11)

topage


define last page for print (not Crystal 11)

printobject=crreport=exportoption=<parameters>

export

save/export the report

true=popup window for question format and application

false=export direct with the current settings

return: Variable return=1 ok, -1=error

printout

print the document

return: Variable return=1 ok, -1=error

saveas=<filename>

save the document in crystal 8 Format

selectprinter=driver

set the current Printer

printobject=crreport=selectprinter=[printerdriver]=[printername]=[port}

 

You need only the printer name

Short Syntax is

printobject=crreport=selectprinter==[printername]

 

Example

printobject=crreport=selectprinter==hp office

 

more info see printer

copies

Define count of copies

printobject=crreport=copies=3
printobject=crreport=printout

 

Print-Properties

Property

Description

papersize=x

 

Example

printobject=crreport=papersize=x

Default Paper Size=0

Paper 10x14=16

Paper 11x17=17

Paper A3=8

Paper A4=9

Paper A4 small=10

Paper A5=11

Paper B4=12

Paper B5=13

Paper C Sheet=24

Paper D Sheet=25

Paper Envelope 10=20

Paper Envelope 11=21

Paper Envelope 12=22

Paper Envelope 14=23

Paper Envelope 9=19

Paper Envelope B4=33

Paper Envelope B5=34

Paper Envelope B6=35

Paper Envelope C3=29

Paper Envelope C4=30

Paper Envelope C5=28

Paper Envelope C6=32

Paper Envelope DL=27

Paper Envelope Italy=36

Paper Envelope Monarch=37

Paper Envelope Personal=38

Paper E Sheet=26

Paper Executive=7

Paper Fanfold Legal German=41

Paper Fanfold Std German=40

Paper Fanfold US=39

Paper Folio=14

Paper Ledger=4

Paper Legal=5

Paper Letter=1

Paper Letter Small=2

Paper Note=18

Paper Quarto=15

Paper Statement=6

Paper Tabloid=3

Paper User=256

papersource=x

Default=0

Bin Cassette=14

Bin Envelope=5

Bin Env Manual=6

Bin Form Source=15

Bin Large Capacity=11

Bin Large Format=10

Bin Lower=2

Bin Manual=4

Bin Middle=3

Bin Small Format=9

Bin Tractor=8

Bin Upper=1

Automatic=7

leftmargin=x

set left margin

topmargin=x

set top margin

bttommargin=x

set bottom margin

rightmargin=x

set right margin

paperorientation=x

set paper orientation

Default=0

Landscape=2

Portrait=1

duplex=x

set duplex

Default=0

Normal (nonduplex) printing=1

Short-edge binding (the longer edge of the page is horizontal)=2

Long-edge binding (the longer edge of the page is vertical)=3

papersizewidth

Define Paper size width

papersizeheight

Define Paper size height

 

 

 

 

makrostart


printobject=makrostart=typ fax/email/pdf/preview/label/export/excel ...,

=[windowname]=[makroname]
typ

makro for fax/email/pdf/pre// view/label/export/excel.

if nothing, then preview

 

windowname
sbo-id from current window or name from the psr-file

 

makroname

name of the makro or the number from makro

if nothing, then popup a window

 

to edit the makro definition, click on the pen. if the pen is not valid, then use the script:
openwindow=report_makro_struktur.psr=s_parm1:<current window without .psr>

Example in operation-window

openwindow=report_makro_struktur.psr=s_parm1:stamm_ag_browse

In SAP-Form item

openwindow=report_makro_struktur.psr=s_parm1:150

 

other way

insert the report in beas / extra / report - right mouse click - window setting and insert the report. Then you can start the report from menu or button with:

printobject=makrostart=preview=extras=<makroid>  

 

or print makro from curent window

printobject=makrostart=print==100021

 

if you work with more then 1 Datawindow (dw_2, dw_3..) then you want make a preview, then you can set the print-datawindow with setvar=sys_printdw=dw_x

 

setvar=sys_printdw=dw_2

printobject=makrostart=print=...

 

silent=true


set to silent-mode. beas disable the report-list and print always the first report.

makroprinterdriver


if you wan't an spezial printer for this makro-printjob, you can set this with makroprintdriver

printobject=makroprinterdriver=[printername][char 9][drivername][char 9][portname]

printobject=makrostart=...

makroexport=xx


export one makrosetting to string (beas-string-format)

return in Variable "value"

printobject=makroexport=<makroid-nr>

makroimport=xx


import one makrosetting from string in a new makro-entry

xx = "clipboard" (string from clipboard)

xx = variable-name (string is in variable xx)

xx = makro-definition-string (xx longer then 100 signs ..

printobject=makroimport=xx

connect

x

connects to the crystal engine. Permitted objects: Crystal 11 and 12

disconnect

x

disconnects from the crystal engine Crystal 11 and 12

openreport


opens rpt-file

connectioninfo

x

connects the report to the current database.
if Variable connectverify<>"N": all tables are connected to the database except tables with the name "command" and "befehl"
 
Checks object name:

if the prefix of a text-object is "@": the content gets interpreted.
if the object-name of a text ends with "_t": the content gets interpreted.
 
Checks forms:
if a form starts and ends with ":  the content gets interpreted
if the text contains < and >: the be.as-converter starts.
else: direct translation:
Important: within the be.as-converter the command <spr:..> is not translated in document language but in GUI language.

selectprinter


selects the printer
printobject=selectprinter=<dll>=<port>=<printername>

parameter

x

starts argument checking (automatically within "print") and passes the BEAS variables on to the report.

Gets suppressed if the variable "parameterrequest" is "N".

Note:

This is only working, if the system use the old viewer "crystal 11"

Default is the new SAP Crystal viewer

paremater_set

x

Only for Crystal 11:

set the parameter (setting with parameter or setvar) to the current report.

call after parameter and before crreport.export.

 

printobject=openreport=<myfile.prt>

printobject=connectioninfo

printobject=setvar=[argument]=<value>

printobject=parameter_set

printobject=crreport=printout

setvar


sets a report-variable
printobject=setvar=[argument]=<variable>

getvar


gets a variable and writes it to <wert1>
printobject=getvar=<value>

setreset


deletes all variables

setlanguage


set the language to printout the report

printobject=setlanguage=E

settext

x

set a textobject in the report

gettext

x

get a textobject from the current report in value <value>

wait_for_crystal

x

beas stop the script while crystal is printing the last report

for ll_mytest=1 to 5

 printobject=crreport=printout

 printobject=wait_for_crystal

end if

Note: You need this only, if you use old Crystal 11 viewer.

 

Example Video

youtube Create Label for each line from a sap b1 receipt document

 

hmtoggle_plus1Example with set the printer (used also crreport comands)

printobject=openreport=myreport.rpt

printobject=connectioninfo

// Define parameter

printobject=setvar=myparam1=<paramvalue1>

printobject=setvar=myparam2=<paramvalue2>

printobject=parameter_set

// set printer (exact that name, which is defined in the Windows printer definitions)

tools=printer=getdriversport=name

printobject=crreport=selectprinter=<value_printerdriver>=<value_printername>=<value_printerport>

// and print out

printobject=crreport=printout

 

hmtoggle_plus1Example for print a single-report with 2 copies

// open the report

printobject=openreport=<myfile.prt>

// define all parameters

printobject=setvar=myparam1=<paramvalue1>

printobject=setvar=myparam2=<paramvalue2>

printobject=parameter

// Define count of copies (need beas 9.3 PL 3 HF 1 or newer)

printobject=copies=2

// Write parameters

printobject=parameter_set

// Print out

printobject=crreport=printout

 

hmtoggle_plus1Example with export and print

// load report from variable "filename"

printobject=openreport=<filename>

// set connection to the current database

printobject=connectioninfo

// call parameter-window

printobject=parameter

// set the parameter to the formular

printobject=parameter_set

// and save (export with question about format)

printobject=crreport=exportoption=destinationtype=disk

printobject=crreport=exportoption=diskfilename=c:\temp\myreport.pdf

printobject=crreport=exportoption=formattype=pdf

printobject=crreport=export=true

// and select printer

tools=printer=getdriversport=hpoffice

printobject=crreport=selectprinter=<value_printerdriver>=<value_printername>=<value_printerport>

// and print out

printobject=crreport=printout