Home Information PDF Documents EULANDA Handbooks Training Book's corner Download Contact us Table of Contents About us

Glossary

Password needed Newsgroup

Remote Support system

Method: Client.Print (iScript)

Back | Level back

Client.Print(Report, Data, Target, Targetinfo)

Parameter

Report

The name of the report to printing  - not to confuse with the notice name in the menu.

Data

The data to printing. According to related report  only a object could become indicated or a entire quantity of data. Other Reports again produce the data completely themselves. In that case the indication Data will be ignored. Examples:
Report Type SubType Comment
cnsoft.Adresse.Stammdaten MULTI LIST Data will be interprets as quantity of data
cnsoft.Artikel.Stat.ErloesGr.AktuellesJahr EMBEDDED   Data will be ignored. All Data will be generate in the reports
cnsoft.Auftrag.Auftragsbestaetigung MULTI SINGLEOBJECT Data will be interprets as a single data record. In deliver a dataset only the current data record will be printed.
Value Description Comment
Integer The ID of a single object  
Objekt: Dataset The current data record or dataset  according to subtyp of the used report.  
Optionenstring e.g. SQL command, which determine the IDs for printing  Version 2.5
     

SQL_IDs (Option of Data)

Target

Value Description Comment
"" (Empty string) Proclamation of the print box  
"PREVIEW" Print preview  Version 2.5
"PRINTER" Printer  
"FILE" Edition as a file PDF, CNARP, TXT, FAX, PRN (Printer specified)

Target info

Additional information  about the respective edition medium  

Target = "FILE"

Filename

Target = "PRINTER"

Printergroup
or
Option string

Copies (Option of Targetinfo)
Letterhead (Option of Targetinfo)
Printername (Option of Targetinfo)
Profile  (Option of Targetinfo)
SQL_IDs (Option of Data)

Examples

A. Printing with Printbox

Expression of the order confirmation of the current  order with the indication of the print box.

VBScript
Reportname = "cnsoft.Auftrag.Auftragsbestaetigung" 
Client.Print Reportname, Dataset, "", ""

B. Printing of Printer group (V 2.1)

Expression direct to the printer. The attitudes of the printer group "Geschaeftspapier" will be used. So that means that the digital stationery, the stacked selection and the printer itselves. If no printer group become indicated Eulanda took the attitudes of the printer group which is assigned with the report.

VBScript
Reportname = "cnsoft.Auftrag.Auftragsbestaetigung" 
Client.Print Reportname, Dataset, "PRINTER", "Geschaeftspapier"

C. Indication of the print preview (V 2.5)

VBScript
Reportname = "cnsoft.Auftrag.Auftragsbestaetigung" 
Client.Print Reportname, Dataset, "PREVIEW", ""

D. Edition as PDF (Portable Document Format)

In that example the current order will be saved as PDF file on your desktop. For determining the desktop index windows carried out the  WScript.Shell-Object. As a termination, a reference is given to the user where the file is saved.

VBScript Context: Auftragsmodul
set WshShell = CreateObject("WScript.Shell")
DesktopFolder = WshShell.SpecialFolders("Desktop")
Reportname = "cnsoft.Auftrag.Auftragsbestaetigung"
Filename = "Auftrag" & Dataset.Values("Kopfnummer") & ".pdf"
Filepath = DesktopFolder & "\" & Filename

Client.Print Reportname, Dataset, "FILE", Filepath
 
MsgBox "The Auftragsbestätigung is saved as """ & Filename & """ on your desktop"

E. Printing of a address list with a SQL condition (V2.5)

VBScript
Reportname = "cnsoft.Adresse.TelefonListe"
SelectIDs = "(SELECT TOP 10 id FROM Adresse WHERE ISNULL(Email,'')='')"
Client.Print Reportname, "SQL_IDS=" & SelectIDs, "PREVIEW",""

F. Print control based on the pc and user name (V2.1)

At first the current user name and the pc name will be determinate from the windows environment variable. According to that of which computer the script will be start, it determinate another printer group with the SELECT/CASE structure. In this manner another printer become addressed by the dependent workstation. The user name in that example won't be evaluated. That could be resulted analog by the pc name.

Reference: From EULANDA Version 2.7 you could reach the workstation depending printer group attitudes without scripts only with the Registry .

VBScript Context: Auftragsmodul
option explicit 'server test of the variable names 

' Determining of the user and computer name from the windows environment variable

dim WshShell, objEnv, pcname, username
set WshShell = CreateObject ("WScript.Shell")
set objEnv = WshShell.Environment("PROCESS")
pcname = objEnv("COMPUTERNAME")
username = objEnv("USERNAME")

dim Druckergruppe, Reportname

Reportname = "cnsoft.Auftrag.Auftragsbestaetigung"

' For the workstation "LAGER" and "EINKAUF" will be used a specified printer group.
' Otherwise the standard group will be used. 
' TIPP: In a CASE branch could also become set more than one variable. 
 
select case pcname
  case "LAGER"
    Druckergruppe = "VORGANG_LAGER"
  case "EINKAUF"
    Druckergruppe = "VORGANG_EINKAUF"
    ' Reportname = "cnsoft.Auftrag.AuftragsKopie"
  case else
    Druckergruppe = "VORGANG"
end select

Client.Print Reportname, Dataset, "PRINTER", Druckergruppe