Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

hopkinsc
Valued Contributor

zoom

Hi,

Is it possible to use a custom zoom instead of the standard :

25% 50% 75% 100% 125% 150% 175% 200% 400%

I know i can use the 'Fit Zoom to Window' option, but i would like if possible the user to input a zoom level themselves using an input box or selecting from a list box.

Thanks

11 Replies
hopkinsc
Valued Contributor

zoom

any update on this?

Not applicable

zoom

Hi,

You can use a macro and set in document properties, Triggers / Filed Event Triggers / On Selection

Set a external / Run Macro

Create macro and set then

SUB ZOOM

set mysheet=ActiveDocument.ActiveSheet
set sp=mysheet.GetProperties
sp.ZoomFactor = ActiveDocument.Fields("YOUR_FIELD").GetSelectedValues.Item(0).Text
mysheet.SetProperties sp

END SUB

hopkinsc
Valued Contributor

zoom

Thanks Eduardo.

What do i put instead of YOUR FIELDS though? I want to change the zoom on the enire sheet not a specific field. or am i missunderstanding it?

Highlighted
Not applicable

zoom

Hi,

YOUR_FIELD reference a number of zoom that you want.

TABLE_ZOOM:

0.10

0.20

0.30

...

This zoom will be reflected in you sheet.

tanelry
Contributor II

zoom

I have played with this once.

Here is a macro built around a variable called "zoom" (default value: 100%).

The variable has "on input" trigger which runs the macro.

You can change the variable via slider or buttons.

Have fun!


sub zoom
zoomvalue = ActiveDocument.Evaluate("num(zoom)")
set mysheet=ActiveDocument.ActiveSheet
set sp=mysheet.GetProperties
sp.ZoomFactor = zoomvalue
mysheet.SetProperties sp

ActiveDocument.GetApplication.WaitForIdle

ActiveDocument.ActiveSheet.ApplyZoomToAllSheets
end sub


hopkinsc
Valued Contributor

zoom

Thanks Tanel.. I am getting an error when tring to run the macro

the edit module box appears with the error:

Type mismatch: 'sp.ZoomFactor'

Have you got an example of this working you could upload please??



tanelry
Contributor II

zoom

should be working. Try variable value 1 then 1.1 or 0.9.

If still error, it could be local settings issue (decimal sep). Then use integers (100, 110) in variable and make division in macro:

change this line to: sp.ZoomFactor = zoomvalue * 0.01

hopkinsc
Valued Contributor

zoom

Hmm, still not working. It doesnt like 'zoomvalue'....

hopkinsc
Valued Contributor

zoom

Can you confirm that this is right please?

I'm lost now Smiley Sad

sub zoom
zoomvalue = ActiveDocument.Evaluate("num(zoom)")
set mysheet=ActiveDocument.ActiveSheet
set sp=mysheet.GetProperties
sp.ZoomFactor = zoomvalue * 0.01
mysheet.SetProperties sp
ActiveDocument.GetApplication.WaitForIdle
ActiveDocument.ActiveSheet.ApplyZoomToAllSheets
end sub

Community Browser