会計書式

SpreadJSでは、Excelの会計書式がサポートされます。

標準的な会計書式は、たとえば次のようなものです。_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_) 会計書式内のさまざまな書式パターン: スペースを追加「_」:数値書式内に、文字幅分のスペースを挿入するには、アンダースコア「_」を入力し、使用したい文字をその後に続けて入力します。 文字の繰り返し「*」:数値書式内の次の文字を繰り返し、列幅を埋めるには、数値書式内にアスタリスク「*」を使用します。 桁区切り記号とスケール「,」:数値に3桁の区切り記号を表示します。Spreadでは、数値記号「#」またはゼロで囲まれたコンマが書式に含まれる場合、コンマで3桁が区切られます。桁プレースホルダーに続けてコンマを指定すると、1,000の位で数値が表示されます。たとえば、書式が「#.0,」で、セルに「12,200,000」と入力した場合、「12.200.0」と表示されます。 パーセンテージ「%」:「0.08」を「8%」として、「2.8」を「280%」のように、数値を百分率(パーセント)で表示するには、数値書式内にパーセント記号「%」を使用します。たとえば、「2,2」という数値を百分率で表すだけでなく、万分率で表すこともできます。 桁プレースホルダー「?」:数値内に桁プレースホルダーを追加するには、疑問符「?」を使用します。この桁プレースホルダーは、0(ゼロ)と同じルールに従います。Spreadでは、小数点のどちらの側にも、有効桁以外の0にスペースが挿入されます。
import * as React from 'react'; import * as ReactDOM from 'react-dom'; import GC from '@mescius/spread-sheets'; import '@mescius/spread-sheets-resources-ja'; GC.Spread.Common.CultureManager.culture("ja-jp"); import './styles.css'; import { AppFunc } from './app-func'; // import { App } from './app-class'; // 1. Functional Component sample ReactDOM.render(<AppFunc />, document.getElementById('app')); // 2. Class Component sample // ReactDOM.render(<App />, document.getElementById('app'));
import * as React from 'react'; import { SpreadSheets, Worksheet } from '@mescius/spread-sheets-react'; export function AppFunc() { let spread = null; let autoGenerateColumns = true; const initSpread = (currSpread) => { spread = currSpread; spread.suspendPaint(); let sheet = spread.getSheet(0); sheet.setColumnWidth(0, 150); sheet.setColumnWidth(1, 200); sheet.setColumnWidth(2, 150); sheet.setColumnWidth(3, 150); sheet.getRange(-1, 1, 200, 1).hAlign(1); //set standard accounting formatter initStandardAccountingFormat(sheet); //set repeat chartacters formatter initRepeatCharacters(sheet); //set placeholder formatter initPlaceholder(sheet); //set text formatter initText(sheet); //set thousands separator formatter thousandsSeparator(sheet); // set percentages formatter initPercentages(sheet); //set digital placeholder formatter initDigitalPlaceholder(sheet); spread.resumePaint(); } const initHeaderStyle = (sheet, rowIndex) => { sheet.setRowHeight(rowIndex, 30); sheet.addSpan(rowIndex, 0, 1, 4); sheet.getRange(rowIndex, 0, 1, 4).backColor('grey').foreColor('white').vAlign(1); } const initStandardAccountingFormat = (sheet) => { initHeaderStyle(sheet, 1); sheet.setValue(1, 0, 'Standard Accounting Format : _($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'); sheet.setValue(2, 0, 'Value'); sheet.setValue(3, 0, 12); sheet.setValue(4, 0, -12); sheet.setValue(5, 0, 0); sheet.setValue(6, 0, 'Text'); sheet.setValue(2, 2, 'Formatted Result'); sheet.getRange(3, 2, 4, 1).formatter('_($* #,##0.000_);_($* (#,##0.000);_($* "-"??_);_(@_)'); sheet.setValue(3, 2, 12); sheet.setValue(4, 2, -12); sheet.setValue(5, 2, 0); sheet.setValue(6, 2, 'Text'); } const initRepeatCharacters = (sheet) => { let rowIndex = 8; initHeaderStyle(sheet, rowIndex); sheet.setValue(rowIndex, 0, 'Repeat Characters : *'); rowIndex++; sheet.setValue(rowIndex, 0, 'Value'); sheet.setValue(rowIndex, 1, 'Format'); sheet.setValue(rowIndex, 2, 'Formatted Result'); rowIndex++; sheet.setValue(rowIndex, 0, 'Sign'); sheet.setValue(rowIndex, 1, '@*.'); sheet.setValue(rowIndex, 2, 'Sign'); sheet.setFormatter(rowIndex, 2, '@*.'); rowIndex++; sheet.setValue(rowIndex, 0, 'Sign'); sheet.setValue(rowIndex, 1, '*.@'); sheet.setValue(rowIndex, 2, 'Sign'); sheet.setFormatter(rowIndex, 2, '*.@'); rowIndex++; sheet.setValue(rowIndex, 0, 12.34); sheet.setValue(rowIndex, 1, '$* #.##'); sheet.setValue(rowIndex, 2, 12.34); sheet.setFormatter(rowIndex, 2, '$* #.##'); rowIndex++; sheet.setValue(rowIndex, 0, 12.34); sheet.setValue(rowIndex, 1, '$#.##*_'); sheet.setValue(rowIndex, 2, 12.34); sheet.setFormatter(rowIndex, 2, '$#.##*_'); } const initPlaceholder = (sheet) => { let rowIndex = 15; initHeaderStyle(sheet, rowIndex); sheet.setValue(rowIndex, 0, "Add Space(use the follow char's width as a space ) : _"); rowIndex++; sheet.setValue(rowIndex, 0, 'Value'); sheet.setValue(rowIndex, 1, 'Format'); sheet.setValue(rowIndex, 2, 'Formatted Result'); rowIndex++; sheet.setValue(rowIndex, 0, 'Sign'); sheet.setValue(rowIndex, 1, '_W@'); sheet.setValue(rowIndex, 2, 'Sign'); sheet.setFormatter(rowIndex, 2, '_W@'); rowIndex++; sheet.setValue(rowIndex, 0, 'Sign'); sheet.setValue(rowIndex, 1, '_.@'); sheet.setValue(rowIndex, 2, 'Sign'); sheet.setFormatter(rowIndex, 2, '_.@'); rowIndex++; sheet.setValue(rowIndex, 0, 12); sheet.setValue(rowIndex, 1, '#_W'); sheet.setValue(rowIndex, 2, 12); sheet.setFormatter(rowIndex, 2, '#_W'); rowIndex++; sheet.setValue(rowIndex, 0, 12); sheet.setValue(rowIndex, 1, '#_.'); sheet.setValue(rowIndex, 2, 12); sheet.setFormatter(rowIndex, 2, '#_.'); } const initText = (sheet) => { let rowIndex = 22; initHeaderStyle(sheet, rowIndex); sheet.setValue(rowIndex, 0, "Text/Label : \"\"& \\"); rowIndex++; sheet.setValue(rowIndex, 0, 'Value'); sheet.setValue(rowIndex, 1, 'Format'); sheet.setValue(rowIndex, 2, 'Formatted Result'); rowIndex++; sheet.setValue(rowIndex, 0, 15); sheet.setValue(rowIndex, 1, '#,##0 "Km"'); sheet.setValue(rowIndex, 2, 15); sheet.setFormatter(rowIndex, 2, '#,##0 "Km"'); rowIndex++; sheet.setValue(rowIndex, 0, 2573); sheet.setValue(rowIndex, 1, '#,##0 "Over";#,##0 "Under"'); sheet.setValue(rowIndex, 2, 2573); sheet.setFormatter(rowIndex, 2, '#,##0 "Over";#,##0 "Under"'); rowIndex++; sheet.setValue(rowIndex, 0, -2573); sheet.setValue(rowIndex, 1, '#,##0 "Over";#,##0 "Under"'); sheet.setValue(rowIndex, 2, -2573); sheet.setFormatter(rowIndex, 2, '#,##0 "Over";#,##0 "Under"'); rowIndex++; sheet.setValue(rowIndex, 0, 'ExcelRocks'); sheet.setValue(rowIndex, 1, '\\a@'); sheet.setValue(rowIndex, 2, 'ExcelRocks'); sheet.setFormatter(rowIndex, 2, '\\a@'); } const thousandsSeparator = (sheet) => { let rowIndex = 29; initHeaderStyle(sheet, rowIndex); sheet.setValue(rowIndex, 0, 'Thousands Separator (comma) and Scaling : ,'); rowIndex++; sheet.setValue(rowIndex, 0, 'Value'); sheet.setValue(rowIndex, 1, 'Format'); sheet.setValue(rowIndex, 2, 'Formatted Result'); rowIndex++; sheet.setValue(rowIndex, 0, 12000); sheet.setValue(rowIndex, 1, '#,###'); sheet.setValue(rowIndex, 2, 12000); sheet.setFormatter(rowIndex, 2, '#,###'); rowIndex++; sheet.setValue(rowIndex, 0, 12000000); sheet.setValue(rowIndex, 1, '#,###'); sheet.setValue(rowIndex, 2, 12000000); sheet.setFormatter(rowIndex, 2, '#,###'); rowIndex++; sheet.setValue(rowIndex, 0, 12000); sheet.setValue(rowIndex, 1, '#,'); sheet.setValue(rowIndex, 2, 12000); sheet.setFormatter(rowIndex, 2, '#,'); rowIndex++; sheet.setValue(rowIndex, 0, 12000000); sheet.setValue(rowIndex, 1, '#,,'); sheet.setValue(rowIndex, 2, 12000000); sheet.setFormatter(rowIndex, 2, '#,,'); rowIndex++; sheet.setValue(rowIndex, 0, 12000); sheet.setValue(rowIndex, 1, '#,\\K'); sheet.setValue(rowIndex, 2, 12000); sheet.setFormatter(rowIndex, 2, '#,\\K'); rowIndex++; sheet.setValue(rowIndex, 0, 12000000); sheet.setValue(rowIndex, 1, '#,###,\\K'); sheet.setValue(rowIndex, 2, 12000000); sheet.setFormatter(rowIndex, 2, '#,###,\\K'); } const initPercentages = (sheet) => { let rowIndex = 38; initHeaderStyle(sheet, rowIndex); sheet.setValue(rowIndex, 0, 'Percentages : %'); rowIndex++; sheet.setValue(rowIndex, 0, 'Value'); sheet.setValue(rowIndex, 1, 'Format'); sheet.setValue(rowIndex, 2, 'Formatted Result'); rowIndex++; sheet.setValue(rowIndex, 0, 0.09); sheet.setValue(rowIndex, 1, '0%'); sheet.setValue(rowIndex, 2, 0.09); sheet.setFormatter(rowIndex, 2, '0%'); rowIndex++; sheet.setValue(rowIndex, 0, 0.952); sheet.setValue(rowIndex, 1, '0.0%'); sheet.setValue(rowIndex, 2, 0.952); sheet.setFormatter(rowIndex, 2, '0.0%'); rowIndex++; sheet.setValue(rowIndex, 0, 1); sheet.setValue(rowIndex, 1, '#%'); sheet.setValue(rowIndex, 2, 1); sheet.setFormatter(rowIndex, 2, '#%'); rowIndex++; sheet.setValue(rowIndex, 0, 1); sheet.setValue(rowIndex, 1, '#%%'); sheet.setValue(rowIndex, 2, 1); sheet.setFormatter(rowIndex, 2, '#%%'); } const initDigitalPlaceholder = (sheet) => { let rowIndex = 45; initHeaderStyle(sheet, rowIndex); sheet.setValue(rowIndex, 0, 'Digital Placeholder : #, 0 and ?'); rowIndex++; sheet.setValue(rowIndex, 0, 'Value'); sheet.setValue(rowIndex, 1, 'Format'); sheet.setValue(rowIndex, 2, 'Formatted Result'); rowIndex++; sheet.setValue(rowIndex, 0, 123.456); sheet.setValue(rowIndex, 1, '#.####'); sheet.setValue(rowIndex, 2, 123.456); sheet.setFormatter(rowIndex, 2, '#.####'); rowIndex++; sheet.setValue(rowIndex, 0, 123.456); sheet.setValue(rowIndex, 1, '0.0000'); sheet.setValue(rowIndex, 2, 123.456); sheet.setFormatter(rowIndex, 2, '0.0000'); rowIndex++; sheet.setValue(rowIndex, 0, 123.456); sheet.setValue(rowIndex, 1, '?.????'); sheet.setValue(rowIndex, 2, 123.456); sheet.setFormatter(rowIndex, 2, '?.????'); rowIndex++; sheet.setValue(rowIndex, 0, 123.456); sheet.setValue(rowIndex, 1, '####.###'); sheet.setValue(rowIndex, 2, 123.456); sheet.setFormatter(rowIndex, 2, '#####.###'); rowIndex++; sheet.setValue(rowIndex, 0, 123.456); sheet.setValue(rowIndex, 1, '0000.000'); sheet.setValue(rowIndex, 2, 123.456); sheet.setFormatter(rowIndex, 2, '0000.000'); rowIndex++; sheet.setValue(rowIndex, 0, 123.456); sheet.setValue(rowIndex, 1, '????.???'); sheet.setValue(rowIndex, 2, 123.456); sheet.setFormatter(rowIndex, 2, '????.???'); rowIndex++; rowIndex++; sheet.setValue(rowIndex, 0, 1.1); sheet.setValue(rowIndex, 1, '#.???'); sheet.setValue(rowIndex, 2, 1.1); sheet.setFormatter(rowIndex, 2, '#.???'); rowIndex++; sheet.setValue(rowIndex, 0, 11.12); sheet.setValue(rowIndex, 1, '#.???'); sheet.setValue(rowIndex, 2, 11.12); sheet.setFormatter(rowIndex, 2, '#.???'); rowIndex++; sheet.setValue(rowIndex, 0, 111.123); sheet.setValue(rowIndex, 1, '#.???'); sheet.setValue(rowIndex, 2, 111.123); sheet.setFormatter(rowIndex, 2, '#.???'); } return <div class="sample-tutorial"> <div class="sample-spreadsheets"> <SpreadSheets workbookInitialized={initSpread}> <Worksheet autoGenerateColumns={autoGenerateColumns}> </Worksheet> </SpreadSheets> </div> </div>; }
import * as React from 'react'; import { SpreadSheets, Worksheet } from '@mescius/spread-sheets-react'; const Component = React.Component; export class App extends Component { constructor(props) { super(props); this.spread = null; this.autoGenerateColumns = true; } render() { return <div class="sample-tutorial"> <div class="sample-spreadsheets"> <SpreadSheets workbookInitialized={spread => this.initSpread(spread)}> <Worksheet autoGenerateColumns={this.autoGenerateColumns}> </Worksheet> </SpreadSheets> </div> </div>; } initSpread(spread) { this.spread = spread; spread.suspendPaint(); let sheet = spread.getSheet(0); sheet.setColumnWidth(0, 150); sheet.setColumnWidth(1, 200); sheet.setColumnWidth(2, 150); sheet.setColumnWidth(3, 150); sheet.getRange(-1, 1, 200, 1).hAlign(1); //set standard accounting formatter this.initStandardAccountingFormat(sheet); //set repeat chartacters formatter this.initRepeatCharacters(sheet); //set placeholder formatter this.initPlaceholder(sheet); //set text formatter this.initText(sheet); //set thousands separator formatter this.thousandsSeparator(sheet); // set percentages formatter this.initPercentages(sheet); //set digital placeholder formatter this.initDigitalPlaceholder(sheet); spread.resumePaint(); } inintHeaderStyle(sheet, rowIndex) { sheet.setRowHeight(rowIndex, 30); sheet.addSpan(rowIndex, 0, 1, 4); sheet.getRange(rowIndex, 0, 1, 4).backColor('grey').foreColor('white').vAlign(1); } initStandardAccountingFormat(sheet) { this.inintHeaderStyle(sheet, 1); sheet.setValue(1, 0, 'Standard Accounting Format : _($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'); sheet.setValue(2, 0, 'Value'); sheet.setValue(3, 0, 12); sheet.setValue(4, 0, -12); sheet.setValue(5, 0, 0); sheet.setValue(6, 0, 'Text'); sheet.setValue(2, 2, 'Formatted Result'); sheet.getRange(3, 2, 4, 1).formatter('_($* #,##0.000_);_($* (#,##0.000);_($* "-"??_);_(@_)'); sheet.setValue(3, 2, 12); sheet.setValue(4, 2, -12); sheet.setValue(5, 2, 0); sheet.setValue(6, 2, 'Text'); } initRepeatCharacters(sheet) { let rowIndex = 8; this.inintHeaderStyle(sheet, rowIndex); sheet.setValue(rowIndex, 0, 'Repeat Characters : *'); rowIndex++; sheet.setValue(rowIndex, 0, 'Value'); sheet.setValue(rowIndex, 1, 'Format'); sheet.setValue(rowIndex, 2, 'Formatted Result'); rowIndex++; sheet.setValue(rowIndex, 0, 'Sign'); sheet.setValue(rowIndex, 1, '@*.'); sheet.setValue(rowIndex, 2, 'Sign'); sheet.setFormatter(rowIndex, 2, '@*.'); rowIndex++; sheet.setValue(rowIndex, 0, 'Sign'); sheet.setValue(rowIndex, 1, '*.@'); sheet.setValue(rowIndex, 2, 'Sign'); sheet.setFormatter(rowIndex, 2, '*.@'); rowIndex++; sheet.setValue(rowIndex, 0, 12.34); sheet.setValue(rowIndex, 1, '$* #.##'); sheet.setValue(rowIndex, 2, 12.34); sheet.setFormatter(rowIndex, 2, '$* #.##'); rowIndex++; sheet.setValue(rowIndex, 0, 12.34); sheet.setValue(rowIndex, 1, '$#.##*_'); sheet.setValue(rowIndex, 2, 12.34); sheet.setFormatter(rowIndex, 2, '$#.##*_'); } initPlaceholder(sheet) { let rowIndex = 15; this.inintHeaderStyle(sheet, rowIndex); sheet.setValue(rowIndex, 0, "Add Space(use the follow char's width as a space ) : _"); rowIndex++; sheet.setValue(rowIndex, 0, 'Value'); sheet.setValue(rowIndex, 1, 'Format'); sheet.setValue(rowIndex, 2, 'Formatted Result'); rowIndex++; sheet.setValue(rowIndex, 0, 'Sign'); sheet.setValue(rowIndex, 1, '_W@'); sheet.setValue(rowIndex, 2, 'Sign'); sheet.setFormatter(rowIndex, 2, '_W@'); rowIndex++; sheet.setValue(rowIndex, 0, 'Sign'); sheet.setValue(rowIndex, 1, '_.@'); sheet.setValue(rowIndex, 2, 'Sign'); sheet.setFormatter(rowIndex, 2, '_.@'); rowIndex++; sheet.setValue(rowIndex, 0, 12); sheet.setValue(rowIndex, 1, '#_W'); sheet.setValue(rowIndex, 2, 12); sheet.setFormatter(rowIndex, 2, '#_W'); rowIndex++; sheet.setValue(rowIndex, 0, 12); sheet.setValue(rowIndex, 1, '#_.'); sheet.setValue(rowIndex, 2, 12); sheet.setFormatter(rowIndex, 2, '#_.'); } initText(sheet) { let rowIndex = 22; this.inintHeaderStyle(sheet, rowIndex); sheet.setValue(rowIndex, 0, "Text/Label : \"\"& \\"); rowIndex++; sheet.setValue(rowIndex, 0, 'Value'); sheet.setValue(rowIndex, 1, 'Format'); sheet.setValue(rowIndex, 2, 'Formatted Result'); rowIndex++; sheet.setValue(rowIndex, 0, 15); sheet.setValue(rowIndex, 1, '#,##0 "Km"'); sheet.setValue(rowIndex, 2, 15); sheet.setFormatter(rowIndex, 2, '#,##0 "Km"'); rowIndex++; sheet.setValue(rowIndex, 0, 2573); sheet.setValue(rowIndex, 1, '#,##0 "Over";#,##0 "Under"'); sheet.setValue(rowIndex, 2, 2573); sheet.setFormatter(rowIndex, 2, '#,##0 "Over";#,##0 "Under"'); rowIndex++; sheet.setValue(rowIndex, 0, -2573); sheet.setValue(rowIndex, 1, '#,##0 "Over";#,##0 "Under"'); sheet.setValue(rowIndex, 2, -2573); sheet.setFormatter(rowIndex, 2, '#,##0 "Over";#,##0 "Under"'); rowIndex++; sheet.setValue(rowIndex, 0, 'ExcelRocks'); sheet.setValue(rowIndex, 1, '\\a@'); sheet.setValue(rowIndex, 2, 'ExcelRocks'); sheet.setFormatter(rowIndex, 2, '\\a@'); } thousandsSeparator(sheet) { let rowIndex = 29; this.inintHeaderStyle(sheet, rowIndex); sheet.setValue(rowIndex, 0, 'Thousands Separator (comma) and Scaling : ,'); rowIndex++; sheet.setValue(rowIndex, 0, 'Value'); sheet.setValue(rowIndex, 1, 'Format'); sheet.setValue(rowIndex, 2, 'Formatted Result'); rowIndex++; sheet.setValue(rowIndex, 0, 12000); sheet.setValue(rowIndex, 1, '#,###'); sheet.setValue(rowIndex, 2, 12000); sheet.setFormatter(rowIndex, 2, '#,###'); rowIndex++; sheet.setValue(rowIndex, 0, 12000000); sheet.setValue(rowIndex, 1, '#,###'); sheet.setValue(rowIndex, 2, 12000000); sheet.setFormatter(rowIndex, 2, '#,###'); rowIndex++; sheet.setValue(rowIndex, 0, 12000); sheet.setValue(rowIndex, 1, '#,'); sheet.setValue(rowIndex, 2, 12000); sheet.setFormatter(rowIndex, 2, '#,'); rowIndex++; sheet.setValue(rowIndex, 0, 12000000); sheet.setValue(rowIndex, 1, '#,,'); sheet.setValue(rowIndex, 2, 12000000); sheet.setFormatter(rowIndex, 2, '#,,'); rowIndex++; sheet.setValue(rowIndex, 0, 12000); sheet.setValue(rowIndex, 1, '#,\\K'); sheet.setValue(rowIndex, 2, 12000); sheet.setFormatter(rowIndex, 2, '#,\\K'); rowIndex++; sheet.setValue(rowIndex, 0, 12000000); sheet.setValue(rowIndex, 1, '#,###,\\K'); sheet.setValue(rowIndex, 2, 12000000); sheet.setFormatter(rowIndex, 2, '#,###,\\K'); } initPercentages(sheet) { let rowIndex = 38; this.inintHeaderStyle(sheet, rowIndex); sheet.setValue(rowIndex, 0, 'Percentages : %'); rowIndex++; sheet.setValue(rowIndex, 0, 'Value'); sheet.setValue(rowIndex, 1, 'Format'); sheet.setValue(rowIndex, 2, 'Formatted Result'); rowIndex++; sheet.setValue(rowIndex, 0, 0.09); sheet.setValue(rowIndex, 1, '0%'); sheet.setValue(rowIndex, 2, 0.09); sheet.setFormatter(rowIndex, 2, '0%'); rowIndex++; sheet.setValue(rowIndex, 0, 0.952); sheet.setValue(rowIndex, 1, '0.0%'); sheet.setValue(rowIndex, 2, 0.952); sheet.setFormatter(rowIndex, 2, '0.0%'); rowIndex++; sheet.setValue(rowIndex, 0, 1); sheet.setValue(rowIndex, 1, '#%'); sheet.setValue(rowIndex, 2, 1); sheet.setFormatter(rowIndex, 2, '#%'); rowIndex++; sheet.setValue(rowIndex, 0, 1); sheet.setValue(rowIndex, 1, '#%%'); sheet.setValue(rowIndex, 2, 1); sheet.setFormatter(rowIndex, 2, '#%%'); } initDigitalPlaceholder(sheet) { let rowIndex = 45; this.inintHeaderStyle(sheet, rowIndex); sheet.setValue(rowIndex, 0, 'Digital Placeholder : #, 0 and ?'); rowIndex++; sheet.setValue(rowIndex, 0, 'Value'); sheet.setValue(rowIndex, 1, 'Format'); sheet.setValue(rowIndex, 2, 'Formatted Result'); rowIndex++; sheet.setValue(rowIndex, 0, 123.456); sheet.setValue(rowIndex, 1, '#.####'); sheet.setValue(rowIndex, 2, 123.456); sheet.setFormatter(rowIndex, 2, '#.####'); rowIndex++; sheet.setValue(rowIndex, 0, 123.456); sheet.setValue(rowIndex, 1, '0.0000'); sheet.setValue(rowIndex, 2, 123.456); sheet.setFormatter(rowIndex, 2, '0.0000'); rowIndex++; sheet.setValue(rowIndex, 0, 123.456); sheet.setValue(rowIndex, 1, '?.????'); sheet.setValue(rowIndex, 2, 123.456); sheet.setFormatter(rowIndex, 2, '?.????'); rowIndex++; sheet.setValue(rowIndex, 0, 123.456); sheet.setValue(rowIndex, 1, '####.###'); sheet.setValue(rowIndex, 2, 123.456); sheet.setFormatter(rowIndex, 2, '#####.###'); rowIndex++; sheet.setValue(rowIndex, 0, 123.456); sheet.setValue(rowIndex, 1, '0000.000'); sheet.setValue(rowIndex, 2, 123.456); sheet.setFormatter(rowIndex, 2, '0000.000'); rowIndex++; sheet.setValue(rowIndex, 0, 123.456); sheet.setValue(rowIndex, 1, '????.???'); sheet.setValue(rowIndex, 2, 123.456); sheet.setFormatter(rowIndex, 2, '????.???'); rowIndex++; rowIndex++; sheet.setValue(rowIndex, 0, 1.1); sheet.setValue(rowIndex, 1, '#.???'); sheet.setValue(rowIndex, 2, 1.1); sheet.setFormatter(rowIndex, 2, '#.???'); rowIndex++; sheet.setValue(rowIndex, 0, 11.12); sheet.setValue(rowIndex, 1, '#.???'); sheet.setValue(rowIndex, 2, 11.12); sheet.setFormatter(rowIndex, 2, '#.???'); rowIndex++; sheet.setValue(rowIndex, 0, 111.123); sheet.setValue(rowIndex, 1, '#.???'); sheet.setValue(rowIndex, 2, 111.123); sheet.setFormatter(rowIndex, 2, '#.???'); } }
<!doctype html> <html style="height:100%;font-size:14px;"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" type="text/css" href="$DEMOROOT$/ja/react/node_modules/@mescius/spread-sheets/styles/gc.spread.sheets.excel2013white.css"> <!-- SystemJS --> <script src="$DEMOROOT$/ja/react/node_modules/systemjs/dist/system.src.js"></script> <script src="systemjs.config.js"></script> <script> System.import('$DEMOROOT$/ja/lib/react/license.js').then(function () { System.import('./src/app'); }); </script> </head> <body> <div id="app"></div> </body> </html>
.sample-tutorial { position: relative; height: 100%; overflow: hidden; } .sample-spreadsheets { width: 100%; height: 100%; overflow: hidden; float: left; } .options-container { float: right; width: 280px; padding: 12px; height: 100%; box-sizing: border-box; background: #fbfbfb; overflow: auto; } .option-row { font-size: 14px; padding: 5px; margin-top: 10px; } body { position: absolute; top: 0; bottom: 0; left: 0; right: 0; } #app { height: 100% }
(function (global) { System.config({ transpiler: 'plugin-babel', babelOptions: { es2015: true, react: true }, meta: { '*.css': { loader: 'css' } }, paths: { // paths serve as alias 'npm:': 'node_modules/' }, // map tells the System loader where to look for things map: { '@mescius/spread-sheets': 'npm:@mescius/spread-sheets/index.js', '@mescius/spread-sheets-resources-ja': 'npm:@mescius/spread-sheets-resources-ja/index.js', '@mescius/spread-sheets-react': 'npm:@mescius/spread-sheets-react/index.js', '@grapecity/jsob-test-dependency-package/react-components': 'npm:@grapecity/jsob-test-dependency-package/react-components/index.js', 'react': 'npm:react/umd/react.production.min.js', 'react-dom': 'npm:react-dom/umd/react-dom.production.min.js', 'css': 'npm:systemjs-plugin-css/css.js', 'plugin-babel': 'npm:systemjs-plugin-babel/plugin-babel.js', 'systemjs-babel-build':'npm:systemjs-plugin-babel/systemjs-babel-browser.js' }, // packages tells the System loader how to load when no filename and/or no extension packages: { src: { defaultExtension: 'jsx' }, "node_modules": { defaultExtension: 'js' }, } }); })(this);