Get Free Trial
Get Free Trial

Wrong alignment in Excel export

Closed
Javier González asked on November 21, 2019

Hello,
 
We found a strange behaviour when exporting the report to Excel, related to the alignment of the cells.
 
We are following follow these steps:

  1. Connect to the data source (MSAS in our case). Configure some dimensions and measures. The default alignment on the pivot cells is to the right. However when we use the Export option (using the API: pivot.exportTo(“excel”);), in the downloaded Excel file the cells with values are aligned to the left. I checked the formatting options (pivot.getFormat()) just before the download and the textAlign property has the value “right”.
  2. Then we change the cell format options (with pivot.toolbar.formatCellsHandler();). By default “right” alignment is selected. If we change it to “left”, apply, and then change it to “right” again, the pivot table looks (logically) the same as in the beginning, but if we then export it to Excel, the cells are now correctly aligned to the right.

It looks like the first time it doesn’t export the “right” alignment to Excel, and it only starts applying the settings after you change them. Actually, if we open the formatting menu, change any other option (not the alignment) it applies correctly on the pivot and also on the downloaded Excel, but the Excel cells are still aligned to the left.
 
Maybe I’m doing something wrong or missing some parameter/configuration? Because I’m trying to reproduce this issue with the examples you have on your web and I am unable to.
 
Thank you very much for your help.
 
 

3 answers

Public
Javier González November 21, 2019

Just in case it helps; I just noticed that by default the .css that is being used by the cells comes from flexmonster.min.css, however after changing it on the formatting options menu (alignment: left and then back to aligment: right), that one is overwritten, and the text-align style is then applied individually to each element (cell). Maybe this has some relation?

I attached a couple of images to show this.

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster November 21, 2019

Hello, Javier,
 
Thank you for your question.
 
We have fixed a similar problem not a long time ago.
Our team kindly recommends making sure you are using the latest version of the product (2.7.19).
 
You can find out how to update your component by following the link below: https://www.flexmonster.com/doc/updating-to-the-latest-version/.
 
Please, let us know if it has helped.
Feel free to contact us in case any additional questions occur.
 
Best Regards,
Illia

Public
Javier González November 21, 2019

Ok, we are not going to update our version yet. We will do so in the future, and test then if this issue is still happening to us. If that’s case I’ll update this post.
 
Thank you Illia.

This question is now closed