Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Fit columns to data - Auto fit function?

Hi,

I was wondering is there a autofit function that fits columns to data for reports when the user opens the document.

I use ActiveDocument.ActiveSheet.FitZoomToWindow for the actual report but as users have different resolution so when some users open a document the reports show ##### in the column (particular problem for totals), the user then has to manually expand the column which can be a bit of annoying.

I know that I can expand all columns in enterprise and save the document but when a figure increases fro 5 digits to 7 digits the problem re occurs.

Basically what I am asking: Is there a piece of script that I can run that will auto "fit columns to data" or has anybody got a different solution?

Thanks





3 Replies
johnan
Creator III
Creator III

Hi, i have askt this before. I't would be nice to have a function to this.
I have tested tihs on QV9(odernary way) and the rightclic on to choose "Fit columns to data" doesnt work att all.

Not applicable
Author

I've recently discovered a need for this as well. Does anyone have any ideas?

Not applicable
Author

I use the following macro for OnActivateSheet

sub zoom
ActiveDocument.ActiveSheet.FitZoomToWindow
end sub

It works almost all of the time but I find that when you have quite large documents it doesn't automatically trigger when the document initially opens. To trigger the macro I have to select a different worksheet and then go back to the first worksheet.

If anybody has any suggestions it would be greatly appreciated.