Its working with few steps suggested in jsreport.net documentation using new server. Please ignore my previous question. Thanks for your help.
Posts made by Kambhammettu
-
RE: How to use jsrender engine for xlsx recipe with client application & webapi and jsreport embedded server.
-
RE: How to use jsrender engine for xlsx recipe with client application & webapi and jsreport embedded server.
I installed jsreport latest server. It started in port 5488 successfully. But may i know how to render report from client using jsreport.axd...embed.js reference??
-
RE: How to use jsrender engine for xlsx recipe with client application & webapi and jsreport embedded server.
Are the following commands enough to install complete jsreport server?
npm install -g jsreport-cli
jsreport init
jsreport start -
RE: How to use jsrender engine for xlsx recipe with client application & webapi and jsreport embedded server.
Hey jan_blaha, Anything found from your side? I am eagerly waiting for the solution. Your suggestions are more helpful to me. Thank you for your valuable suggestions.
-
RE: How to use jsrender engine for xlsx recipe with client application & webapi and jsreport embedded server.
Okay. Sorry for the inconvenience.
2017-05-10T14:19:13.200Z - warn: Error when processing render request Error during rendering report: Missing helper: 'xlsxRemove' Error: Missing helper: 'xlsxRemove'
at new Error (<anonymous>)
at Error.Exception (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\node_modules\handlebars\dist\cjs\handlebars\exception.js:13:41)
at Object.<anonymous> (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\node_modules\handlebars\dist\cjs\handlebars\base.js:66:13)
at Object.eval (eval at <anonymous> (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\node_modules\handlebars\dist\cjs\handlebars\compiler\javascript-compiler.js:171:23), <anonymous>:2:221)
at ret (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\node_modules\handlebars\dist\cjs\handlebars\runtime.js:137:30)
at ret (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\node_modules\handlebars\dist\cjs\handlebars\compiler\compiler.js:422:21)
at module.exports (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\lib\render\handlebarsEngine.js:20:12)
at evalmachine.<anonymous>:1:9
at module.exports (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\lib\render\renderExecution.js:113:8)
at D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\lib\tasks\workersCluster.js:134:49
From previous event:
at Reporter.renderContent (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\lib\reporter.js:183:38)
at Object.reporter.extensionsManager.recipes.push.execute (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\extension\xlsx\lib\xlsx.js:72:29)
at Reporter.executeRecipe (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\lib\reporter.js:165:19)
at dataProvider.startContext.then.then.then.then.then.then.fail.e.message (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\lib\reporter.js:136:21)
2017-05-10T14:19:13.200Z - warn: Error during processing request: http://192.168.2.69/api/report?studio=embed&serverUrl=http%3A%2F%2F192.168.2.69%2Fjsreport.axd%3Furl%3D%2F details: Error during rendering report: Missing helper: 'xlsxRemove' Error: Missing helper: 'xlsxRemove'
at new Error (<anonymous>)
at Error.Exception (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\node_modules\handlebars\dist\cjs\handlebars\exception.js:13:41)
at Object.<anonymous> (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\node_modules\handlebars\dist\cjs\handlebars\base.js:66:13)
at Object.eval (eval at <anonymous> (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\node_modules\handlebars\dist\cjs\handlebars\compiler\javascript-compiler.js:171:23), <anonymous>:2:221)
at ret (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\node_modules\handlebars\dist\cjs\handlebars\runtime.js:137:30)
at ret (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\node_modules\handlebars\dist\cjs\handlebars\compiler\compiler.js:422:21)
at module.exports (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\lib\render\handlebarsEngine.js:20:12)
at evalmachine.<anonymous>:1:9
at module.exports (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\lib\render\renderExecution.js:113:8)
at D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\lib\tasks\workersCluster.js:134:49
From previous event:
at Reporter.renderContent (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\lib\reporter.js:183:38)
at Object.reporter.extensionsManager.recipes.push.execute (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\extension\xlsx\lib\xlsx.js:72:29)
at Reporter.executeRecipe (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\lib\reporter.js:165:19)
at dataProvider.startContext.then.then.then.then.then.then.fail.e.message (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\lib\reporter.js:136:21) -
RE: How to use jsrender engine for xlsx recipe with client application & webapi and jsreport embedded server.
There are two files error.log and reporter.log. Which one i need to post?
-
RE: How to use jsrender engine for xlsx recipe with client application & webapi and jsreport embedded server.
Error occured - Error during rendering report: Missing helper: 'xlsxRemove'
Stack - Error: Missing helper: 'xlsxRemove'
at new Error (<anonymous>)
at Error.Exception (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\node_modules\handlebars\dist\cjs\handlebars\exception.js:13:41)
at Object.<anonymous> (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\node_modules\handlebars\dist\cjs\handlebars\base.js:66:13)
at Object.eval (eval at <anonymous> (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\node_modules\handlebars\dist\cjs\handlebars\compiler\javascript-compiler.js:171:23), <anonymous>:2:221)
at ret (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\node_modules\handlebars\dist\cjs\handlebars\runtime.js:137:30)
at ret (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\node_modules\handlebars\dist\cjs\handlebars\compiler\compiler.js:422:21)
at module.exports (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\lib\render\handlebarsEngine.js:20:12)
at evalmachine.<anonymous>:1:9
at module.exports (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\lib\render\renderExecution.js:113:8)
at D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\lib\tasks\workersCluster.js:134:49
From previous event:
at Reporter.renderContent (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\lib\reporter.js:183:38)
at Object.reporter.extensionsManager.recipes.push.execute (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\extension\xlsx\lib\xlsx.js:72:29)
at Reporter.executeRecipe (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\lib\reporter.js:165:19)
at dataProvider.startContext.then.then.then.then.then.then.fail.e.message (D:\Practice\jsexample\jsexample\App_Data\jsreport-net-embedded\lib\reporter.js:136:21) -
RE: How to use jsrender engine for xlsx recipe with client application & webapi and jsreport embedded server.
No, I didn't see such type of message.
-
RE: How to use jsrender engine for xlsx recipe with client application & webapi and jsreport embedded server.
May I know, Why it is throwing error in missing helper "xlsxRemove" for the following content.
{{xlsxRemove "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row" 1}}
{{#each people}}
{{#xlsxAdd "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row"}}
<row>
<c t="inlineStr" s="{{@root.$removedItem.c.[0].$.s}}"><is><t>{{name}}</t></is></c>
<c t="inlineStr" s="{{@root.$removedItem.c.[1].$.s}}"><is><t>{{gender}}</t></is></c>
<c s="{{@root.$removedItem.c.[2].$.s}}"><v>{{age}}</v></c>
</row>
{{/xlsxAdd}}
{{/each}}{{{xlsxPrint}}}
I am running my embedded server with .Net Framework using jsreport.Embedded dll.
Early response appreciated. -
RE: How to use jsrender engine for xlsx recipe with client application & webapi and jsreport embedded server.
I am just serializing my data as mentioned above and sending as response to client. It works for me with phantom-pdf recipe. The rendering would start from client application.
-
RE: How to use jsrender engine for xlsx recipe with client application & webapi and jsreport embedded server.
I changed template engine from jsrender to handlebars. It says "Error occured - Error during rendering report: Missing helper: 'xlsxRemove'".
I prepared my webapi response like the following,var result = HttpUtility.JavaScriptStringEncode(JsonConvert.SerializeObject(new { content = File.ReadAllText("//somepath..\jsexample\Examples\excelSample.html"), recipe = "xlsx", data = new { dataJson = File.ReadAllText("//somepath..\jsexample\Examples\data.json") }, engine = "handlebars" }));
Thanks for your valuable help in advance.
-
How to use jsrender engine for xlsx recipe with client application & webapi and jsreport embedded server.
I was trying to render xlsx jsreport on client application with jsrender engine. But i was getting "Syntax error Unmatched or missing tag: {{/xlsxAdd}} in template:" error with the following template.
{{xlsxRemove "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row" 1}} {{#each people}} {{#xlsxAdd "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row"}} <row> <c t="inlineStr" s="{{@root.$removedItem.c.[0].$.s}}"><is><t>{{name}}</t></is></c> <c t="inlineStr" s="{{@root.$removedItem.c.[1].$.s}}"><is><t>{{gender}}</t></is></c> <c s="{{@root.$removedItem.c.[2].$.s}}"><v>{{age}}</v></c> </row> {{/xlsxAdd}} {{/each}} {{{xlsxPrint}}}
Early response appreciated.
-
RE: How to generate report with client application, webApi and jsreport embedded server.
Thank you. Its working now.
-
RE: How to generate report with client application, webApi and jsreport embedded server.
The following is the response getting from WebApi. (Yesterday i had a typo mistake. It alerts "Failed to get a Template" not template not defined. Sorry for the inconvenience). My client application has only html & JavaScript pages. and may i know what is the payload? I am calling the render method as follows
jsreport.render($("#placeholder"), data); // Here "data" is the following response. Please have a look. Thanks in advance.
{"content":"\u003chtml\u003e\n \u003chead\u003e\t\n \u003cmeta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /\u003e\n \u003c/head\u003e\n \u003cbody\u003e\n \u003cstyle\u003e\n .clip {\n -webkit-background-clip: padding-box;\n -moz-background-clip: padding;\n -o-background-clip: padding;\n background-clip: padding-box;\n }\n\n .clear {\n /* for use on: after */\n ;\n content: \" \";\n display: block;\n height: 0;\n clear: both;\n visibility: hidden;\n }\n\n body {\n font-size: 14px;\n margin: 0px;\n text-align: center;\n background: #ddd;\n color: #333;\n font-family: Helvetica, Arial, sans-serif;\n padding: 40px 0;\n line-height: 1.5em;\n }\n\n a {\n color: #333;\n text-decoration: underline;\n }\n\n strong { font-weight: bold }\n\n em { font-style: italic }\n\n h1 {\n font-size: 28px;\n font-weight: bold;\n padding: 20px 0 0px;\n }\n\n h2, h3, h4, h5, h6, .title {\n font-size: 16px;\n font-weight: bold;\n padding-bottom: 4px;\n margin-bottom: 4px;\n border-bottom: 1px solid #dddddd;\n }\n\n #invoice {\n position: relative;\n padding: 18px;\n max-width: 840px;\n margin: auto;\n background: #f5f5f5;\n border: 10px solid #fff;\n -webkit-box-shadow: 0 0 1px #888888;\n -moz-box-shadow: 0 0 1px #888888;\n -o-box-shadow: 0 0 1px #888888;\n box-shadow: 0 0 1px #888888;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n #invoice.unpaid:before, #invoice.paid:before {\n position: absolute;\n top: -20px;\n right: 0;\n left: 0;\n height: 10px;\n background: red;\n background: rgba(187, 0, 0, 0.8);\n content: \"\";\n }\n\n #invoice.paid:before {\n background: green;\n background: rgba(122, 185, 0, 0.7);\n }\n\n .this-is {\n padding: 8px 0;\n font-size: 16px;\n font-weight: bold;\n border-top: 1px solid #dddddd;\n border-bottom: 1px solid #dddddd;\n }\n\n #header { padding-bottom: 20px }\n\n .invoice-intro p {\n font-size: 12px;\n font-style: italic;\n line-height: 1.5em;\n padding-bottom: 20px;\n }\n\n .invoice-meta {\n position: relative;\n overflow: hidden;\n text-align: right;\n line-height: 1.5em;\n }\n\n .invoice-meta dt {\n float: left;\n width: 46%;\n clear: both;\n font-weight: bold;\n }\n\n .invoice-meta dd {\n width: 46%;\n float: right;\n text-align: left;\n }\n\n #parties {\n position: relative;\n overflow: hidden;\n }\n\n .invoice-to, .invoice-from, .invoice-status {\n text-align: left;\n padding-bottom: 30px;\n }\n\n .paid .invoice-status strong {\n background: green;\n background: rgba(122, 185, 0, 0.7);\n }\n\n .invoice-items, .invoice-totals {\n text-align: left;\n padding-bottom: 30px;\n }\n\n .invoice-items table, .invoice-totals table {\n width: 100%;\n font-size: 12px;\n }\n\n .invoice-items caption, .invoice-totals caption {\n font-size: 16px;\n font-weight: bold;\n padding-bottom: 4px;\n margin-bottom: 4px;\n border-bottom: 1px solid #dddddd;\n text-align: left;\n }\n\n .invoice-items thead th, .invoice-totals thead th {\n font-weight: bold;\n padding: 6px 0;\n background: #e5e5e5;\n }\n\n .invoice-items thead tc, .invoice-totals thead tc { text-align: center }\n\n .invoice-items thead th:first-of-type, .invoice-totals thead th:first-of-type { padding-left: 8px }\n\n .invoice-items thead th:last-of-type, .invoice-totals thead th:last-of-type {\n text-align: right;\n padding-right: 8px;\n }\n\n .invoice-items tbody tr th, .invoice-totals tbody tr th { padding-left: 8px }\n\n .invoice-items tbody tr td:last-of-type, .invoice-totals tbody tr td:last-of-type {\n text-align: right;\n padding-right: 8px;\n }\n\n .invoice-items tbody tr:nth-of-type(even) th, .invoice-totals tbody tr:nth-of-type(even) th, .invoice-items tbody tr:nth-of-type(even) td, .invoice-totals tbody tr:nth-of-type(even) td { background: #eee }\n\n .invoice-items tbody th, .invoice-totals tbody th, .invoice-items tbody td, .invoice-totals tbody td {\n padding-top: 6px;\n padding-bottom: 6px;\n background: #fff;\n }\n\n .invoice-items tbody td, .invoice-totals tbody td { text-align: center }\n\n .invoice-items tfoot td, .invoice-totals tfoot td {\n text-align: right;\n font-size: 11px;\n font-weight: bold;\n background: #e5e5e5;\n padding: 6px 8px;\n }\n\n .invoice-pay { padding-top: 30px }\n\n .invoice-pay li {\n overflow: hidden;\n padding-top: 12px;\n }\n\n .invoice-pay li:nth-of-type(even) { padding-top: 18px }\n\n .paid .invoice-pay ul li { display: none }\n\n .paid .invoice-pay ul:after {\n display: block;\n font-weight: bold;\n color: #fff;\n padding: 8px;\n background: green;\n background: rgba(122, 185, 0, 0.7);\n content: \"Paid in Full\";\n text-align: right;\n }\n\n .invoice-notes {\n text-align: left;\n padding-bottom: 30px;\n }\n\n .invoice-notes p, .invoice-notes ul, .invoice-notes ol, .invoice-notes dl { padding-bottom: 1em }\n\n .invoice-notes ul li { list-style: inside disc }\n\n .invoice-notes ol li { list-style: inside decimal }\n\n #footer {\n border-top: 1px solid #dddddd;\n font-size: 11px;\n font-weight: bold;\n }\n\n \u003c/style\u003e\n\n\n \u003cdiv id=\"invoice\" class=\"paid\"\u003e\n\t\t\tTest js report\n\n\n \u003c/div\u003e\u003c!-- e: invoice --\u003e\n \u003c/body\u003e\n\u003c/html\u003e","helpers":"function getSubTotal(data) {\n var result = 0;\n data.items.forEach(function (i) { result += i.price * i.quantity; });\n\n return result;\n}\n\nfunction getTotal(data) {\n var result = 0;\n data.items.forEach(function (i) { result += i.price * i.quantity; });\n\n return result * 0.95;\n}\n\nfunction getTaxes(data) {\n var result = 0;\n data.items.forEach(function (i) { result += i.price * i.quantity; });\n\n return result * 0.05;\n}","recipe":"phantom-pdf","engine":"jsrender"}
-
How to generate report with client application, webApi and jsreport embedded server.
I was trying to render jsreport on client application with embed.js reference from "../jsreport.axd?url=/extension/embedding/public/js/embed.js". I was getting all the data for report generation from webapi service, but when it starts rendering the response data it says template not defined. Any help appreciated.