albertj Posted November 5, 2007 Share Posted November 5, 2007 Hi, I have a problem with IReport 2.0.2 I would like to generate a serial letter with IReport. The serial letter should be exported to PDF. The export to PDF is still working. The letter is built-on as follows:Address, subject, salutation, body and complimentary close. The form will be generated in IReport dynamically with different variables, which fill the body of the letter. The problem is, that between the body and the complimentary close is sometimes an unmeant line break in the PDF view. It depends if the text in the variable is narrow to the border of the Form. If that appears, IReport generates an additional line break between the body and the complimentary close. How can I fix that problem? Example for the content of a IReport Variable: "hiermit bedanken wir uns nochmals bei Ihnen für das geführte Vorstellungsgespräch und das damit entgegengebrachte Interesse an unserem Unternehmen.nn"+ "Leider müssen wir Ihnen heute mitteilen, dass wir uns für eine/n Mitbewerber/in entscheiden werden.nr"+ "Es tut uns leid, dass wir Ihnen keine positive Nachricht übersenden können. Deshalb erhalten Sie in der Anlage die uns freundliche überlassenen Bewerbungsunterlagen mit Dank zurück.nr" + "Für das Vertrauen, das Sie uns durch Ihre Bewerbung entgegengebracht haben bedanken wir uns und wünschen Ihnen für Ihren weiteren Berufsweg alles Gute und weiterhin viel Erfolg." Display example: START------------------------------------------------------------------------------------------ hiermit bedanken wir uns nochmals bei Ihnen für das geführte Vorstellungsgespräch und das damit entgegengebrachte Interesse an unserem Unternehmen. Leider müssen wir Ihnen heute mitteilen, dass wir uns für eine/n Mitbewerber/in entscheiden werden. Es tut uns leid, dass wir Ihnen keine positive Nachricht übersenden können. Deshalb erhalten Sie in der Anlage die uns freundliche überlassenen Bewerbungsunterlagen mit Dank zurück. Für das Vertrauen, das Sie uns durch Ihre Bewerbung entgegengebracht haben bedanken wir uns und wünschen Ihnen für Ihren weiteren Berufsweg alles Gute und weiterhin viel Erfolg. Mit freundlichen Grüßen Jens Albert END------------------------------------------------------------------------------------------------- There should only one line break between the Body and the complimentary close. Link to comment Share on other sites More sharing options...
albertj Posted November 7, 2007 Author Share Posted November 7, 2007 Please can anybody help me? It is an urgant problem!:blush: Link to comment Share on other sites More sharing options...
Pedja Posted November 7, 2007 Share Posted November 7, 2007 It's hard to say, could you attach your .jrxml? Do you use subreports? Is "Strech with overflow" set on the field which shows the body of the letter? Link to comment Share on other sites More sharing options...
albertj Posted November 7, 2007 Author Share Posted November 7, 2007 Hi. Thanks for your quick help! There are no subreports in the formular. "Stretch with overflow" is set by the textfield who creates the body of the formular. I attached the .jrxml-file. Please have a look at the variables called "NachVorstellung" and "NachVorstellungOhne". These two variables are not working very well, because they are creating an unmeant line break between the body and the complementary close. There should only one line break between the body and the complementary close in each serial letter.Whatever variable is used. I hope it will help you to understand my problem! Thanks Jens [file name=Test_Forum.jrxml size=33853]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/Test_Forum.jrxml[/file]TestPost edited by: albertj, at: 2007/11/07 14:39 Link to comment Share on other sites More sharing options...
Pedja Posted November 7, 2007 Share Posted November 7, 2007 I can't test your report and isolate the problem, because I don't understand German and the report is too complicated to be analyzed without running it. But, you can try to test the "Stretch with overflow" and see if it is the root of the problem (put some background color on the body element to see if it is responsible for the extra row). I'm sorry for not being able to help you more with this issue. Link to comment Share on other sites More sharing options...
albertj Posted November 7, 2007 Author Share Posted November 7, 2007 Hi! once more thank you for your help! I will try your proposal to fix the problem. I think the problem is, that the content of some variables is to long ant the text reach the boarder of the formular. If that happens IReport generates a additional line brake at the and of the Textfield. Could it be a problem? The text in the variables should not a problem for you because it is German. Because the language of the text is independent. It is only the length of the text who is important i think. for example:boarder --blank / --Hallo my Name is Jens ////////////////////////////----> No additional line break --Hallo my Name is Jens test123 test123 test123 test----> Ireport generates a unmeant line breakt, because the text is near to the boarder!!!! best wishes Jens! Post edited by: albertj, at: 2007/11/07 14:54Post edited by: albertj, at: 2007/11/07 14:56 Link to comment Share on other sites More sharing options...
Pedja Posted November 7, 2007 Share Posted November 7, 2007 The German text content is not the problem for me, but the names of the variables, i fully understand your problem. But, more than that it is the complex variable expressions which I can not test. I never worked with very long content so I don't know for sure if that is the problem, but it could be. Can you try to isolate the problem by splitting the long text variables into several smaller, and see if that works? Or, if you have the time, can you make a test report with only variables (like in your report) and static text, but without fields returned from database? That way maybe I could help you some more. Link to comment Share on other sites More sharing options...
albertj Posted November 8, 2007 Author Share Posted November 8, 2007 Pedja wrote:The German text content is not the problem for me, but the names of the variables, i fully understand your problem. But, more than that it is the complex variable expressions which I can not test. I never worked with very long content so I don't know for sure if that is the problem, but it could be. Can you try to isolate the problem by splitting the long text variables into several smaller, and see if that works? Or, if you have the time, can you make a test report with only variables (like in your report) and static text, but without fields returned from database? That way maybe I could help you some more. Hi! to split the long variables into several smaller could not be the solution of my problem. I have already tried some other tests to fix the problem. For example:Variable "NachVorstellung" Content-->"hiermit bedanken wir uns nochmals bei Ihnen für das geführte Vorstellungsgespräch und das damit entgegengebrachte Interesse an unserem Unternehmen.nn"+"Leider müssen wir Ihnen heute mitteilen, dass wir uns für eine/n Mitbewerber/in entscheiden werden.nr"+"Es tut uns leid, dass wir Ihnen keine positive Nachricht übersenden können. Deshalb erhalten Sie in der Anlage die uns freundliche überlassenen Bewerbungsunterlagen mit Dank zurück.nr" +"Für das Vertrauen, das Sie uns durch Ihre Bewerbung entgegengebracht haben bedanken wir uns und wünschen Ihnen für Ihren weiteren Berufsweg alles Gute und weiterhin viel Erfolg." I have inclosed a screenshot of the PDF generated document. In this PDF you will see, that IReports generates an unmeant linebreak between the body and the complimentary close. If i delete the last two sentences who are near to the boarder of the document, the PDF works! The question is: Why generates IReport an additional line breake when the text sometimes reaches near to the boarder???? Best wishes Jens size=400]http://www.jasperforge.org/components/com_joomlaboard/uploaded/images/PDFexport.jpgPost edited by: albertj, at: 2007/11/08 06:17 Link to comment Share on other sites More sharing options...
juandiego Posted November 8, 2007 Share Posted November 8, 2007 Hi, it seems that after the word 'zuruck' you put these two characters: backslash-n-backslash-r. I think that the backslashes are not shown in your post because of forum-related issues but you meant them to be there.So I think the problem is: 1) The word 'zuruck' reaches the end of its line2) JasperReports concludes that there is no room in that line so the next word has to be in the next line (just as Microsoft Word does).3) The next word is backslash-n-backslash-r (a line break), so in the line after the one with 'zuruck' JasperReports writes a line break4) As a result, a blank line is added I'm just theorizing, by the way, so make some tests to confirm.Post edited by: juandiego, at: 2007/11/08 07:14 Link to comment Share on other sites More sharing options...
Pedja Posted November 8, 2007 Share Posted November 8, 2007 Hi, When I run the report, I get the result without the extra line break (screenshot attached), the only thing I changed is the font (Helvetica) but I don't think it has anything to do with it. It must be some simple thing that all of us overlooked! size=380]http://www.jasperforge.org/components/com_joomlaboard/uploaded/images/untitled-390a9d43b212a564ff08ee8b37d31ad9.JPGPost edited by: Pedja, at: 2007/11/08 08:08 Link to comment Share on other sites More sharing options...
albertj Posted November 9, 2007 Author Share Posted November 9, 2007 juandiego wrote:Hi, it seems that after the word 'zuruck' you put these two characters: backslash-n-backslash-r. I think that the backslashes are not shown in your post because of forum-related issues but you meant them to be there.So I think the problem is:1) The word 'zuruck' reaches the end of its line2) JasperReports concludes that there is no room in that line so the next word has to be in the next line (just as Microsoft Word does).3) The next word is backslash-n-backslash-r (a line break), so in the line after the one with 'zuruck' JasperReports writes a line break4) As a result, a blank line is addedI'm just theorizing, by the way, so make some tests to confirm.<br><br>Post edited by: juandiego, at: 2007/11/08 07:14 Hi thank you for your reply! Is there any parameter to fix that problem? Because if I delete alle backslash-n-backslash-r in the variable, and the last word of the textblock reaches near to the boarder the same effect appears! If a take a other font i have the same problem but with other variables who are filling the body of the serial letter. So i think the unmeant line break appears every time, if the last word of a textblock is near to the boarder, independent wich font is used. wishes Jens.Post edited by: albertj, at: 2007/11/09 12:20 Link to comment Share on other sites More sharing options...
albertj Posted November 12, 2007 Author Share Posted November 12, 2007 Does anybody knows a parameter to fix that problem?I become desperate :woohoo: ! Link to comment Share on other sites More sharing options...
Pedja Posted November 12, 2007 Share Posted November 12, 2007 The last thing that comes to my mind - what version of iText.jar do you use? Maybe it has something to do with it, since it is the jar that generates the pdf. I use itext-2.0.4.jar, try with it and see if there is any improvement. Link to comment Share on other sites More sharing options...
albertj Posted November 13, 2007 Author Share Posted November 13, 2007 Pedja wrote:The last thing that comes to my mind - what version of iText.jar do you use? Maybe it has something to do with it, since it is the jar that generates the pdf. I use itext-2.0.4.jar, try with it and see if there is any improvement. Hi! Thank you for your proposal! I will try it as soon as possible.:) Jens Link to comment Share on other sites More sharing options...
albertj Posted November 14, 2007 Author Share Posted November 14, 2007 albertj wrote:Pedja wrote:The last thing that comes to my mind - what version of iText.jar do you use? Maybe it has something to do with it, since it is the jar that generates the pdf. I use itext-2.0.4.jar, try with it and see if there is any improvement. Hi! Thank you for your proposal! I will try it as soon as possible.:) Jens Hi Pedja, today i have tryed your propos but it dosn't fix the problem. I don't know what else i should do :unsure: :unsure: ! Link to comment Share on other sites More sharing options...
albertj Posted November 19, 2007 Author Share Posted November 19, 2007 help i need sombody help.....:) Does anybody else know's a solution???? Link to comment Share on other sites More sharing options...
albertj Posted November 27, 2007 Author Share Posted November 27, 2007 The problem is not fixed yet :blush: :blush: !I need a admin who knows the answer :) :) Link to comment Share on other sites More sharing options...
absoft Posted January 25, 2008 Share Posted January 25, 2008 Hello albertj, did you find any solution about your problem yet? Because have got a quite similar problem. In the screenshot of the PDF report you see that there is a line break to much after:- Pers.-Nr. (Gehaltsabr.)- each date field- each "Erfassungskennzeichen" field Does anyone has an idea on that: I've tested it with different JasperReports and iText version (now using the current ones), but nothing helps. I'm happy for any ideas! Best regardsAndreas [file name=wTAccount_test.xml size=120202]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/wTAccount_test.xml%5B/file] size=400]http://www.jasperforge.org/components/com_joomlaboard/uploaded/images/report_test2.pngPost edited by: absoft, at: 2008/01/25 09:25 Link to comment Share on other sites More sharing options...
tetelle31 Posted January 31, 2008 Share Posted January 31, 2008 Hello I have the same problem too :blink: There is a line break to much after my field, and the text doesn't complete all width before... Thanks for ideas Estelle Link to comment Share on other sites More sharing options...
absoft Posted February 13, 2008 Share Posted February 13, 2008 Hello together again, does really nobody has any idea about that?No admins looking into this forum? I've again attached a screenshot with this unmeant line breaks. I've tested this template file on two JBoss servers now and the strange thing is that it worked on one of them (running on a Windows based system). Only on the other server (running on Debian Linux) this bug occurs. May it be possible that on the Linux system a font or something like that is missing/different, so it calculates the needed space in a different way? I would be really happy for any ideas or help. Thanks you very much in advanceAndreas size=400]http://www.jasperforge.org/components/com_joomlaboard/uploaded/images/jasper.pngPost edited by: absoft, at: 2008/02/13 12:15 Link to comment Share on other sites More sharing options...
venky01 Posted February 20, 2008 Share Posted February 20, 2008 Did you find any solution please? I am also having the same problem and looks like the vertical space between Linux and Windows are different. Thanks,Venkat. Link to comment Share on other sites More sharing options...
giulio Posted February 20, 2008 Share Posted February 20, 2008 YEs, it's possible that on Linux there is a different font.Try to increment your fields height. Giulio Link to comment Share on other sites More sharing options...
absoft Posted February 21, 2008 Share Posted February 21, 2008 Hello Giulio, don't understand: why incrementing the fields height should help in this case, bacause the width of the fields is the problem? Anyway, I played arround a little bit with the width of the fields now, because I don't see any solution for this problem here in the near future and with making the fields larger (in width) the unmeant line breaks disappeared indeed. This, of course, doesn't solve the problem itself, because now I have to leave much space in each field for not having this line breaks... :( Therefore it would be great if this bug could be solved for the future and the font width would be calculated correctly also on Linux operating systems. Best regardsAndreashttp://www.ab-soft.de Link to comment Share on other sites More sharing options...
rameshinvites Posted December 13, 2008 Share Posted December 13, 2008 Hi,I am Ramesh, using jasper report to generate PDF. I developed dynamic report but is there way to define different font style for the combination of text. For example if the text test123. for test I want to use Arial and 123 I want to use Verdona.Your earliest reply wld be much appreciated.... Link to comment Share on other sites More sharing options...
tarunsapra Posted April 30, 2009 Share Posted April 30, 2009 I am facing the same problem with Frutiger fonts ...it's really irritating at times to see this unmeant Line Break 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