Rendering Text and Banner in the same header row, DynamicJasper

75 Views Asked by At

Is there a way to render Text and ImageBanner in the same Header row?

I tried doing the following:

.addAutoText("kjasdlkf",
            AutoText.POSITION_HEADER, AutoText.ALIGNMENT_LEFT,
            ReportGeneratorConstants.TITLE_CELL_WIDTH, style)
.addFirstPageImageBanner(getPropertyDir() + File.separator
            + REPORTING_FOLDER + File.separator + PDF_EXPORT_FOLDER 
            + File.separator + LOGO_FOLDER_NAME + File.separator 
            + SUFFIX, 197, 60, ImageBanner.Alignment.Left);

But Its rendering the data in multiple lines:

enter image description here

Please suggest!

1

There are 1 best solutions below

0
prashant.kr.mod On BEST ANSWER

I have achieved it by overriding CustomLayoutManager class.

overrided applyImageBannersToBandLocal method to display image logo and custom-text in the same band.

JRDesignBand headerband = (JRDesignBand) getDesign().getPageHeader();

applyImageBannersToBand()

   image.setX(xPosition);
   image.setY(0);