If you select your shared file, at the bottom page you should see "Properties" column. Inside Scripts if you set to global, would not work?
Haritz Lopez
@Haritz Lopez
Posts made by Haritz Lopez
-
RE: How to use shared js file for multiple templates
-
RE: 502 Bad Gateway .NET long data XLSX
I have installed localy and I am making some new tests. How could I change the xlsx.maxRows and xlsx.bufferSize? I am getting an error if the json is too big. with 15000 rows now works but with 20000 no.
preview error Got not ok response, status: 500 Error: Got not ok response, status: 500 at http://localhost:5488/studio/assets/client.a5efe5637ea659b2401f.js:41:78261 at m (http://localhost:5488/studio/assets/client.a5efe5637ea659b2401f.js:311:73091) at Generator._invoke (http://localhost:5488/studio/assets/client.a5efe5637ea659b2401f.js:311:72844) at forEach.e.<computed> [as next] (http://localhost:5488/studio/assets/client.a5efe5637ea659b2401f.js:311:73271) at i (http://localhost:5488/studio/assets/client.a5efe5637ea659b2401f.js:3:368084) at http://localhost:5488/studio/assets/client.a5efe5637ea659b2401f.js:3:368181
I changed already the timeout value.
{ "httpPort": 5488, "store": { "provider": "fs" }, "blobStorage": { "provider": "fs" }, "logger": { "console": { "transport": "console", "level": "debug" }, "file": { "transport": "file", "level": "info", "filename": "logs/reporter.log" }, "error": { "transport": "file", "level": "error", "filename": "logs/error.log" } }, "trustUserCode": false, "reportTimeout": 60000000, "workers": { "numberOfWorkers": 2 }, "extensions": { "authentication": { "cookieSession": {}, "admin": { "username": "admin", "password": "password" }, "enabled": false } } }
-
502 Bad Gateway .NET long data XLSX
Hello everyone,
I am trying to generate a XLSX file but I am getting the error of the title only when the data is too long (I do not know what's too long for jsreport). Let me explain. With some data I am able to generate it but with other I am not. Also it takes a while to generate it. The longest json might have around 15000 lines.
jsreport.Client.JsReportException: 'Unable to render template. <html> <head><title>502 Bad Gateway</title></head> <body> <center><h1>502 Bad Gateway</h1></center> <hr><center>nginx/1.18.0</center> </body> </html> '
In the profile I also get this:
Error: Report cancelled by the client or closed network
var reportRequest = await rs.RenderAsync(new RenderRequest() { Template = new Template() { Recipe = Recipe.Xlsx, Engine = Engine.Handlebars, Name = "/Informe/soldata", }, Options = new RenderOptions { Timeout = 1600000, Debug = new DebugOptions { LogsToResponseHeader = false }, }, Data = mainObject, });
Thank you in advance.
-
It is possible to make totals divided by group xlsx?
Hello everyone,
It might not be easy to understand with the title what I am asking so I am going to try to explain as well as I can here.
Lets say I have some data(name | deparment | cost):
Jhon | 01 | 10 Mike | 01 | 5 Stan | 02 | 2 Alice | 02 | 1
What I would like to do is this:
Jhon 01 10 Mike 01 5 * Totals 01 15 Stan 02 2 Alice 02 1 * Totals 02 3 * Totals 18
I want to have subtotals for each deparment and also the totals for the whole data. All this I want ot do is XLSX and the data would be dynamic, I will not know how much data I am adding to the file.
Is this possible to do directly with jsreport or should I first, somehow, prepare the data and give everything "done" to jsreport?
Thank you.
-
RE: Error total row in xlsx
For anyone wondering, I was able to solve the problem removing the #if inside the template. Yet I do not understand the reason behind that but removing it solved my issue about numbers being saved as text.
-
RE: Error total row in xlsx
In my playground you can see that I have a template, a xlsx. Inside that, I have a #each datos to iterate the data from the array of jsons. Almost all values are numbers, except the first two, separated by dots which are created with JsonConvert.SerializeObject. Then I use jsreport.Client and jsreport.Types.
The issue is, when I open the excel, the numbers are not numbers and I can not make any formula or whatever I want. I do not need to add formulas in the xlsx but maybe someone would need at any moment.
-
RE: Error total row in xlsx
Thank you works fine but the issue I am facing now is with the json data. Is there any way to do the same with that data?
I updated a little bit my demo. If the number is an integer and you download the file, you can see that it says the number is saved as text. Also, if I try to do a SUM() using the ones that do not show that error, still does not work.
Thank you again.
-
RE: Error total row in xlsx
I am facing the error that number is saved as text and with that I can not make sums and so on. How can I fix that issue? Is happening with the totals and the data of the #each.
Thanks.
-
RE: Error total row in xlsx
Thank you.
I have done that and the method returns 9. I can not write in that line. If I try, the data is not showing and the excel says that there was an error but if to that return I add 1, +1, it works fine. I am trying to understand why it returns 9 when I only have 1 persons data. When you run it the rows between 5 and 9 are empty but it's imposible to write there without getting an error.
Thank you again.