a couple of minor glitcon text exporter.

Hi, I don't know if this is the right place to submit a patch.

I have found a couple of minor problems regarding text exporter:

1) when setting JRTextExporterParameter.CHARACTER_WIDTH and JRTextExporterParameter.CHARACTER_HEIGHT, if you want to use float values, you can, but in the getFloatParameter function, there is returned a intValue ! so you loose the decimals.

2) the getHeightInChars and getWidthInChars functions use Math.roud. I think they should use (int) Math.ceil to adjust some problem when using multiline fields.

3) when going to an other row (On multi line fields with long phrases), you have to add a new space to the StringBuffer[] rows array. otherways, you will loose last rows, skipped on text file.because you advance rowIndex for the same previous row !

4) under exportText, ther is:

StringTokenizer spaceTokenizer = new StringTokenizer(line, " ", true);

I think it whould be:

StringTokenizer spaceTokenizer = new StringTokenizer(line.trim(), " ", true);
to solve empty lines (For example, a row ending witha space and this space wants to go to next line.


Here: a class witch extends JRTextExporter and implements my modificatinos.
(It is just a sunto of all modification I have made)


best regards.

p.s. Jasper reports is owesome !









brisa's picture
Joined: Apr 2 2010 - 3:05am
Last seen: 13 years 5 months ago

0 Answers:

No answers yet