Skip to content

Commit

Permalink
feat(datautil): big Heading feature has been added
Browse files Browse the repository at this point in the history
  • Loading branch information
susanta96 committed Jun 14, 2023
1 parent e1e75b2 commit 355ad43
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dist/ExcelPlugin/utils/DataUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,17 @@ var excelSheetFromDataSet = function excelSheetFromDataSet(dataSet, bigHeading)
}
rowCount += ySteps;
if (bigHeading !== null && bigHeading !== void 0 && bigHeading.title) {
var mergedRange = {
s: {
c: xSteps,
r: 0
},
e: {
c: dataSetItem.columns.length - 1,
r: 0
}
};
ws['!merges'] = [mergedRange];
var cellRef = xlsx_js_style_1.utils.encode_cell({
c: xSteps,
r: rowCount
Expand Down
2 changes: 2 additions & 0 deletions src-js/ExcelPlugin/utils/DataUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ const excelSheetFromDataSet = (dataSet, bigHeading) => {
}
rowCount += ySteps;
if (bigHeading?.title) {
let mergedRange = { s: { c: xSteps, r: 0 }, e: { c: dataSetItem.columns.length - 1, r: 0 } };
ws['!merges'] = [mergedRange];
let cellRef = xlsx_js_style_1.utils.encode_cell({ c: xSteps, r: rowCount });
getHeaderCell(bigHeading, cellRef, ws);
rowCount += 1;
Expand Down
2 changes: 2 additions & 0 deletions src/ExcelPlugin/utils/DataUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ const excelSheetFromDataSet = (dataSet: ExcelSheetData[], bigHeading?: ExcelShee
rowCount += ySteps;

if(bigHeading?.title) {
let mergedRange: Range = { s: { c: xSteps, r: 0 }, e: { c: dataSetItem.columns.length - 1, r: 0 } };
ws['!merges'] = [mergedRange];
let cellRef = utils.encode_cell({ c: xSteps, r: rowCount });
getHeaderCell(bigHeading, cellRef, ws);
rowCount += 1;
Expand Down

0 comments on commit 355ad43

Please sign in to comment.