Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
does anyone know how to print a Report for example REP01 via macro on a real printer?
(i would start the macro every time, when i load the script) i'm worry about selecting the report manually to print it...
best regards
Ingo
With name & target in a tablebox, which read per loop:
Set WSHShell = CreateObject("WScript.Shell") 'create new object
if WshShell.RegRead ("HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device") <> "QlikViewPDF" Then 'Read Registry
WSHShell.RegWrite "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device", "QlikViewPDF", "REG_SZ" 'Set Registry
end if
set TableBox = ActiveDocument.GetSheetObject( "TB01" )
for RowIter = 0 to TableBox.GetRowCount-1
set rep = TableBox.GetCell(RowIter,0)
set outputFile = TableBox.GetCell(RowIter,1)
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\OutputFile", outputFile, "REG_SZ"
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\BypassSaveAs", "1", "REG_SZ"
ActiveDocument.GetApplication.Sleep 50
ActiveDocument.PrintReport rep
next
By another printer as QlikViewPDF the statement for outputFile and automatically print are different but the logig for several prints per loop is the same - see APIGuide.qvw and AutomaticReference.pdf in your install-folder and many post here.
- Marcus