Qlik Community

Qlik Education Discussions

Discussion Board for collaboration related to Qlik Education.

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
Not applicable

Re: Set programmatically image formatting in sheet background

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

Community Browser