Focal Point
[SOLVED]DataGrid loosing number format when applying formatList feature

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4337061196

March 07, 2019, 11:10 AM
MartinY
[SOLVED]DataGrid loosing number format when applying formatList feature
Hi community,

I have an open case, but wondering if maybe someone already have the answer

Using the below code it result in a DataGrid where the first row have a green background which is what I need but the measure (dollars) has lost its format where the thousand separator is not displayed.
If you remove the GRAPH_JS_FINAL section it will result in proper measure display with thousand separator but no green background at first line.

I need both : first row green and number with separator.
I have tried several ways but can't have it to work as requested.
ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
SET HTMLENCODE=ON
SET ARGRAPHENGINE=JSCHART
SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF

GRAPH FILE GGSALES
SUM DOLLARS/P9C AS '$'
BY PRODUCT      AS 'Product'
BY REGION       AS ''

ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET HAXIS 600.0
ON GRAPH SET VAXIS 200.0
ON GRAPH SET LOOKGRAPH DATAGRID
ON GRAPH SET STYLE *
*GRAPH_SCRIPT
setPieDepth(0);
setPieTilt(0);
setDepthRadius(0);
setCurveFitEquationDisplay(false);
setPlace(true);
setUseSeriesShapes(true);
*END
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$

TYPE=DATA, COLUMN=N1, BUCKET=row, $
TYPE=DATA, COLUMN=N2, BUCKET=column, $
TYPE=DATA, COLUMN=N3, BUCKET=measure, $
*GRAPH_SCRIPT
setReportParsingErrors(false);
setSelectionEnableMove(false);
*GRAPH_JS
dataGridProperties: {
   cell: {layout: {width: {rule: 'minSize', value: 100}}}
}
*GRAPH_JS_FINAL
dataGridProperties: {
  cell:{
-*    numberFormat: {mode: 'numeric', thousandSep: ',', grouping: 'K'},
    formatList: [{
      row: 0, color: 'rgb(8, 97, 74)',
      labels: {font: 'bold 10pt Sans-Serif', color: 'white'}
    }]
  }
}
*END
ENDSTYLE
END
-RUN

This message has been edited. Last edited by: MartinY,


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
March 07, 2019, 01:58 PM
MartinY
Fixed

Instead of :
numberFormat: {mode: 'numeric', thousandSep: ',', grouping: 'K'},

It has to be :
labels: { numberFormat: {mode: 'numeric', thousandSep: ',', grouping: 'K'} },


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007