page numbering in jasper studio reports with multiple dynamic pages - jasper-reports

I have 3 different types of pages in my jasper soft 5.6.2 studio report. The first is a mandatory jrxml page called "Details" which will always be only one and first page. Second is a dynamic page (is jasper but I can use jrxml if required) with a list of items "Items" page which can vary from 0 to several pages. Third is also a dynamic "Comment" page (is jasper but I can use jrxml if required) which can vary from 0 to several pages.
I want to print page numbers like Page 1 of 5, page 2 of 5 and so on. Initially I had first two type of pages only that is no Comment page and my methodology worked, but with addition of third comment page it doesn't work anymore.
My Approach which worked: In the first page had a key attribute ='pageNumFrom' and 'pageNumTo' which I replaced in my java after calculating total pages. But for Items page I had variable PAGE_COUNT+1.
With addition of third page this approach doesn't work because PAGE_COUNT variable is lost and new count starts for third page

See: https://stackoverflow.com/a/42065376/3406242
This is a similar issue, and you should be able to resolve it in a similar manner by using the Master page numbering.

Related

Crystal Reports PO add second page Terms & Conditions

Our ERP system Macola has a PO form created with Crystal Reports. I need to add a second page, Terms & Conditions. I've tried several suggestion from the web with no luck. The second page prints with the Terms & Conditions, but the first page header information still prints. I tried the suppression using pagenumber >1, but when you look at the printout of the second page, the page number is 1 so this formula doesnt suppress the header information. Any help would be appreciated. Its amazing that just adding a second page with terms & conditions would be that difficult. Is there an easy way to add a PDF to the last page, not using subreport.
I have a few reports that do exactly what you describe. The way I designed the reports was to put the Terms & Conditions in the Report Footer section. Then in the Section Expert for the Report Footer I checked the box for "New Page Before" on the Paging tab. This ensures this section always begins on a new page. As for suppressing the Page Header on the last page, I used the following formula.
PageNumber = TotalPageCount;
I also used this same formula in the Page Footer section to ensure it is suppressed on the last page as well.
This design also assumes that the user will never print more than a single PO at once. If your users need to print a range of Purchase Orders at once, this design will only print the Terms & Conditions page once regardless of how may Purchase Orders are being printed.
Also, based on what you said about your pagenumber > 1 formula not working as expected, you may want to go through each section in the Section Expert and inspect the Paging tab to see if any sections have "Reset Page Number After" enabled. Any sections that have this enabled will force page numbers to reset back to 1 after that section prints and could cause any formula that evaluates PageNumber to behave unexpectedly.

Linking content from one page to another in Confluence

We have bunch of Confluence pages for each team to note down the leaves. Each such page consists of a table with team, team member name, month, week ..etc.
Now we want to have a consolidate page which shows information about all the teams in a single page. Can we create a consolidated page which uses the content in all other pages?
I read about macros but couldn't understand how they can be used. Is it possible to use content from one page in another page dynamically?
Yes you can by using the "Excerpt" macro (to mark one section in a page as "insertable" and use this in another page). If you need to have multiple sections in one page to reuse in other pages, there is also a "Multi Excerpt" macro.
So, for example, if you have a page with a few lines of text, you can basically insert the excerpt macro and paste all content into it that you want to reuse on other pages:
(source: imagestack.net)
(in this case I want to reuse "line 2")
In another page, you can reference this marked content by inserting the "Excerpt Include" macro and specifying the page you want to take the marked content from:
(source: imagestack.net)
The result in this case is

in Jasper Reports how to know when we reached last page

Our invoicing system needs to print OMR (optical mark recognition) symbol on each page of our invoices so the folding machine knows what to put in the envelope.
That little PNG picture with OMR mark has to be put on each page. Our invoice is consisted of main report with two subreports created in special .jrxml files. Picture is generated by calling web service with passing page number and 'last page' mark as a parameter in http request.
What we can't put to right is that 'last page' mark since variable called $v{PAGE_NUMBER} can be read in two contextes: page and report. If you read it in page context you will have actual page number, in report context that variable will give you total number of pages. You cannot read such variable at once and know that you are on, lets say, page 3 of 5.
Since I have 'access' to last page (last page is filled with static text) in main report I can put another image with total number of pages and hardcode 'last page' parameter set to true, and put that image on the very same position on paper where regular image 'sits' so this image will overflow another generated in transactions subreport, but then there is no rule of which image will be over another, this approach is only partly successfull.
What can I do?
If you put the OMR symbol in the footer, you can use the report element Last Page Footer, which will cause the last page footer to be different than the other page footers in the report. This way you can put a last page mark on the last page of the report.

How to use jasper reports to print something only on the first page?

How to use jasper reports to print something only on the first page. I am using jasper reports for printing invoices and only on the 1st page I need to print the Remit Payment To section with the address following it. Customer address is also present there. The way it is currently designed is that this goes into pageFooter section and we use printWhenExpression(PAGE_NUMBER = 1) so that this only gets printed on the 1st page of the invoice. But the downside of this approach is that the jasper engine reserves the size equivalent of the page footer on all the other pages (1..n) of the invoice. So we are able to use only about 2/3 rd of all pages. Remaining 1/3rd page which is for page footer is blank for all pages except the 1st page. This increases the number of pages. Any ideas for fixing this issue?
Use "Print When Expression" of the Page Footer itself, not the field.

SSRS 2008 export to MS Word with dynamic Page Footer

I have a requirement to have a page footer show up on the first page of a report, and then no page footer on subsequent pages.
When I create a report that toggles the visibility of objects in the footer it works fine in BIDS, and when I export to PDF, however upon export to MS Word, the footer from the first page appears on every page.
In other tests I have attempted, it appears that other than the Page Number, anything that appears on the first page of a report's footer, will appear on every page when exported to Word.
Does anyone have ideas for how to create Footer content that changes depending on what page you are on, and will persist through the export to MS Word?
This answer is pretty late in coming to this user, but for any others fighting with this, please see the msdn SQL Server export to Word write-up here:
http://msdn.microsoft.com/en-us/library/cc627455(v=SQL.100).aspx
In a nutshell, toggling states anywhere in the report is not supported. Whatever the state of the report item is on the first page is what it'll be throughout the exported report. With that in mind, it appears that PDF will be a better format to support with your customers.