31297

Stretch overflow not working in excel jasper report

I am trying to export report to Excel (XLSX format) using jasper report, but get problems with stretching when text field is overflow. I get just empty cells when value of textfield is bigger than textfield size. I tried to use these parameters, but it isn't helping me:

<property name="net.sf.jasperreports.export.xls.collapse.row.span" value="true"/> <property name="net.sf.jasperreports.print.keep.full.text" value="true"/> <property name="net.sf.jasperreports.export.xls.detect.cell.type" value="true"/> <property name="net.sf.jasperreports.export.xls.wrap.text" value="true"/> <property name="net.sf.jasperreports.export.xls.auto.fit.row" value="true"/> <property name="net.sf.jasperreports.export.xls.auto.fit.column" value="true"/>

Here is refer to screenshot: http://clip2net.com/s/39cbljj

In HTML it looks ok:

http://c2n.me/39cyhRf

Does anybody know how to fix this? Thanks.

Answer1:

you should do the following to get it working:

<ol> <li>Set isStretchWithOverflow="true" for <strong>all</strong> TextField elements on Detail band (it will fix cutting of long text values)</li> <li>Set stretchType="RelativeToBandHeight" for <strong>all</strong> TextField elements on Detail band (It will fix the issue with empty cells - all TextFields will be rendered with the same height)</li> <li>set the property <property name="net.sf.jasperreports.export.xls.auto.fit.row" value="true"/> on each TextField which may have long value. The point is that property net.sf.jasperreports.export.xls.auto.fit.row works on Element level only.Also please note that this property won't work for merged cells.</li> </ol>

Answer2:

It works perfect in HTML, but during export in EXCEL format I get problem. I looked stretch sample from jasper reports demo/samples folder and found out solution. I set horizontal alighment textfield parameter to "justify" and it will work in Excel and look perfect. Seems that without this parameter stretch does not work during export to Excel. Thanks for the help, user1390785 !

Answer3:

I just got same issue and i solved it.

its simple. just open your report properties and set page height to 999999. convert again and see its just solved

Recommend

  • regex, multiline extract in R
  • dc.js: Reducing rows in data table
  • Extract data between rows r
  • How to fallback to entirely different index page if user has javascript disable?
  • CSS: How to fix overlapping divs
  • Best HTML5 structure for a layout where the title/header is outside the article tag
  • How to make SASS put relative paths in its output
  • Facebook Messenger Platform - Detect user typing
  • Angular - routerLinkActive and queryParams handling
  • Is it possible to get the word under the mouse cursor in a ``?
  • Using MouseListener to select a range of cells in a grid
  • Center align outputs in ipython notebook
  • Jquery popup on mouse over of calendar control
  • custom UITableViewCell with image for highlighting
  • How can I sort a a table with VBA with given text condition?
  • print() is showing quotation marks in results
  • Make VS2015 use angular-cli ng at build time in a .NET project
  • Android fill_parent issue
  • Insert into database using onclick function
  • Get object from AWS S3 as a stream
  • Sending data from AppleScript to FileMaker records
  • Can I make an Android app that runs a web view in Chrome 39?
  • vba code to select only visible cells in specific column except heading
  • Web-crawler for facebook in python
  • align graphs with different xlab
  • Return words with double consecutive letters
  • Unanticipated behavior
  • using conditional logic : check if record exists; if it does, update it, if not, create it
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • How do I configure my settings file to work with unit tests?
  • IndexOutOfRangeException on multidimensional array despite using GetLength check
  • Can't mass-assign protected attributes when import data from csv file
  • Reading document lines to the user (python)
  • Binding checkboxes to object values in AngularJs
  • Observable and ngFor in Angular 2
  • How to Embed XSL into XML
  • UserPrincipal.Current returns apppool on IIS
  • Unable to use reactive element in my shiny app
  • Conditional In-Line CSS for IE and Others?
  • Python/Django TangoWithDjango Models and Databases