Hi I am facing the same problem. While generating the report into HTML format the layout is not coming properly. But it is working fine with pdf and excel. I have written the below code.


JasperReportBuilder report = DynamicReports.report();

/* This is in for loop which is creating muliple column as per query */
TextColumnBuilder<String> string = Columns.column(columnName,columnName, DataTypes.stringType()).setStyle(DynamicReports.stl.style()).setHorizontalAlignment(HorizontalAlignment.CENTER).setStyle(DynamicReports.stl.style().setFontSize(8));
report.columns(string);

report.setColumnTitleStyle(DynamicReports.stl.style().setLeftPadding(0).bold().setFontSize(fontSize).setBackgroundColor(Color.getHSBColor(0, 96, 234)));
report.setDataSource(reportDataQuery, connection);
response.setContentType("text/html");
response.setHeader("Cache-Control", "no-cache");
report.toHtml(outputStream);

prakash.kumar's picture
Joined: Dec 1 2014 - 12:42am
Last seen: 8 years 5 months ago

Please Help me on this.

prakash.kumar - 8 years 6 months ago

0 Answers:

No answers yet
Feedback