Our state of the art Gantt chart


Post by sanjeeva »

Product: bryntum/gantt-trial@4.2.4

I am trying to export to excel. Budget column's values are not getting exported. I have checked that if I remove "renderer" then it works. Budget Column's definition is as below.

{
            type: "aggregate",
            text: "Budget",
            field: "budget",                     
renderer: function renderer({ record }) { const budget = record.budget; return budget > 0 ? budget.toLocaleString('en-US', {style:'currency', currency:'USD'}) : ""; } }

Post by Maxim Gorkovsky »

Hello.
I cannot reproduce this behavior. Values are both rendered and exported (provided you have this budget field on the project root node too). Please refer to the TableExporter doc here: https://bryntum.com/docs/gantt/api/Grid/util/TableExporter Also I'd recommend to put a breakpoint to the renderer method and see the problem.
You can also try latest 4.3.0 release


Post by sanjeeva »

Yes 4.3.0 version fixed the problem but after exporting to excel if i open with google sheets it does not show values in budget column and if i open with excel then it opens with attached error and shows values in budget column. budget column's definition is as below.

 {
            type: "aggregate",
            text: "Budget",
            field: "budget",                                
renderer: function renderer({ record, isExport }) { const budget = record.budget; if (isExport) {
return budget > 0 ? budget.toLocaleString('en-US', {style:'currency', currency:'USD'}) : ""; }
return budget > 0 ? budget.toLocaleString('en-US', {style:'currency', currency:'USD'}) : ""; } }
Untitled.png
Untitled.png (6.39 KiB) Viewed 776 times

Post by mats »

Can you please attach the dataset you use? I can not reproduce.


Post by sanjeeva »

You can see excel from https://docs.google.com/spreadsheets/d/1tesuh8IMpzhApnnKDzVoWsKO1qjeP9UE/edit?usp=sharing&ouid=105925698409813850199&rtpof=true&sd=true link try to view in google sheet. data is not available in budget column. after downloading try to open with microsoft excel it gives error and data is available in budget column.


Post by mats »

We need to see the input JSON data that you load to the Gantt


Post by sanjeeva »

Please go with attachment for JSON Data used to load the Gantt

Attachments
GanttData.json
(104.19 KiB) Downloaded 49 times

Post by mats »

Reproduced, thanks for providing context! https://github.com/bryntum/support/issues/3608


Post by mats »

Problem is your returning a String from the renderer of a Number type column. Try putting this on your budget column:

exportedType : 'string'

Post by sanjeeva »

Yes it resolved the issue but i am facing one more issue, i am unable to format budget column and unable to use SUM formula on budget column in excel because it treats column as a string
is there anyway to keep its format as a currency?


Post Reply