Sheetjs: Problem of style is finally resolved

Created on 3 Mar 2017  路  6Comments  路  Source: SheetJS/sheetjs

full.zip

I prepare a one js file (zipped) including a style

Unzip the file.then include it + include filesaver.js

Then use it as an example above (i only mention the script part) :
index.html :

<!-- header -->
<script src="http://cdn.jsdelivr.net/g/filesaver.js" type="text/javascript"></script>
<script src="full.js" type="text/javascript"></script>


<!-- script -->
<script>
var wb = new Workbook();
var ws = {};
var defaultStyles = {
    font: {
        name: "Arial",
        sz: 11,
        bold: false,
        underline: true,
        color: {rgb: "FF000000"}
    }
};
var headerStyles = {
    font: {
        name: "Arial",
        sz: 15,
        bold: true,
        underline: false,
        color: {rgb: "FF0000FF"}},
    fill: { fgColor: { rgb: "FFFFA500"}},
    border: {
        top: {style: 'medium',
            color: {rgb: "FFFFAA00"}},
        left: {style: 'medium', color: {rgb: "FFFFAA00"}}
    }
};

var sheetName = "Onglet";
var wscols=[];
wscols = [{wch: 20},{wch: 30},{wch: 40},{wch: 50}];
setColsWithToSheet(ws,wscols);
setColWithToSheet(ws,wscols,0,150);
fillCelluleByAddress(wb,ws, sheetName, null, createObjetRowCol(1,1), headerStyles);
fillCelluleByAddress(wb,ws, sheetName, '2', createObjetRowCol(1,2), headerStyles);
fillCelluleByAddress(wb,ws, sheetName, "data", createObjetRowCol(1,3), defaultStyles);
fillCelluleByAddress(wb,ws, sheetName, new Date("2014-02-19T14:30Z"), createObjetRowCol(1,4), defaultStyles);
fillCelluleByAddress(wb,ws, sheetName, '0.5', createObjetRowCol(1,5), defaultStyles);
fillCelluleByAddress(wb,ws, sheetName, new Date("2014-02-19T14:30Z"), createObjetRowCol(1,6), defaultStyles,'DatewithTime');
fillCelluleByAddress(wb,ws, sheetName, 0.5, createObjetRowCol(1,7), defaultStyles,'percent');
setColWithToSheet(ws,wscols,0,10);
setColWithToSheet(ws,wscols,5,40);
var wopts = setWopts();
saveFile(wb,wopts,'Komay.xlsx');
</script>
Style

Most helpful comment

@SheetJSDev please stop commenting same line everywhere :)

All 6 comments

Hi,

Your file works. But could you explain which changes you have done on js-xlsx to make it work please?

Hi,
This code works super well :)
Could you please help us understand what you changed exactly? I see that a lot of the original js-xlsx code has been changed.

Thanks!

We offer this in the Pro compendium. Since companies have paid for the features already, it would be unfair to them if we turned around and made it available as open source. We have a longer comment in a gist.

@SheetJSDev please stop commenting same line everywhere :)

it would be less sickening if it were an honest comment, such as, "styling is available as a paid feature to continue the project", or, "that is in the commercial version of the software", instead of appealing to a false notion of "fairness". how many devs in the github world would read, "turned around and made it open source" as a negative thing lol

hehe @conceptualspace

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jamespan0 picture jamespan0  路  3Comments

upasana-shah picture upasana-shah  路  4Comments

thomasledoux1 picture thomasledoux1  路  3Comments

magtuan picture magtuan  路  3Comments

dullin picture dullin  路  3Comments