I think I found the issue.
Missing resources not copied when the solution is generated (Do not copy / Copy if newest) if Visual Studio.
The error isn't explicit but after a bit of research, I get it.
Best regards,
Stéphane
I think I found the issue.
Missing resources not copied when the solution is generated (Do not copy / Copy if newest) if Visual Studio.
The error isn't explicit but after a bit of research, I get it.
Best regards,
Stéphane
Hi there,
We encounter a weird issue with the PDF report generation. Everything works fine on windows but we try to setup or production server to test in real condition. The PDF report are generated but the CSS doesn't seem to work correctly, we mainly have raw HTML and assets doesn't seems to work.
In the logs, we get this error :
2018-05-28T11:13:17.162Z - warn: ReferenceError: Can't find variable: $ timestamp=Mon May 28 2018 13:13:17 GMT+0200 (CEST), requestId=1
2018-05-28T11:13:17.162Z - warn: file:///%2Ftmp%2F1e6d4ac0-6268-11e8-b351-8d316307a3fahtml.html : 217 timestamp=Mon May 28 2018 13:13:17 GMT+0200 (CEST), requestId=1
We try to force the tempDirectory, not to avail.
Do you have any idea of what cause this issue and how to solve it?
Best regards,
Stéphane
Hi,
I'm currently working on a new template which use the text recipe to generate a csv file. (.Net core 2)
I've checked online and on the Text recipe page (https://jsreport.net/learn/text) which parameters I have to use but the names to use aren't present.
I'm guessing that I should do something like this :
{
"recipe": "text",
"engine": "handlebars",
"text": {
"content-type": "text/csv",
"file-extension": "csv",
"content-disposition": "inline"
}
}
Moreover, I use accented characters in my csv file, how can I specify an utf8 encoding?
If you find some spare time, it would be great to reference a full configuration file with all possible options, as for now information is scatterred here and there and some are missing. (Expanding this page would be awesome : https://jsreport.net/learn/configuration)
Thank you in advance,
Stéphane
Well, this is rather strange.
Here is my header :
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body>
<style>
{#asset CallRatio header.css @encoding=utf8}
</style>
<div class="header-box">
<table cellpadding="0" cellspacing="0" class="header">
<tr class="logos">
<td><img src="../jsreport/data/assets/General%20Kiwix.png/content.png" /></td>
<td>{{Report.Name}}</td>
<td><img src="{#asset General Kiwix.png @encoding=dataURI}" /></td>
</tr>
</table>
</div>
</body>
</html>
The first image render correctly in the pdf, the second one doesn't appear. I guess it's a path issue but I can't figure how to fix it. Any lead? (config / assets / publicAccessEnabled is at true and the files exists, of course)
Thanks,
Stéphane
Hi,
Thanks, I missed this issue article and fix, I'll check it out.
Thanks again for your quick answer. :-)
Stéphane
Hello,
I'm trying to insert image in jsreport (PDF) with the following header template :
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body>
<style>
{#asset CallRatio header.css @encoding=utf8}
</style>
<div class="header-box">
<table cellpadding="0" cellspacing="0" class="header">
<tr class="logos">
<td><img src="{#asset General Thelis.png @encoding=dataURI}" /></td>
<td>{{Report.Name}}</td>
<td><img src="{#asset General Kiwix.png @encoding=dataURI}" /></td>
</tr>
</table>
</div>
</body>
</html>
But the images aren't displayed in the PDF, no error in logs, so I'm a bit lost here.
The images appear in the generated html header (%TEMP%/jsreport) but when phantomjs generate the pdf, no image are visible.
Any idea how to debug/solve this?
Thanks,
Stéphane
Thank you very much, I missed this config option. Performance of jsreport are really good btw.
Have a good day,
Stéphane
Hi,
I've found an bug with .net RenderByNameAsync method :
You define classes with Uppercase letters for properties like :
public class Data
{
public List<SubData> DataList { get; set; }
}
public class SubData
{
public string Message { get; set; }
}
Then you pass an object create from this class to RenderByNameAsync like this :
//d is an instanciated Data object.
var results = service.RenderByNameAsync ("TplName", d);
Template replacement will recognize DataList member as datalist (lowercase) but it won't recognize Message. To solve the issue, you should lowercase all members of the SubData class. Or you can convert all to Json which will solve the issue.
This is rather annoying when you use naming conventions and use uppercase in properties' names.
Regards,
Stéphane
Hi,
Thanks for your quick answer. I've made a test with 100.000 records and I received an error : "Unable to render template. request entity too large".
Is there a limit of size of the data we pass to the Render method?
Stéphane
Thanks, logs are working now.
And I finally get everything working, I put the initialization in Startup.cs, as a WebServer, and it seems to work without issue.