BIRT Report Designer: Table of Contents (TOC) with page number and hyperlink - eclipse

I'm using BIRT report designer v4.8 and trying to build a table of contents(TOC).
I know that BIRT has a builtin Table of Contents in Properties, but that kind of TOC can only be viewed in the Web Viewer by clicking the "Toggle table of contents" and be showed up on the left side of the report.
What I want to do is to create a TOC that is part of the report, which means the TOC is directly showed up as a section in the report without clicking the "Toggle table of contents", and also can be exported along with the report.
For example, here is a sample of TOC, suppose we have four sections in the report.
The challenge I'm facing now is calculating the page numbers for each section and then add a hyperlink for each section so that the page will jump to that section when a user clicks it from the TOC. Does anyone know how to get this functionality? What kind of scripts do I need?

This is not possible with BIRT alone.
A possible solution is depending on the output format.
With PDF and a good knowledge of iText, it should be possible to create a TOC in a post-processing step.
I'll sketch the idea here (assuming that the TOC will fit on one page):
With BIRT, generate your invisible TOC as before. On the first page, leave enough room for the TOC.
The rest of the work will happen after BIRT has generated the PDF. BIRT contains iText and iText can examine and modify existing PDFs.
In PDF speech, the TOC is called "outline". With iText, examine the outline. This will give you the data you need for your visible TOC and can be transformed to an array of triples of the form (toc_level, toc_text, page_no).
Then you can create a new PDF with the help of iTexts PDFStamper class: Take the existing PDFs and render your list of triples on page 1.
This will cost you at least 1-2 days of Java development work, however.

Related

Birt eclipse duplex printing

I've been searching for an answer to this question. How can I print duplex or create double-sided PDF using BIRT + eclipse? I generate documents that contain multiple reports, and often the reports are multi-page. How can I force the header pages to always be "page 1" and avoid the next report from flowing onto the back of the previous report?
This isn't a BIRT topic.
When you say you print from BIRT, that's technically not the case. You create a PDF file with BIRT and print that file somehow.
Unfortunately the PDF file format does not support instructions to do a physical page break at a given logical page break.
So, unless you know at generation time if the resulting file will be printed duplex or not, there is no way to control this.
If you know that the file will be printed duplex in most cases, you might insert blank pages at certain places (maybe with a text "this page is intentionally left blank"), but this results in wasted pages if the file is printed single-sided.
Anyway, this still leaves you with two tasks:
1) Use a different Master Page when a new section of the report starts.
2) Finding out where to insert blank pages.
The first task is actually quite simple.
In BIRT, you can have different master pages (say, "first page" and "following page").
You can choose the master page to use in the properties of layout elements in BIRT.
Give it a try!
The second task is outside the scope of BIRT, you'll need some kind of PDF post-processing here. The idea is as follows:
Use BIRT to create a PDF file.
Use BIRT's TOC entry property to create a PDF TOC (also called Outline). This is the document structure shown on the left side if you open the file in Adobe Reader.
Use a PDF post processor (e.g. based on iText or whatever) to read the TOC entries.
Each entry has information about the page where it points to.
Now, if you want to print duplex and the entry starts on a even page (1-based), insert a blank page before this page.
It is possible, but will take at least a few hours of Java programming (or several days, depending on your experience with your chosen PDF processing tool).

How can I include a clickable (hyperlinks) table of contents when generating documents in Enterprise Architect?

I have a data dictionary report in Enterprise Architect (same as in this question: How can I exclude a "report.specification" from a Report in Enterprise Architect?) and I would like a table of contents that is clickable (has links).
The current report does generate bookmarks, but if it is possible, I'd like to have a "live" Table of Contents in the output PDF.
This isn't possible in EA right now
Closest developper response I could get for this issue is this forum post:
I talked with Sparx on this topic as I had the same question.
Their response...
"The 3rd party add-in we use for generating these documents does not
support the TOC hyperlinking - so unfortunately the only alternative
is to open the document in another application like Open Office or
Word and simply right-click and update the TOC."
You can always open the Document in Word or Adobe Reader and use the Navigation Pane:
(Word 2013)
1. Click View on the ribbon
2. In the show Section, click Navigation Pane
(Acrobat Reader)
Use the Bookmarks Pane
Also, I find that when generated as a .rtf or .pdf report, the Table of Contents generates with the wrong Style, messing with the Navigation Pane.
Generating the Document in Word format solves this issue
Another Solution:
You can generate the report without the table of contents with Word, create the table of contents when generated and then export it to whatever format you need
Edit:
After some digging, I found that in Word, you can update the TOC and then ctrl+click the numbers to jump pages.
You cannot do this with a pdf

