I am developing a reporting application where a user can select(and order) reports from a list of 100 reports and ask for a master report. This master report should contain all the selected reports in the exact order, with a table of contents listing the (sub)reports included in the master report and correct page number.
I am programmatically creating a MasterReport and adding the selected reports as sub reports to the MasterReport's report footer. Each SubReport's report footer has its pageBreakAfterPrint property set to true so that the subreports come on different pages. The page break seems fine in pdf and excel, but in word the page break has no effect.
However, I am not able to figure out how to add a table-of-content element programmatically to the MasterReport which will list all the subreports added. I would also like to know how to get the page number working properly on page footer programmatically.
I discovered that there is a separate jar that has the TOC code. However, I am still not sure how to use. This doesn't matter anymore as we are looking to move to BIRT.
Related
I am working on a project which is developed with Java Struts 2 framework. I am completely new to this. In project, when user clicks on a report button, a report is shown in different tab (the url of it looks like https://localhost:8181/myApplication/businessReport.do).
Goal: What I want is saving this report as html file in backend somehow. It is perfectly OK when user sees the report as he is seeing currently. It just needs to be saved in backend somewhere. The reason to do this is, te application is going to shutdown soon and our client wants to save those reports somewhere for future reference.
I could find businessReportForm.java, businessReportAction.java and also businessReport.jsp files in my project. I assume they should be of my interest.
Note: It uses mapping.findForward from Action mapping
I do not understand following and it would be nice if someone can help with that.
What could be the last point in (with respect to strut framework) where all the information for report would be ready ? (I would lke to use it to create .html file out of it)
What I need to change here in order to achieve the goal ? changing .jsp , changing Action or should change be done in corresponding Action class ?
in the url what does businessProcess.do actually mean with respect to jsp and servlet ?
any other idea what should be the approach to do what I want to do ? (saving report as html in background)
I am generating report using BIRT. The problem which i am facing is that date and time is automatically generated at each page in the report. I do not want those field to appear in my report. does any one know how to solve it
Your question indicates that you are a newbie to BIRT, so I'll explain a bit more:
The field is in the footer in the master page.
You can simply delete it if you don't want it:
Just open the master page tab of the main window, scroll down to the bottom, find the text element containing "new Date()" and delete the element.
When you create a new report, the wizard lets you choose a template.
The so-called "blank report" template isn't actually blank!
It contains very few predefined elements: Apart from some styles, the only visible element is the current date/time in the footer of the master page.
You could create your own "really blank" report template, if you like.
IMHO the templates are kind of superfluous.
Once you have developed a few reports, it is easier to copy a similar existing report and modify it than to create a new report from scratch.
BTW if you are going to develop more than a handful of reports, you should learn about BIRT's library concept, which is really useful to re-use components in different reports.
Go to the Master Page view of the .rptdesign window and you can remove the date there.
Consider a report page consisting of header, detail-top, detail-bottom and footer. I have a service which will run an "App". This App will produce what will ultimately appear in the detail-bottom portion of the report. It will store its output in a file system. After App has produced its output (and shutdown), a seperate "Service" will produce the final report "merging" the content produced by the App (the service provides the content of the header, footer and detail-top areas). If I was generating this by hand in Word, I would be in essense inserting a word document into final report document as an object.
I'm trying to identify an appropriate technology to accomplish this.
Requirements include:
The Service producing the final report will be a Java service runnig
on a Linux machine. I will be developing this code.
The App producing the detail-bottom content could be a Windows
(e.g., C#) or Linux (e.g., Java) application. Any number of other
developers would be developing this code and interfacing with my
service through a SDK I will provide. They are presumed to be
skilled developers but I don't know what experience they have with
any report generation technology
The template utilized by the service will give the same look & feel
to the finished report regardless of the App that is run, while the
App will have total control over the content of the detail-bottom
section of the finished report. In other words, if the template
allocates a "frame" of say 7Wx5H in the finished report for the
detail-bottom section, the App would in essence have a 7x5W blank
page to work with.
The finished report could be multiple pages and the first page could
be different than the remaining pages. If the App produces multiple
(e.g., 7Hx5W pages), the service would merge each App page into the
detail-bottom section of each page of the finished report, thereby
leaving the App to deal with pagenation as it would if it was
producing the entire report itself.
At some point I want to provide the end user a UI for managing the
layout of the finished report (template).
I'll don't really care how the App developer produces the content to
be inserted into detail-bottom frame and as he is providing me with
a finished executable for me to run, I will not provide him with any
UI to manage his report layout/content
The finished report delivered to the end user will be as a PDF.
Since I'm not sure about the skill set of the App developer and
there could be many Apps and developers, I want them to produce
output I can accept for merging into the dertail-bottom frame with
is well accepted, supported and not overly burdensome to use.
Various technologies suggested to me thus far are:
Apache FOP (XML-FO)
DOCX
itext
Here's a solution using FOP:
Have the application save the respective data to two XML-Files with fixed names. So, your API would be a XML document schema the data producer would have to stick to.
provide an XSL file which contains the layout for the complete PDF and reads back the two files using the document() xsl function.
In order to process several reports at the same time, use one directory for each report.
FOP would take care of pagination.
If you want to have the layout configurable by the end user, you can let them change the xsl in ways defined by the application. You could also split the XSL into several portions (for the first report, for the second report, for the overall layout) and import them all into one master template.
If the final output is a PDF, which gives exact control over appearance, why not allow the apps producing the bottom frame to also produce PDFs which give exact control over appearance?
One feature supported by PDFs is a "Form XObject" which allows the inclusion of content from one PDF into another one. You can even take particular rectangles off a page, so you could allow the app to create any size PDF it wants, and to specify the rectangle enclosing the content.
There must be Java libraries that support Form XObjects, because it's not that hard. I have written a Python library names pdfrw that allows you to merge pages this way quite easily. I haven't yet documented it all that well, but there are several examples on that site, and a very relevant one here
I am having a problem in using a iReport.
I have a general master report and that master report contains 3 sub reports and also these each subreports contain subreport. While I am not having a problem in printing those 3 subreports individually and also their subreports in the preview mode of iReport, I can't print them while they are together in the master report in the preview mode. I have included all the parameters and fields needed for executing the query in every reports (I mean the subreports and their master report). However, no way! It doesn't work...
Any help will be greatly appreciated...
I've seen this happen a few times, the preview wouldn't work, but when I tried to run the report from the application in my local workspace everything ran fine. I think the issue may be that the subreport doesn't have data and that causes problems. You may want to add print when expressions to the subreports so they don't run unless there's data.
The solution to the problem is to generate the sub reports from scratch, not by copying and pasting the similar report. In my case, the sub reports in the report look very much similar in many patterns so I have just copied one of them, pasted them on the main report and changed what is needed to be changed (such as fields, names or the queries inside them) on the pasted sub report. At first sight, while I am previewing the sub reports independently from their main report, they just look fine but while I am trying to preview the main report, the sub reports in the main report are not printed. So I accidentally (those times I were a novice user of the iReport) tried to generate the sub reports from scratch. (Scratch I mean: File -> New -> Launch Report Wizard -> Selecting the database I'd like to work on and entering the query which I'd like its results to have the datum to be printed on the report and so on) and by magic; the sub reports which are seemed to be not working, begin to work and get printed on their main report.
Thanks for all the replies...
When creating reports using BIRT 2.3.1, I don't want page breaks inside tables or groups; if the table doesn't fit in the space available at the page, I want to put the entire element in the next page.
Using previous versions of BIRT it was possible to set pageBreakInside to "avoid", but it didn't work. In BIRT 2.3.1 this (useless) option was removed, since it wasn't implemented correctly.
This is one of the 'hard' problems in reporting. Tried to get it in 2.3 and we missed, rather than have people thinking that they were doing something wrong (when it didn't work), we backed it out in 2.3.1.
This is high on the priority list for 2.5 (June 2009). Sorry to disappoint, we just ran out of time.