A follow-up - how to show tooltips or the value at the end of bar.
Thanks,
Rashmi
A follow-up - how to show tooltips or the value at the end of bar.
Thanks,
Rashmi
Hi,
I am trying to show a gantt chart in jsreports. The bars are not right. The span should be more. Please take a look at the playground sample - https://playground.jsreport.net/w/rashmim00/n4SNYVK3
Same code if I run on jsfiddle - the bars show properly.
Not sure what's going on.
Thanks for helping me,
Rashmi
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.
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,
Rashmi
Styles.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>
My bad. I have to pick a column before which had the title. so c[0] worked.
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
I have cleaned up the folder by removing folderId from config files
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 works
OR 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}}
Somehow dataObj made the difference..
let dataObj = { 'template': {'shortid' : 'rJlrkXrcE'},'data':{}} //worked
let dataObj = { 'template': {'shortid' : 'rJlrkXrcE'},
'data':{'aaaa': array1, 'bbbb': array2 }
} //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 : -
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,
Rashmi
sendReport() {
:
:
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();
});
}
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
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.
Hi,
On my production box, I see this error -- unable to find entity with shortid xxxxxxx
I 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)
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
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] || {};
Thank you Jan...I will try it sometime next week.
Thanks Jan. I will wait for the update.
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