Adding a hit counter to Desktop Intelligence/Xi 3/Business Objects webpage?

for my company I am making a report in Xi3/Desktop Intelligence that pulls data via free hand SQL and makes a html file displaying the data, updating every 20mins. We want to incorporate a hit counter that will show us the number of times this report is being viewed.
I found a couple basic templates online. I tried copying and pasting them into a cell, but the output HTML page just displayed the full HTML (unrendered by my browser). I am decent at writing my own HTML, but I just do not understand how to stick my own HTML code in a dynamically updating report in Xi3.
Moreover, I doubt (for legality reasons) my company will be okay with me using a free hit counter template I find online, especially considering they all seem to reference a third party website to do the actual "counting." Any ideas of the best way to implement/learn how to create a visitor counter?
Thanks.
You can include HTML in a DeskI report. In the cell that contains the HTML, click Format Cell; on the "Number" tab, there is a checkbox for "Read as HTML". Make sure that's checked off. Note that you won't see the rendered HTML within DeskI, but it will display when viewed in Infoview.

jasper ireport basic functionality

I am new to JasperReports and iReport and I am sturggling to get the most basic example up and running. I'm trying to read input from a .xls file and put it into a table using iReport. Eventually, I want to read from a database, and transform the data in a meaningful way but for now I just want to view what I am reading and I can't get that going. First, if I just drag and drop my Field into the template, $F{Account}, I would expect to see the list of values for that field name (as I do when I preview my "query"). However, if that is all I do and then preview, I see the first account number in my input xls, and then 50 pages of empty white space. Why would this be?
Next, if I create a basic table, I am getting an error
Error filling print... null
java.lang.NullPointerException      at net.sf.jasperreports.components.table.util.TableUtil.isSortableAndFilterable(TableUtil.java:344)   ...
Print not filled. Try to use an EmptyDataSource...
Any help is greatly appreciated! Also, I should note, I did download JasperReports but I'm wondering if I need to somehow connect iReport to those classes. I saw a way to do it in the Netbeans plugin but I'm just trying to use the iReport GUI
The table component is great. But it's harder to use than it should be. Take a look at this Table Component tutorial to learn how to use it.
For the first part of your question you don't give enough information for anyone to know. My guess is that you put the field into the Title band rather than the Detail band.

ReportSize in Excel not the same as in PDF

I have done already a lot of small (and also bigger reports) with report viewer 2010. In most cases I give the user the possibility to select the destination-format (PDF, Excel and sometimes also word).
However I always encouter the problem that the page format settings are applied different in the different output formats: If I create a report and optimize it to PDF, set the page size and the borders, then design the report, the report looks good (Measures are correct, borders are correct). However if I export it to Excel, it always is to big. What in PDF gives me one page, is in excel on two pages (horizontally).
I checked the page borders in excel because I have read that there was a bug in an ancient report viewer with this, but they are exactly as specified in the reports properties. The paper size is also correct.
I also have set the report width over the properties grid (via F4) to PageWidth-LeftBorder-RightBorder, but this is the same.
I have also played around with the InteractiveSize, but this seems not to have an influence.
Is there something special to know about Excel-Exports from report viewer or is there a known bug? Has someone a solution for this behaviour?
It seems to me that in excel the same page format has half an inch less size than in pdf. Up to now I was never be able to create an exact copy of some paper report template. In the end, it was always something like making handicraft work, but I don't like that. I would like to understand whats going on.
As an additional information, I specify all metrics in centimeter, may be there is a problem with that? And the office is office 2010.
A real solution to this problem I have not found. Maybe this connect entry promises somethin for the future:
http://connect.microsoft.com/VisualStudio/feedback/details/636407/rdlc-excel-export-margin-problem#