Display footer page in a large table
-
I have a table with many rows. it occupies more than one page.
How can I put a footer on each page?Here I show my example:
https://playground.jsreport.net/w/gastonmunoz/1ByQXqmL
Thanks.
-
hi! to do header/footer there two ways, one is using chrome header/footer feature and the other is using pdf-utils
i see that you tried both ways, i will show you how to do it using chrome header/footer, you can see it here https://playground.jsreport.net/w/anon/taqs~AVO
if you need more complex layout for the header/footer then you need to use pdf-utils, which has examples in the docs
-
FYI: in your example, you were missing to add margin top and bottom to the pdf, with that it has space to print the header/footer in each page
-
Nice, and can I invoke helpers in the footer?
Can I show or hide a footer element by pageIndex?
-
Without pdf utils, because in jsreport.core does not exist the Chrome Pdf-Utils in Chrome class:
https://github.com/jsreport/jsreport-dotnet-types/blob/master/jsreport.Types/Request/Chrome.cs
-
Nice, and can I invoke helpers in the footer?
yes, both in chrome header/footer and with pdf-utils, in chrome header/footer you define the helpers in the main template.
Can I show or hide a footer element by pageIndex?
yes, but you will need your footer to be based on pdf-utils because chrome header/footer does not support such dynamic content generation. with pdf-utils you will need to do a condition and just generate empty content at specific pageIndex
-
But in jsreport.dotnet, how can I use pdf Utils?
My code is:ILocalUtilityReportingService rs = new LocalReporting() .KillRunningJsReportProcesses() .UseBinary(JsReportBinary.GetBinary()) .Configure(cfg => cfg.AllowedLocalFilesAccess().BaseUrlAsWorkingDirectory()) .AsUtility() .Create(); jsreport.Types.Report report = rs.RenderAsync(new RenderRequest { Template = new Template { Chrome = new Chrome() { Landscape = false, Format = "A4", MarginTop = "50px", MarginBottom = "50px", MarginRight = "20px", MarginLeft = "20px", DisplayHeaderFooter = true, FooterTemplate = footer //footer with helpers }, Engine = Engine.Handlebars, Recipe = Recipe.ChromePdf, Content = template, //report content Helpers = ReportHelper.Functions, }, Data = data }).Result;
-
This post is deleted!
-
Here is the example
https://jsreport.net/learn/dotnet-client#pdf-utils
-
Thanks!