Need a special offer?Find out if your project fits.
+

How to wrap column text and set fix width

Answered
Vsev asked on October 18, 2017

Hello
I've seen answers to question like this.
For example:
http://www.flexmonster.com/question/how-to-set-fixed-column-width/
But the question was asked a year ago.
Is it possible via Flexmonster API  to do as in the attached file?
Thanks
 

Attachments:
columns.png

3 answers

Public
Tanya Gryshko Tanya Gryshko Flexmonster October 19, 2017

Hi Vsev!
You can define column sizes via ReportObject as following:
"tableSizes": {
   "columns": [
    {
      "tuple": [],
      "measure": "[Measures].[Reseller Order Count]",
      "width": 182
    }
   ]
}
Does it help?
Regards,
  Tanya

Public
Vsev October 19, 2017

Thanks
I do like this, now

pivot.addJSON(data);
pivot.runQuery(query);
...........
var report = pivot.getReport();
        report.tableSizes = {
            "columns": [
                {
                    "idx": 0,
                    "width": w
                }
            ]
        }
        pivot.setReport(report);

and change css 
 

#fm-pivot-view .fm-grid-layout .fm-cell {
    white-space: normal !important;
}

It works, but I recalculate the value "w" and recalculate height of rows for each new values of "data" and "query".
In version 2.3, this was done automatically.
Maybe it's possible to make wrap and fit of columns without custom recalculate?
Regards,
Vsev

Public
Tanya Gryshko Tanya Gryshko Flexmonster October 20, 2017

Hello, Vsev,
Thanks for the quick reply. The behaviour has changed in version 2.4. Currently, you can achieve the functionality you want only the way you have mentioned. Please let me know in case of other questions.
Regards,
Tanya

Please login or Register to Submit Answer