title: JasperReportBuilder HTML row height
body: <p>I am building a report with <em>JasperReportBuilder</em> from a JDBC data source and afterward I export it to HTML by calling the <em>toHtml</em> method with a <em>JasperHtmlExporterBuilder</em> object parameter. I have been trying to get rid of extra space that exists above the text in each of my rows, column header row, and even my title. I have tried everything I can think of and have been searching online to no avail. </p>
  
  <p>It seems most people have the opposite problem: they need to grow their rows to fit their text. I would like to force my rows to be the height of their contents. If that's not possible, I would be happy with restricting the height of my rows. </p>
  
  <p>The HTML exporter appears to be controlling the height of my rows by inserting an image and setting its height.</p>
  
  <p>Any help would be appreciated. Thanks!</p>
  
  <p>Edit: Here is my code.</p>
  
  <pre><code>String imageServletUrl = "images?image=";
  
  StringWriter writer = new StringWriter();
  
  JasperHtmlExporterBuilder htmlExporter = Exporters.htmlExporter(writer);
  htmlExporter.setImagesURI(imageServletUrl);
  
  SqlRowSet rowSet = getData(databaseIpAddr, portNumber, databaseName, databaseUser, databasePassword);
  
  JRDataSource ds = createDataSource(rowSet);
  
  JasperReportBuilder builder = DynamicReports.report();
  
  IntegerType intType = DynamicReports.type.integerType();
  DateType dateType = DynamicReports.type.dateType();
  
  int rowHeightPx = 20;
  
  TextColumnBuilder&lt;Integer&gt; col1 = col
     .column(COL_TITLE_RESULT_NUM, RESULTS_COL_TITLE_RESULT_NUM, intType)
     .setWidth(35)
     .setFixedHeight(rowHeightPx)
     .setStretchWithOverflow(true);   
  
  ... create other eight columns ...
  
  StyleBuilder titleStyle = stl.style()
     .bold()
     .setFontSize(22)
     .setHorizontalAlignment(HorizontalAlignment.CENTER);
  
  StyleBuilder columnTitleStyle = stl.style()
     .bold()
     .setAlignment(HorizontalAlignment.CENTER, VerticalAlignment.MIDDLE)
     .setBorder(stl.pen1Point());
  
  StyleBuilder columnStyle = stl.style()
     .setAlignment(HorizontalAlignment.CENTER, VerticalAlignment.MIDDLE)
     .setLineSpacing(LineSpacing.SINGLE)
     .setBorder(stl.pen1Point());
  
  TextFieldBuilder&lt;String&gt; titleBuilder = DynamicReports.cmp
     .text(selectedAgency)
     .setStyle(titleStyle)
     .setFixedHeight(20);
  
  TextFieldBuilder&lt;String&gt; subtitleBuilder = DynamicReports.cmp
     .text("Start Time: " + startDate + " " + getStartTime() + ", End Time: " + endDate + " " + getEndTime())
     .setFixedHeight(20);
  
  TextFieldBuilder&lt;String&gt; noDataMsgBuilder = DynamicReports.cmp
     .text(NO_DATA_MSG)
     .setStyle(columnStyle);
  
  builder
     .title(titleBuilder)
     .addPageHeader(subtitleBuilder)
     .setColumnTitleStyle(columnTitleStyle)
     .columns(col1, col2, col3, col4, col5, col6, col7, col8, col9)
     .setColumnStyle(columnStyle)
     .highlightDetailOddRows()
     .noData(titleBuilder, subtitleBuilder, noDataMsgBuilder)
     .setWhenNoDataType(WhenNoDataType.NO_DATA_SECTION);
  
  String reportHtml;
  try {
     // this seems to be required to get to the DynamicReports images
     getContext().getRequest().getSession().setAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE, builder.toJasperPrint());
  
     builder.toHtml(htmlExporter);
  
     reportHtml = writer.toString();
  }
  catch (DRException e) 
  {
     e.printStackTrace();
     reportHtml = "There was an error generating the report";
  }
  </code></pre>