By "taking into account the variables that I've pointed out above" I mean there can be x number of market categories and x number of months. This is where I'm stuck.
lcrumb
@lcrumb
Posts made by lcrumb
-
RE: Xlsx Chart
-
Xlsx Chart
Hello,
I've been tasked to create an XLSX report. The image below is the desired result, with the "..." added by me in order to indicate to you that a report can have any number of columns (market category) and rows (month of a year). In this case, there are two market categories (Survey - Energy Field and Survey - Energy Office) and the first 10 months of 2020. But a report could contain more market categories and more (or less) months. And the title of the chart could be anything (in this case it is Energy 2020).
I've looked at the example Xlsx Chart report, and it is somewhat helpful. I can create the basic template, but I would like to know how to generate the report taking into account the variables that I've pointed out above.
-
RE: Async = true and output name
duh, nevermind. That's what the "blobName" field is for. Thanks Jan.
-
RE: Async = true and output name
I see that the subsequent files of the same name are overwritten on the server. What if two different users create two different reports with the same name? If the first user doesn't download theirs in time, the may end up downloading the second users report instead. Is that right? That may have been something you've addressed before, but I'm not sure.
-
RE: Async = true and output name
That works! A mouthful, and maybe not super intuitive, but it works. Thanks Jan.
-
RE: Async = true and output name
Actually, no. The filename indicated in the response header when requesting the attachment is the template name (that is, the name of the template in the jsreport studio). It isn't the name indicated when setting the "blobName" property in the request.
For example, say i've got a template named RevenueReport. I make the request for the report, setting options:
{ "options": { "reports": { "async": true, "blobName": "LastQuarterRevenueReport" } }
This creates a file called "LastQuarterRevenueReport.xlsx" on the server as expected, but when the file is requested with http://myjsereportserver/reports/8X2FZ2iqphQZp7uR/attachment, the file is named "RevenueReport.xlsx", not LastQuarterRevenueReport.xlsx. The response header doesn't say Content-Disposition: attachment; filename="LastQuarterRevenueReport.xlsx", it says Content-Disposition: attachment; filename="RevenueReport.xlsx".
Shouldn't it say Content-Disposition: attachment; filename="LastQuarterRevenueReport.xlsx", as indicated in the "blobName" property?
-
RE: Async = true and output name
I've figured it out. The url returned in the "Location" header is the content route. If I change it to attachment, then the file is returned with the name given in the "blobName" property. Otherwise, the file is named "Content.xlsx". Makes sense.
-
RE: Async = true and output name
It comes back as content.xlsx when I do that.
-
RE: Async = true and output name
So, I noticed https://github.com/jsreport/jsreport-reports/commit/0308ed26c9fd0e93a9aaa68401089b1f87a5f835 and that it is from last year. However, it doesn't seem to be in the most recent version of JSReport. Or if it is, it doesn't seem to work. Is it not supposed to be:
"options":{"reportName": "SomeName.xlsx"}
Is there still no way to set the report name? This is for when async is true, by the way.