Can JasperReports include a pdf in a report? - pdf-generation

Is it possible to include an existing pdf file in a JasperReport?
We really want to append new data to an existing report with out regenerating the existing report. We will be exporting back to pdf. I'm looking at using iText's PdfCopy to merge two pdfs, but was hoping JasperReports might have an easier way...

I don't think you could do that in JasperReports, but it would be fairly simple in iText.
Generate the JasperReport, and then use PdfCopy to append the new report to the original (or vice-versa).

Related

How to add listings or images to the table of contents (TOC)

I have a couple of examples (all with titles) and I'd like to create an index/list out of them automatically.
An example can be seen in the chunked AsciiDoc User Guide table of contents (or beneath):
The asciidoc source of the AsciiDoc User Guide does not show anything specific to me for Asciidoc itself, I could find the following hint to Docbook:
DocBook toolchains will normally automatically number examples and generate a 'List of Examples' backmatter section.
I'm looking for the (asciidoctor?) standard html5 rendering, but I'm open for different suggestions.
Adding the :doctype: book attribute alone does not do it. So I merely hit dead ends not knowing if it is possible at all. Also I'm new to Asciidoc so I might just miss some pointers, too.
The Python Asciidoc repo includes the a2x tool, which is a wrapper around a DocBook toolchain. It is DocBook that is producing these entries in the table of contents. Neither Python Asciidoc, nor asciidoctor, can do this out of the box.
You would need to curate the lists manually, or create a macro that does the curation for you. This thread might prove helpful: https://github.com/asciidoctor/asciidoctor-extensions-lab/issues/111

Create Multiple Slides from a List with Common Template

I have created a certificate design with powerpoint.
Now I have to create 100+ copies of it... each with a different name (the recipent).
I was wondering if there was an easy way to do it...
I can have the list of names in excel or txt.
I am open to other ideas as well, like changing the slide into an images and batch processing it in a simple way
You may also try out SlideMight, a tool for merging hierarchical data with PowerPoint templates. SlideMight supports iteration over data, to generate slides or to populate tables. There is more functionality, but you don't seem to need that. SlideMight is in fact a coding system, like mail merge for Word is.
Input data format is at this time just JSON; you would need to convert your Excel sheets first, e.g. using this Excel to JSON add-in for Excel.
There are versions for Windows and Mac OS X.
More information is at www.SlideMight.com
Disclaimer:
I am the owner of Delftware Technology, the company that developed SlideMight.
And I am one of the developers.
This is a question that really belongs in SuperUser, not StackOverflow (which is intended for coding questions, not software how-to-use questions).
But ...
Save your names to a plain notepad TXT file, one name per line.
Start PowerPoint, choose File, Open and point to your TXT file (you may force the matter by choosing . in Files of type:
Apply whatever template you like to the result.
I have a commercial add-in that'll do this and quite a bit more, but from your description, you don't need it.

Use Perl/GD to create and insert image directly into excel workbook?

I have had no luck figuring out how to insert an image (a gif in this case) created in perl with GD directly into an excel workbook, without first saving the image to a file. Is this possible using win32::OLE or one of the perl spreadsheet modules, or is there another trick I'm missing?
What I've tried:
searching google, stackoverflow, perlmonks
modules:
- spreadsheet::writeexcel
- excel::writer::xlsx
win32::OLE
- Pictures->Insert
- Shapes->AddPicture
All require a file as input; there was ONE (rejected) bug/patch to spreadsheet::writeexcel to allow inline images, but it didn't quite work and I'm disinclined to use non-baseline modules... any ideas?
Neither Spreadsheet::WriteExcel or Excel::Write::XLSX support adding images from anything other than a file.
I would suggest creating the images as temporary files, inserting them into a worksheet with Excel::Writer::XLSX (which has better image handling) and then removing the temporary files.

Converting Oracle Reports (.rdf) to BIRT reports

I have some Oracle Reports (.rdf) that I am considering converting to BIRT reports. Is there a way to convert .rdf files to BIRT report design files?
A fully automated solution is probably not possible. You can partially automate the conversion process as follows:
Convert the RDF files to XML.
Extract the report query.
Convert the XML to BIRT (or JRXML) using XSLT.
XML Conversion
The first step is fairly simple, using Cygwin:
cd /path/to/reports/
mkdir xml
for i in *.rdf; do
rwconverter.exe batch=yes source="$i" dest=xml/"$i".xml dtype=xmlfile \
userid=scott/tiger#xe
done
Extraction
The second step is also relatively easy, using starlet (rename xml.exe to starlet.exe to avoid conflicts with Oracle's xml.exe):
starlet.exe sel -t -v "/report/data/dataSource/select" filename.rdf.xml
You can also use xmllint, but it includes the select and CDATA elements, which you'd have to parse separately:
xmllint --xpath /report/data/dataSource/select filename.rdf.xml
Format Conversion
The third step is challenging. Create an XSL template that reads the RDF layouts (e.g., <displayInfo x="0.74377" y="0.97913" width="1.29626" height="1.62695" />). Then convert those layouts to the corresponding format used by the destination report engine (such as BIRT or JasperReports).
You wouldn't get a 100% solution, but an 80% solution could significantly reduce the amount of monotonous, error-prone work required to convert the reports.
I once had a job to convert *.rdf files to Jasper reports. Since I don't know BIRT, I have no idea if this approach would work with BIRT, too.
Anyway, I exported the *.rdf files as xml and parsed the output with Perl and wrote the Jasper definitions, also as xml. For most reports, this worked pretty well. I have -however- one report in mind that I couldn't translate automatically: that was a report where the result set of two queries were laid out side by side.
I haven't found any tools which do this. Some might call this a business opportunity.
RDF files, as far as I can tell, are in some funky binary format. To even have a shot at this, I'd probably convert it first into a REX file, which is supposed to be portable xml. Then, it is a matter of transforming from the REX structure to the BIRT structure. Honestly, I have no idea how documented the REX file is, but maybe since you know how it looks from the visual side you can make sense of it.
Good luck!

directly embedded subreport in JasperReports

I am so close to having this work, I am trying to directly embed one jasper subreport into the main report xml of the other. You'd think this would be easy, but I can't find a single example on doing it. Everyone seems to use files or resources or whatever. I have one report working straight from a string and I want it to contain it's subreport.
Anyone? Syntax? Thanks!
The only way I know of to do this with JasperReports is to use a separate .jrxml file for the subreport, and include it in the main report using the subreport command.
Another option you have for any embedded reports is to use subdatasets, but as far as I know they're only useful for graphs.
As it sounds like you control the code surrounding the generation of the report, you could come up with a simple format to define multiple reports in the one string, and then have your code extract each report at runtime.
When we've needed to deal with a single file but have subreports for a JasperReport, we've used Zip files, and simply zipped up the main report and all it's necessary sub reports, and then unzipped them into a temporary directory when we need to (all in code of course)

Resources