for my pages I've hardcoded the margins on the Chrome-PDF setup in the designer so they're independent of the body. Pagebreaks in chromium seem to be a bit weird (and will continue to have some annoying little niggles until the LayoutNG project is complete and released so jsReport can use it)
Posts made by OffBeatMammal
-
RE: Header ignored on all except page one
-
RE: Header ignored on all except page one
oh, sorry ... misunderstood the problem (my problem was with content inside the page not headers) ... do you have margins setup for the page so it knows where the header/footer should be. Is this Chrome-PDF or Phantom-PDF?
-
RE: Header ignored on all except page one
it looks like the problem I had a while back ... having a fixed position to the class ( https://forum.jsreport.net/topic/1355/one-block-of-text-repeats/2 ) was my issue
-
RE: chrome-pdf times out, phantom-pdf renders
playing around some more, it looks like the problem may be Sophos anti virus (as well as not liking the .exe Windows runtime, it looks like it might be blocking headless chrome according to some other reports) ... sigh. Time to see if I can persuade out security folks to allow it somehow...!
-
RE: trim redundant file extension
that actually puts the word
.null
at the end (replacing with''
just puts.
)inline;filename="Campaign Metrics XXXX l Q3 YYYY - All Segments.pdf".null
-
trim redundant file extension
In my script I am setting the whole of the file name based on some report parameters:
function afterRender(req, res) { res.meta.reportName = ('"Campaign Metrics ' + req.data.clca[0]["campaign"] + " - " + req.data.clca[0]["seg"] + '.pdf"') res.meta.contentType = 'application/pdf' }
but, jsReport is being helpful and adding an extra .pdf
inline;filename="Campaign Metrics XXXX l Q3 YYYY - All Segments.pdf".pdf
doesn't seem to be causing any real problems, but is there anything I should be doing to stop it doing this (or would it just be a low priority feature request to not append file extension if quoted?)
-
RE: Sophos flagging jsreport-win.zip as "Mal/BredoZp-B" and nuking it
thanks! Have reported to Sophos, though they don't seem overly inclined to do anything about it (shame I'm stuck with it on Corp machines)
-
Sophos flagging jsreport-win.zip as "Mal/BredoZp-B" and nuking it
My assumption is that jsReport isn't trying to sneakily infect us, but might be good to double check the downloable zip to see why it's being flagged :(
Double checked against some other engines and comes up clean
-
RE: common template helpers
d'oh ... on the subject of "..made a mistake" ... I'd created the asset with the helpers in, and referenced it as
{#asset common-handlers.js @encoding=utf8}
but ... I had a typo in the filename which was why it wasn't finding it. leaving this here so anyone else trying gets to search and learn from my stupidity ;)
-
common template helpers
Similar to this method of using an asset to store common script, is there a way to define and manage a common set of helper functions that you can include to avoid cut'n'paste (and having to edit three different places when you realized you'd made a mistake!)
-
RE: Formatting in XLSX doc
done, thanks Jan. very low priority (but might be applicable to the docx and pptx functionality as well over time) - https://github.com/jsreport/jsreport/issues/664
-
RE: JSReport on Azure Web App
is there a list of what is blocked/unavailable? https://github.com/kblok/puppeteer-sharp get's puppeteer working (so headless Chrome) but I'm guessing there's others ... I'd love to be able to have jsReport running in our tenant but with minimal footprint (I'm assuming we can run it as a webapp cheaper than having a VM to host it)
-
xlsxAddImage properties
when using the xlsxAddImage helper, is there a way to specify properties for the image- specifically I'd like to be able to set the "Move but don't size with cells" (over-riding the default "Move and size with cells" option), but also controlling the size/scaling would be handy
-
xlsxAddImage base64 image
for a ChromePDF report, I can add a dynamic Base64 image using:<img class="logo" src="data:image/png;base64,{{image}}">
However, for an xlsx report trying{{#xlsxAddImage "Client-logo" "sheet1.xml" 0 0 1 1}} {#image {{image}} @encoding=base64} {{/xlsxAddImage}}
does not insert my image into the cellthe problem was the #image... this works:
{ {{image}} @encoding=base64}
-
Formatting in XLSX doc
It's probably a Monaco thing, so outside the realm of jsReport, but I've noticed that while the formatting for (eg) Chrome-PDF (HTML) reports works as I expect with nesting/indenting etc, the XLSX 'format document' option compacts things in a weird way...
If I give it something like the sample below:
... {{/xlsxAdd}} {{#xlsxAddImage "Client-logo" "sheet1.xml" 0 0 1 1}} {#asset {{tt}}.png @encoding=base64} {{/xlsxAddImage}} {{#xlsxAddImage "our-logo" "sheet1.xml" pl0 0 pl1 1}} {#asset our-logo.png @encoding=base64} {{/xlsxAddImage}} {{#xlsxAdd "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row"}} ...
it squishes it down to:
{{/xlsxAdd}} {{#xlsxAddImage "Client-logo" "sheet1.xml" 0 0 1 1}} {#asset {{tt}}.png @encoding=base64} {{/xlsxAddImage}} {{#xlsxAddImage "AP-logo" "sheet1.xml" pl0 0 pl1 1}} {#asset Audience-Precision-logo.png @encoding=base64} {{/xlsxAddImage}} {{#xlsxAdd "xl/worksheets/sheet1.xml" "worksheet.sheetData[0].row"}}
not a huge issue, just makes it a little harder to read...
Is it worth opening a bug, or is this out of jsReport control?
-
RE: docx/pptx - very different to (eg) xlsx and chrome-pdf
thanks for the detailed feedback - as I'd worked with OpenXML back in the day I like the way the xlsx recipe lets me get hands-on for some things, but also lets me re-use template items, but ... I also like the idea of moving more to a 'designer' view of things using handlebars within the Word doc (or PowerPoint or Spreadsheet) to achieve the same results without having to know as much about the internals. Will this new model also allow more than just handlebars (so if we want to do some logic within the document based in the data - ie use javascript or VBA to handle something more complex than just what handlebars will let us do) - if not, that's where the current xlsx model would be good to let us extend further.
I'd not tried using the docx as a linked asset, that would certainly save me a few steps as I experiment!
If my current use-case of a table with variable rows supportable, or should I drop in a feature request to github for that?
-
docx/pptx - very different to (eg) xlsx and chrome-pdf
Is there any reason that the docx/pptx recipes are quite different to the xlsx and others in the way it works? Not in a rush to use them, but was trying to understand if we'll end up with a similar model where we can edit the script within Studio and use that to update a bare bones template (more so for docx than powerpoint)?
I spent some time today trying to build a template for a table in Word which will have a variable number of columns as well as rows and while this has been fairly easy to achieve in chrome-pdf (including switching from portrait to landscape if the number of columns exceeds a certain threshold) and loading the data into an xlsx sheet ... I've got nowhere productive with the docx setup (and having to edit the template in Word and upload has made it more time consuming!)
-
RE: Does it re-run script multiple times?
what would life be without interesting quirks :)
knowing the code workaround is good, and both the proposed solutions make sense (adding the options in v2 defaulting to false would surface the solution, and then in v3 flipping the default for new templates - especially surfaced with the checkbox in Studio - would avoid confusing people with the change) -
RE: Does it re-run script multiple times?
thanks! seems a little odd it would do that (especially with the header/foot checkmark turned off), but the logic speeds up my chrome-pdf reports considerably (now almost as quick as generating the Excel ones, which are really quick!)