Print with Crystal

beasscript-logo-small

General function using Crystal report

// Define the report
printobject=openreport=myreport.rpt
// set parameter
printobject=setvar=myparam1=<paramvalue1>
printobject=setvar=myparam2=<paramvalue2>
// Print
printobject=crreport=printout

 

More see Examples

 

Property

Description

crreport

Complete report crystal handling

openreport

opens rpt-file

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

 

Additional command using Crystal 11 viewer

 

Property

Description

connect

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

connectioninfo

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.

disconnect

disconnects from the crystal engine Crystal 11 and 12

paremater_set

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

parameter

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

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

wait_for_crystal

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

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

connect

connect to print service

disconnect

disconnect from print service

settext

set a textobject in the report

gettext

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