Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
gustavgager
Partner - Creator II
Partner - Creator 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.

0 Replies