Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set programmatically image formatting in sheet background

Hi,

I want to create a button that will change my background in the sheet.

I wrote that code:

     status = ActiveDocument.Sheets(4).SetWallPaper ("image", 2)

     ActiveDocument.Sheets(0).Activate

     ActiveDocument.Sheets(4).Activate

But after that Qlik change image formatting to 'Fill'. I want to set 'Keep Acpect'.

How can I do that?

1 Reply
marcus_sommer
MVP
MVP

Have a look on this example from APIGuide.qvw (in your install-folder):

set mysheet=ActiveDocument.ActiveSheet

set sp=mysheet.GetProperties

sp.BkgImageSettings.ImageStyle.StretchMode = 1   'fill

mysheet.SetProperties sp

StretchMode

0   =   No Stretch

1   =   Fill

2   =   Keep Aspect

3   =   Fill with Aspect

4   =   Tile

- Marcus