Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

gustavgager
Contributor II

Macro to print sheet with background

Hi everyone. Im trying to do the simplest thing with a Macro, but it seems to be impossible to get it exactly like i want it.

What i want is to print one sheet including the background (in my case to a PDF file).

If i use this:
$o_document.activesheet.print

Then it print the sheet just fine, just without the background.

Then i tried this:

$o_document.activesheet.printout(true)
Then it checks the "draw background" checkbox. But this time it gives me the printer dialog. And if i just press "print", then everything works exactly as it should.

I have also tried changing the settings to the printersettings using:

$o_DocumentProperties = $o_document.GetProperties

$o_DocumentPrinterProperties = $o_DocumentProperties.PrintSheetSettings

$o_DocumentPrinterProperties.SheetPrintDrawBackGround = true

$o_document.SetProperties($o_DocumentProperties)

yet again. It works if i use printout, but that give me a print dialogbox. And if i just use print, it prints fine, but without the background.

Anyone have any idees or suggestions?

I have looked trough the API guide, but it doesnt help me.

Tags (2)
Community Browser