How to display image in BIRT report using XML data source? - birt

I am using BIRT reporting tool version 2.5.2. I want to generate BIRT report in PDF format using XML data source. I have below XML node structure,
<?xml version="1.0" encoding="UTF-8"?>
<columnDetails>
<employeeDetails>
<employeeName>{Name Of Employee}</employeeName>
<employeeId>{Employee ID}</employeeId>
<employeeSalary>{Employee Salary}</employeeSalary>
<employeeImage>{Base64 encoded byte string of Employee Image}</employeeImage>
</employeeDetails>
</columnDetails>
While generating the report, my XML data source is good enough to populate the employee details except the employee image. The generated PDF report displays “The resource of this item is not reachable” in place of the image.
My image item data set is properly mapped with “employeeImage” node of the data source XML and to render the image I have defined the source as dynamicImage with dynamicImage expression as
“row[employeeImage]”
which is a Blob type data object.
Please suggest how I can fix this issue to display employee image in PDF report. Let me know incase you need any further clarification.

The image can be added
a. As an embedded image. This however reduces reusability.
b. As part of a report library.

Related

How do I wrap data in BIRT?

I have developed a BIRT report and need to export the output as PDF and as an Excel Spreadsheet. I am looking a solution to wrap data in PDF report exported from BIRT. A text gets truncated in the PDF, if it does not have spaces as soon as it exceeds the available width of the column.
e.g. phone number getting truncated
I would like to know if there is a solution without the need for adding a custom code as provided in How to wrap column data in birt report. This solution adds whitespace to the data which is not desirable when the report is exported to an excel spreadsheet. In essence, this solution manipulates the data which isn't the right thing to do.
I have tried using the Whitespace auto option but that does not work.
I am using BIRT version 4.12.
I was able to figure out the solution for getting the text wrapped in the PDF export. Made use of IPDFRenderOption.PDF_WORDBREAK for the same.
PDFRenderOption pdfOptions = new PDFRenderOption();
pdfOptions.setOutputFileName("T:/temp/filename.pdf");
pdfOptions.setOutputFormat("pdf");
pdfOptions.setOption(IPDFRenderOption.PDF_WORDBREAK, true);
task.setRenderOption(pdfOptions);
task.run();

How to overlap Label and Data fields over an image in BIRT

Using BIRT. Added Image in a Grid. Unable to put label and data fields over image in certain region. Please advise if you achieved it.
Thanks,
Yasar
I think all you can do is use the image as background-url. AFAIK this only works for images that actually come from an URL, but not for images that come from e.g. a database BLOB (but you might download the BLOB to a temporary file and use the file name as URL).

Oracle Unifier image data to be displayed in BI Report, image data is showing just a number

Oracle Unifier image data to be displayed in BI Publisher Report, image data in the field is showing just a number. like 446 and there is another field which show a jpg file name only like 2121.jpg. And when I looked at many post around found that there is some data inside.
like below. You might have noticed on right side the example is blob i.e. some string data is there. In the unfier i just got a field value 446. So my question is how do I go about displaying the image.
I refered to this document but could not get anywhere
https://docs.oracle.com/cd/E91461_01/English/Install_and_Upgrade/Configuring/bi_publish/unifier_bi_publisher_config.pdf
and I also tried Another way to work on getting the image
but again i have the same problem my field is in numnber the people trying it out have field value in blob
https://community.oracle.com/thread/4095157
enter link description here
Below is what I worked on and got to this point.
Image in BI Publisher report from the data is not displaying. I have followed the instructions and created the url and saved it in the ALT text of the image in RTF it is not displaying the image. Below are the instructions that I have followed.
Page 16 --> Configuring BI Publisher Reports to Use Unifier Images from the below document
https://docs.oracle.com/cd/E91461_01/English/Install_and_Upgrade/Configuring/bi_publish/unifier_bi_publisher_config.pdf
The ALT Text in the image is --> url:{concat($uuu_p_urlF,'/',COMLOGO,'/',//security_token/SEC_TOKEN1)}
It id generating the correct url -->http://IPADD/bluedoor/rest/image/453/A30DEAC4-4C63-12C7-3071-7A19048E848F
If i use this url i can see the image in the browser but the same link in the ALT Text field of the image does not display the image.
Would like to to what I am doign wrong

PDF report with table of contents containing page number in BIRT

I need to create a TOC on a report that will be produced as PDF.
Unfortunately, the TOC mechanism in BIRT when exporting to PDF is to add a bookmark.
However, I need to place a report like
Section A........................1
Section B........................4
Section C........................10
on the first page of the report.
I can't find anything on the books regarding this topic. What is the mechanism to do this?
Any suggestions would be greatly appreciated.
Thanks.
This is not possible with BIRT.
What you could try is to create a TOC as usual.
Once the PDF is created with BIRT, you can use iText to read this TOC programatically and create a visible representation for it.

RDLC + ReportViewer Control - how to display images from the database?

I am storing GIF images (I can switch to BMP if necessary) in a varbinary column in SQL 2008. I want to display these images in a PDF rendered by the ReportViewer control from my RDLC.
How do I have to reference the image data in the report to make that work?
=First(Fields!sh_lot_num_barcode_image.Value, "DataSet1"))
A simple field reference does not seem to do the trick.
So it turns out my question was already asked before and self-answered. Give Tina your vote!
Together with Kevin's answer it got me on the right trail. I ended up adding a property to my Linq stored procedure results class that invokes the image HTML Handler. I changed the MIME type to BMP and it works like a charm - I can drop the database column now and don't need to jump through hoops to compose the URL for the image service. This property below I can directly assign to the image control.
public byte[] NDCLabel {
get {
return
BarcodeUtilities.ConvertImageToByteArray(
BarcodeUtilities.GetBarcodeImage(this.ndc)
,System.Drawing.Imaging.ImageFormat.Bmp);
}
}
Have you considered writing an HTTP Handler to read the image from the database and write it to the response stream? Then you can set the image control in your report to use the URL as the source and it should render in the output.
I don't have any actual images as blobs in a database to test with, but I did something sorta similar when I needed to render rich text on a report.

Resources