schrepfler Posted August 10, 2006 Share Posted August 10, 2006 On exporting my data in a excel cell, if the text is too long it gets split in another row which is a complete nonsense as it's giving the exported data a whole new meaning. My combinations of exporting the cell and setting properties on the field left me with either not writing the full output because of no space or writing it in a next line. What's the correct way to print the data into the cell even if it's not visible in it's printable form? Post edited by: schrepfler, at: 2006/08/10 02:43 Link to comment Share on other sites More sharing options...
teodord Posted August 10, 2006 Share Posted August 10, 2006 Hi, Could you attach some files to see the problem?Do you mean the text spills into the next cell to the right of the current cell? Thank you,Teodor Link to comment Share on other sites More sharing options...
schrepfler Posted August 11, 2006 Author Share Posted August 11, 2006 Hi Teodor,I'm attaching the xml file, the pdf and excel files (one pair normal and the other with "Strech with overflow" on the street column.) the query is something like this but I've hardcoded the values in order to leave out parameters. SELECT * FROM ELEVATORS AS E JOIN (SELECT B.ELEVATOR, COUNT(B.ID) FROM BREAKDOWNS AS B WHERE INSERTDATE BETWEEN 20040101 AND 20070101 GROUP BY B.ELEVATOR) AS TEMP ON E.ID = TEMP.ELEVATOR WHERE E.SOCIETY=1 AND COUNT > 1 ORDER BY COUNT DESC; As you can see between the reports the one without the overflow clearly lacks parts of the string (VIA CAPO DI instead of VIA CAPO DI LUCCA, and PIAZZA DI PORTA instead of PIAZZA DI PORTA S.DONATO), I'm referring to the excel versions.What should I do in order to have the string not overflow to the next row? I don't mind if the text is invisible because of the column width as the user can expand it in excel but putting the same data on another row is not correct.Thanks in advanceattached files below [file name=ascensorimalati.zip size=9927]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/ascensorimalati.zip[/file] Link to comment Share on other sites More sharing options...
schrepfler Posted August 14, 2006 Author Share Posted August 14, 2006 Anyone?Also, second problem I've encountered is this. I've tried to insert multiple fields in an element by doing:$F{street} + ", " + $F{model} + ", " + $F{brand}the expression prints correctly in pdf but doesn't print anything in excel.Is it just me or is the excel support seriously broken? Link to comment Share on other sites More sharing options...
ionutned Posted August 14, 2006 Share Posted August 14, 2006 You cannot just hide the text, since the text length is calculated at fill time. The excel export is just an approximation of the actual report. The fact that an excel cell can hold a text larger that it can display is just a coincidence, the Jasper engine will always cut off text to fit in its allocated space on the report design (or expand it to the next line). Link to comment Share on other sites More sharing options...
schrepfler Posted August 15, 2006 Author Share Posted August 15, 2006 Is there some parameter that would override this kind of behaviour? I understand jasper was architected for print but I feel this is a great bug, especially if jasper wants to target more formats that pdf. Also, what about the expression, how come it doesn't print anything under excel and under pdf it prints ok? Link to comment Share on other sites More sharing options...
schrepfler Posted September 8, 2006 Author Share Posted September 8, 2006 ionutned wrote:You cannot just hide the text, since the text length is calculated at fill time. The excel export is just an approximation of the actual report. The fact that an excel cell can hold a text larger that it can display is just a coincidence, the Jasper engine will always cut off text to fit in its allocated space on the report design (or expand it to the next line).Can the jasperreports developers confirm this is still true in the current design and is there a way to go around this? Both excel (with cell overflow) and html (with tooltips) could use text even if it's not visible. Perhaps even pdf has tooltips? If jasperreports would like to go beyond print I believe some design choices should be revisited.Post edited by: schrepfler, at: 2006/09/08 16:35 Link to comment Share on other sites More sharing options...
kasiopi Posted March 19, 2008 Share Posted March 19, 2008 the Jasper engine will always cut off text to fit in its allocated space on the report design (or expand it to the next line). This is still happening? Can someone confirm that there is no any property that can be set so as text not to be cut, while keeping a fixed column's width ? Link to comment Share on other sites More sharing options...
lucianc Posted March 19, 2008 Share Posted March 19, 2008 See the net.sf.jasperreports.print.keep.full.text property which was introduced in JR 2.0.3. The flag affects data-oriented exporters such as XLS and CSV. HTH,Lucian Link to comment Share on other sites More sharing options...
kasiopi Posted March 26, 2008 Share Posted March 26, 2008 See the net.sf.jasperreports.print.keep.full.text property which was introduced in JR 2.0.3. The flag affects data-oriented exporters such as XLS and CSV. This worked! Thank you very much Lucian. Also, I searched further the forum and found a related issue. But could I pass this property through java code; Have searched in JRExporterParameter and in some subclasses, e.g. JRXlsExporterParameter, but nothing found. Thanks again. Link to comment Share on other sites More sharing options...
lucianc Posted March 26, 2008 Share Posted March 26, 2008 kasiopi wrote:But could I pass this property through java code; Have searched in JRExporterParameter and in some subclasses, e.g. JRXlsExporterParameter, but nothing found. This is not an exporter parameter, it is a report/global property which needs to be set when the report is filled so that the filler knows to preserver the entire texts. If this property is not set at the moment the report gets filled, the XLS exporter will not be able to display the entire texts since these texts would simply not be present in the filled report. Regards,Lucian Link to comment Share on other sites More sharing options...
kasiopi Posted March 26, 2008 Share Posted March 26, 2008 ok, this is clear to me. thank you very much Lucian Link to comment Share on other sites More sharing options...
mattwm Posted September 15, 2008 Share Posted September 15, 2008 I could not find any of this in version 2.0.5. Did they take it out by then?Seems like all these links are invalid now too... can someone give a detailed explanation on how to fix this? Link to comment Share on other sites More sharing options...
lucianc Posted October 20, 2008 Share Posted October 20, 2008 mattwm6698Wrote: Seems like all these links are invalid now too... can someone give a detailed explanation on how to fix this? The updated link is http://jasperforge.org/uploads/publish//jasperreportswebsite/JR%20Website/jasperreports_configuration_reference.html#net.sf.jasperreports.print.keep.full.textRegards,Lucian Link to comment Share on other sites More sharing options...
huytran Posted May 7, 2009 Share Posted May 7, 2009 Hi Lucian,I have the same problem. Can you give me the line of code that set that property? Many thanks Link to comment Share on other sites More sharing options...
lucianc Posted May 20, 2009 Share Posted May 20, 2009 huytranWrote: I have the same problem. Can you give me the line of code that set that property? If you want to set this propertly globally (i.e. for all texts in all reports, see below).Regards,LucianCode:JRProperties.setProperty(JRTextElement.PROPERTY_PRINT_KEEP_FULL_TEXT, true); Link to comment Share on other sites More sharing options...
tranquoctu1988 Posted May 5, 2011 Share Posted May 5, 2011 I set this property as you suggest but XLSX export still split my data into 2 cell if its column width is too low.Did i do something wrong or lost something important? Thank you so much.Quoc Tu Tran Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now