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.
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.
-
Error because of folder shortId
Hi,
On my production box, I see this error -- unable to find entity with shortid xxxxxxxI found four templates with the same folder shortid --- Is that cause of error. How to decipher the error and resolve the error. Pl see the attached screenshot.
![alt text]( image url)
-
RE: More on slow performance of JsReports 2.2
and mergeWholeDocuments, doesn't work on Landscape documents.
I am merging 2 templates, one is for sample watermark and one is the footer. Footer file is not working as it doesn't like pages[pageIndex].items[0] and is undefined.There is an improvement if I just include one template to add sample watermark.
4 page document - earlier it took 1171ms and now is 988ms
18 page document - earlier it took 1754ms and now is 1409ms.Thanks,
Rashmi -
RE: More on slow performance of JsReports 2.2
Hi Jan, On using the beta, the footer fails to identify items.
and to set the flag through API, is it mergeWholeDocuments.2018-10-29T15:39:50.447Z - warn: Error when processing render request Error while executing templating engine. Cannot read property 'items' of undefined. Error on line 72:34.
70 |
71 | Handlebars.registerHelper('if_docName', function(pages, pidx, opts) {72 | let currPgItem = pages[pidx].items[0] || {};
-
RE: More on slow performance of JsReports 2.2
Thank you Jan...I will try it sometime next week.
-
RE: More on slow performance of JsReports 2.2
Thanks Jan. I will wait for the update.
-
RE: Formatting Excel Cell
I have a similar problem. I want to style the header column and created a style in the style groups of excel. so the styles.xml under xl directory has a cellstyle.
<cellStyle name="myColHeading" xfId="1"/>
and then I am trying to use that in my template
<c s="myColHeading" t="inlineStr"><is><t>{{this}}</t></is></c>
What am I doing wrong. The style doesn't show?
Thanks,
Rashmi -
RE: More on slow performance of JsReports 2.2
I want to add here that PDF-Utils are the cause of slowness. I had 2 pdf-merge operations - one to put sample watermark and other for the footer.
Here are some stats: for 3 page document, 2 pdf-merge makes it 4 times longer and for 18 page document, its 10 times longer.For 3-page document with no PDFOperations - 588ms
with sample watermark 1171ms
with footer and sample 2443msand for 18-page document with no PDF Operations 940ms
with sample watermark 1754ms
with footer and sample watermark 9780msMaybe my footer file is not so efficient:
</style> <footer> {{#with $pdf}} {{#each pages}} {{#if @first}} <!--write one time only --> <table width="83%" style="margin: 10px 67px;"> <tr> <td align="center"> {{group.name}}{{group.more}} </td> {{#if_gt ../pages.length 1}} <!-- page numbers if more than 1 page--> <td align="right" width="5%"> {{../pageNumber}}/{{../pages.length}} </td> {{/if_gt}} </tr> </table> {{/if}} {{/each}} {{/with}} </footer>
-
More on slow performance of JsReports 2.2
Hello,
I read about the --keepAlive option for the command line but I am looking for an option at nodejs level. I have small application with no cloud setup and IIS server is like a firewall or proxy and I have not registered my jsreport application under it.I don't know if my jsReport instance is sleeping so how to find out about it is my first Question?
I don't think the slowness is just for the first time, it takes a single page report around 2s and 3-page report around 4s. This is how I am starting jsReport, Pl suggest how to add --keepAlive option.let startJsreport = (server, app) => { /// define the jsreport middleware let jsreport = require('jsreport')({ extensions: { express: { app: reportingApp, server: server }, }, appPath: "/reporting" }); jsreport.init() .then(() => { console.log(`JSReport instance ${process.pid} started correctly.`); }).catch((e) => { console.error(e); }); app.use('/reporting', accessMiddleware, (req, res, next) => { /// user should login to the server to access the admin console },reportingApp); };
Thank you,
Rashmi -
RE: Styling in footer of chrome-pdf
I found Jan that <span> with style or class for text-align doesn't work but if I change to <div align="center"> or table td align="center" then it aligns.
In short, text-align bad, align good.Thank you.