
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Auto "Fit Columns to Data" or with a extra button
There is a possibility in Qlikview to "Fit Columns to Data" from a straight table. But this need to be done by a rightclick or trough the menu. Now i want to make my qlikview document a lot more userfriendly. And this is liek this not/les the case. Because my table has always different results and different width's for the cell's text this "Fit Columns to Data" need to be pressed a lot.
Is there a way that this is automated? Trough a function from qlikview itself or a macro?
If this aint possible... can this be done by adding a button to do this?
Iv'e read a lot topics about this, but they all dont do the ting asked.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
You can use the functionality available under layout Tab "Size to Data"
Regards,
Kaushik Solanki

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This does not seem to work, at least not when it has been resized once. even when i uncheck it, save, check it and save again. mayby it need to be changed to "Always Size to Data"


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It seems there is none method for doing this directly. But you could set the column width static with a fix value or by reference to any value - see for such examples APIGuide.qvw.
dim w(3)
w(1)=100
w(2)=150
w(3)=200
set chart = ActiveDocument.Sheets("Main").CreateStraightTable
chart.AddDimension "ProductType"
chart.AddExpression "sum(Amount)"
chart.AddExpression "count(Product)"
chart.SetPixWidths 0,w
chart.EqualPixWidths 1
Brute force is to read every cell-value for each column and count the char to receive the max-value and set herewith the column width (not really recommended but possible).
- Marcus

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a pivot table, the script:
chart.SetPixWidths 0,w
chart.EqualPixWidths 1
doesn't work
Thanks


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SetPixWidths is for straight tables and SetPixWidth without "s" for pivot tables.
- Marcus

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes! It's ok!
Thank you very much Marcus

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Marcus,
I have a slightly different problem.. I am storing a QVD into an excel file and the width of one column is not adjusting to its longest data string. This is causing incorrect output in the excel file.
Is there a way around this?
Regards,
a
