Reputation: 23352
I am creating dynamic jasper reports. Things are looking fine. How do I add a dynamic header image to the generated reports?
I am using
FastReportBuilder fr = new FastReportBuilder();
Style headerStyle = new Style();
headerStyle.setBackgroundColor(Color.BLUE);
headerStyle.setPadding(5);
fr.setTitle("Title")
.setSubtitle("Sub title")
.setPrintBackgroundOnOddRows(true)
.setUseFullPageWidth(true)
.setPageSizeAndOrientation(Page.Page_A4_Landscape())
.setTitleHeight(100)
.setTitleStyle(headerStyle);
But its not working. Reports will be exported in pdf, csv, and html formats.
Upvotes: 1
Views: 4457
Reputation: 23352
It works for me
fr.setUseFullPageWidth(true)
.setPageSizeAndOrientation(Page.Page_A4_Landscape())
.addFirstPageImageBanner("path/logo_strip.jpg", 800, 50, ImageBanner.ALIGN_LEFT);
Upvotes: 3