What a dumb thing. Just defining styles doesn't matter until they are used in the sheet.
If i create a row with rubbish data and apply these styles and then use the template in jsreport then it works.
rashmim00
@rashmim00
Posts made by rashmim00
-
RE: Excel styles for amount and percentage
-
Excel styles for amount and percentage
Hi,
I am trying to put in styles for amounts and percentage columns. Here is playground with the xlsxTemplate I am using which defines styles for amtCol and percCol.https://playground.jsreport.net/w/rashmim00/~suTCrBX
I have tried all s="2" to s="4" and my sheet fails and needs repair.
Pl help me identify the style or create a new xlsxtemplate with good styling,
I have already spend lot of time on it,
pl help,
RashmiStyles.xml extracted by making it rar file etc
-<numFmts count="1"> <numFmt formatCode=""$"#,##0.00" numFmtId="164"/> </numFmts> -<cellStyleXfs count="5"> <xf numFmtId="0" borderId="0" fillId="0" fontId="0"/> <xf numFmtId="0" borderId="0" fillId="0" fontId="2"/> <xf numFmtId="1" borderId="0" fillId="0" fontId="1"/> <xf numFmtId="10" borderId="0" fillId="0" fontId="1"/> <xf numFmtId="164" borderId="0" fillId="0" fontId="1"/> </cellStyleXfs> -<cellXfs count="4"> <xf numFmtId="0" borderId="0" fillId="0" fontId="0" xfId="0"/> <xf numFmtId="0" borderId="0" fillId="0" fontId="2" xfId="1"/> <xf numFmtId="164" borderId="0" fillId="0" fontId="1" xfId="4"/> <xf numFmtId="10" borderId="0" fillId="0" fontId="1" xfId="3"/> </cellXfs> -<cellStyles count="5"> <cellStyle xfId="4" name="AmtCol"/> <cellStyle xfId="0" name="Normal" builtinId="0"/> <cellStyle xfId="2" name="NumberCol"/> <cellStyle xfId="3" name="percCol"/> <cellStyle xfId="1" name="rptHeading"/> </cellStyles>
-
RE: Excel column with dropdown list
My bad. I have to pick a column before which had the title. so c[0] worked.
-
Excel column with dropdown list
Hello,
Is there a different way to put data for a cell which has dropdown list. This doesn't work.{{#xlsxReplace "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row[1].c[1]"}} <c t="inlineStr" s="129"><is><t>{{PRJ_TYPE}}</t></is></c> {{/xlsxReplace}}
Thank you
-
RE: Error because of folder shortId
I have cleaned up the folder by removing folderId from config files
-
RE: Excel report included as email attachment is broken
hmmm.... my theory is that same information provided twice broke it.
Earlier I was sending arrays as part of data and fetching the same in the script too in beforeRender()
and now as it was oversight at my part (twice fetching) and things were broken :-) , I don't send them as part of data and let script fetch it then it worksOR data property doesn't like array.
Template is simple, loops on transactions and add rows.{{xlsxRemove "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row" 1}} {{#each transactions}} {{#xlsxAdd "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row"}} <row> <c t="n" s="{{@root.$removedItem.c.[0].$.s}}"><v>{{PRJ_ID}}</v></c> <c t="inlineStr" s="{{@root.$removedItem.c.[1].$.s}}"><is><t>{{PRJ_NAME}}</t></is></c> <c t="inlineStr" s="{{@root.$removedItem.c.[2].$.s}}"><is><t>{{IMPL_DEPT}}</t></is></c> <c t="inlineStr" s="{{@root.$removedItem.c.[3].$.s}}"><is><t>{{PROJ_MGR}}</t></is></c> <c t="inlineStr" s="{{@root.$removedItem.c.[4].$.s}}"><is><t>{{intRvw}}</t></is></c> <c t="inlineStr" s="{{@root.$removedItem.c.[5].$.s}}"><is><t>{{LAST_PUSH}}</t></is></c> <c t="inlineStr" s="{{@root.$removedItem.c.[6].$.s}}"><is><t>{{map}}</t></is></c> </row> {{/xlsxAdd}} {{/each}}
-
RE: Excel report included as email attachment is broken
Somehow dataObj made the difference..
let dataObj = { 'template': {'shortid' : 'rJlrkXrcE'},'data':{}} //workedlet dataObj = { 'template': {'shortid' : 'rJlrkXrcE'},
'data':{'aaaa': array1, 'bbbb': array2 }
} //broken -
Excel report included as email attachment is broken
Hello,
Pl help me in troubleshooting this issue. I am generating excel using jsReport and attaching it as email attachment but my attachment file is mostly broken on production. The file generated is just 520 bytes and should be 20KB or so. The file in temp folder which I receive from JSReport is 520 bytes.
But on my local or test machine its always a good file.which makes it so hard to debug.flow is : -
- getJSReportFile and store in temp folder
- read the file
- and if no error then send as email attachment.
At no place it goes in catch block. Can you help me in getting jsReport differently... Is my getAttachment() method good. the first thing to look is file recieved from jsreport and there is no error thrown even though its corrupted.I am waiting for promise to resolve so not even rushing the process.
I have this JSReport accessible as scheduled job to send email every 15 days or on demand when a user can export the file anytime they want to see... Individual export of file always work but fails for email attachment.
thanks,
RashmisendReport() { : : getAttachment(attachmentName, dataObj).then(() => { fs.readFile(attachmentName, function (err, data) { if (err) return reject(err); msg = msg.concat('<br/>See Details in the attached Excel sheet.<br/>'); sendMail('Report', msg, '', topeople, {'filename': attachName, 'content': data }); return resolve(); }) //send email with attachment }).catch((err) => { msg = msg.concat('<br/>bad files<br/>'); sendMail('Report', msg, '', topeople); ///never sends this email return resolve(); }); } //dataObj has templateID let dataObj = { 'template': {'shortid' : 'rJlrkXrcE'},'data':{}} let getAttachment = (fileName, dataObj) => { return new Promise((resolve, reject) => { let ws = fs.createWriteStream(fileName); // writeable stream ws.on('error', (err) => {return reject(err);}); ws.on('finish', () => {return resolve(fileName);}); //when write is done resolve as true request.post({ headers: {'Content-Type': 'application/json'}, url: `${jsReportUrl}/api/report`, body: JSON.stringify(dataObj) }).on('error', (err) => {return reject(err);}) //if reporting server is down or so... .pipe(ws); }); }; ==== at jsreport script === function beforeRender(req, res, done) { let searchParams = { 'exportExcel': req.data.exportExcel || 'No' }; req.data.searchParams = searchParams; request.get({ url: `http://localhost:3000/rpt/extIntPrjs`, qs: req.data.searchParams || {}, json: true }, (err, response, body) => { if (err) done(err); req.data.transactions = body['Pushed'] || []; req.data.intTransactions = body['Internal'] || []; done(); }); }
-
RE: Files are outside the folders after 2.6.0 upgrade
HI Jan, thanks for your reply. I removed folderId from the config of all these outside files and then they fall in right folders. Some config files had both entitySet and folderId but not all of them ...so no consistent pattern there.
Answering your questions:
Do you use the default filesystem store? -- Yes
Do the entities go outside the folders also physically there? --- No.
If not, would you be able to compress data folder and email it to me without confidential entities? --- I don't have bad data folder now as after removing folderId from those files they don't spill out anymore. Otherwise version 2.6.0 seems good.
Thanks,
Rashmi -
Files are outside the folders after 2.6.0 upgrade
Hi,
We are seeing some of the files - css and templates spilling out of their folders after we upgraded to 2.6.0 version from 2.3 version. Are we missing some migration step.