Problem with stretch with overflow

0

Hi to everybody! I'm working with ireport and i found it fantastic! But... i've a problem... I have a textfield with the property "Strech with overflow" checked. It works well untill a sort of maximum lenght of this texfield area... I don't know how and why...

The textfield is stretched up to a sort of upper limit.

Is there anyone who can explain or help me in this problem?

Thanks, Leo

leo0o0o's picture
Joined: Sep 18 2009 - 4:36am
Last seen: 4 years 10 months ago

7 Answers:

0

Hi,

 

I don't see how this could happend. Can you post a screenshot or some files showing this problem?

 

Thanks,

Teodor

 

teodord's picture
2845
Joined: Jun 30 2006 - 9:00am
Last seen: 1 month 4 weeks ago
0

i post a screenshot where you can see the textfield "argomenti". The text is "questa è una prova" repeated more times. As you can see the text of "Argomenti" on the top is only a line and in the bottom the text is more long. You can see that the text ends with "questa è " but the text continues...

i put here also a part of code.

Code:
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="100" y="94" width="423" height="16"/>
<textElement>
<font fontName="Times New Roman" size="10" isPdfEmbedded="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{argomenti}]]></textFieldExpression>
</textField>

if you want i can paste the entire code... as you want



Post Edited by leo0o0o at 09/18/2009 14:34
leo0o0o's picture
Joined: Sep 18 2009 - 4:36am
Last seen: 4 years 10 months ago
0

Hi,

 

If what you are showing us is the PDF format, you need to read this FAQ:

http://jasperforge.org/uploads/publish/jasperreportswebsite/trunk/faq.html?group_id=252#FAQ25

 

I hope this helps.
Teodor

 

teodord's picture
2845
Joined: Jun 30 2006 - 9:00am
Last seen: 1 month 4 weeks ago
0
thank you very much Teodor! you solved my problem in only one minute!
leo0o0o's picture
Joined: Sep 18 2009 - 4:36am
Last seen: 4 years 10 months ago
0

Hi,

Seeing Teodor's smiling face good. I Reaaly appriciate JasperReports projects.Beside I'm a loyal fun of JasperReport. Dear Jasper Reports developers, I would likte to share my study,

I had a problem on designing subreports that cause exceeding Main report size(B'cause my report's all ojects was staticText). So I solved it from java side. It wasn't easy I cut the exceeding part and created a exceeding_part.jrxml then I compile this part and add JasperViewer object this part and I send page/total page paremeters to the report to see pageNums. Anyway...

I have another problem now. I have a textField and data in it overflows. My band's splitType is Stretch and textField isStretchWithOverflow and reportElement isPrintWhenDetailOverflows however IReport and myJavaApp couldnt start report ,just in a loop. When I change page Print Order horizantal amazing it works but objects cant push each other. Interwine,mesh. Text on text. Beside this never split to other page. Am I missing something?

All of problems I bump into I love jasperReports in a crazy way  

After Oracle Reports 2.5 Jasper Reports is a great goal.

& Thank you far adding myTurkish resource bundle.I felt as if I'm a part of your project Teodor. Thank you for meeting me with Exciting Jasper Reports. Otherwise I would die with Oracle's report server

Best Regards,

Code:
<!--My band-->
	<detail>
		<band height="590" splitType="Stretch">
 
<!--AND my report's relavant part-->
 
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement x="77" y="485" width="141" height="15" isPrintWhenDetailOverflows="true"/>
				<textElement>
					<font pdfEncoding="Cp1254"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["AAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBB"]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement x="78" y="500" width="141" height="15" isPrintWhenDetailOverflows="true"/>
				<textElement>
					<font pdfEncoding="Cp1254"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["AAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBB"]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="true">
				<reportElement x="246" y="485" width="141" height="15" isPrintWhenDetailOverflows="true"/>
				<textElement>
					<font pdfEncoding="Cp1254"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["AAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBB"]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="94" y="527" width="121" height="15"/>
				<textElement>
					<font fontName="Arial" isBold="true"/>
				</textElement>
				<text><![CDATA[Sistolik Gradiyent(mmHg)]]></text>
			</staticText>
 
</td></tr></tbody></table>
davutgurbuz's picture
Joined: Apr 12 2010 - 8:02am
Last seen: 1 year 10 months ago
0

Hi,

 

If you have large bands made of static content, make sure you use splitType="Immediate" so that you can thus make bands that are larger than one page. You probably complicated things too much by using the JR API to achieve your goal.

 

The second problem you are talking about, the infinite look, is caused by the isPrintWhenDetailOverflow="true" flags on your 3 expanding fields.

You need to understand what this flag does and thus realize your design is a bit inconsistent.

The flag tells the engine that in case the band overflows to a new page, those text fields should start again, and at the same Y position.

Because those text fields are so low on the page (high Y value), they stretch, cause the detail to break, then they need to be printed again on the new page, at the same low position, where they strech again, causing the page to break again, and so on forever...

In my opinion, you don't need isPrintWhenDetailOverflows="true" for those text fields, or at least, you should split the detail section in two bands (you can have more than one detail now in JR/iR) and have the text fields isolated in their own band.

When filling reports horizontally, the detail band does not stretch and this is why you don't enter the infinite loop situation descriebed above.

 

I hope this helps.
Teodor

 

teodord's picture
2845
Joined: Jun 30 2006 - 9:00am
Last seen: 1 month 4 weeks ago
0

Hello,

Thanks for replying Master,

Firstly,

Yes I have static content, In fact I produce content from database. One of my friend designed a form design software. The platform is oracle forms 4.5. She is in trouble of reporting by oracle reports 2.5 platform depanding reports restrictions. So I got the design from database as a ResultSet ordered by Y values.I produce JRXML dynamically. This is my subreport runs with EmptyDataSource. Even I use immediate ,stretch or perevent on main report's detail band ,when subreports design exceed main reports design(page height) I got this error.I didnt make things comlicated. They were already comlicated.

net.sf.jasperreports.engine.design.JRValidationException: Band height validation for subreport "report" failed in the current page context (height = 630, top margin = 20, bottom margin = 20) : 
     1. The detail section, the page and column headers and footers and the margins do not fit the page height. 

I noted the produced report in my previous post on the forum. Now I attach a new main report page setup(height value)  smaller than subreport. Even I use Immediate it doesnt work. It throws this exception. Yes I'm new about JasperReports but I couldnt got answer from experts around me, or coulnt find a solution on the net. So I decided to share on the forum. I'm sure there is a solution,,,

Secondly ,

Yes using a second detail band really solved my problem at first !

But I mentioned before, I'm designing report dynamically. So the second detail band closes all the raw. So some objects could be on the middle of two bands. This causes invalid report desing. 1. Warning : Element bottom reaches outside band area : y=589 height=15 band-height=600

In oracle reports when you cover a field by a frame objects pushes each other. I meant stretch works fine.But in Jasper I need to use another band. Jasper Frame cant do that.

So in my software desing,

5 CLS :)

10 resultset got first element on the page depending on Y pos

20 when resultset.next value is a Scroolable text area object create new band tag for generated jrxml

30 close new band using <band/> tab.

40 GO 5 OR BREAK :D

50 END

//allusion to gwbasic

I mean software runs line by line. In this desing things got complicated. Maybe I need to store previous bands and objects Y position and height in an array not to let position an object on the middle of two band. And to store some objects in new detail band. Or I need talk with my friend to change her designer and add a new object band start line and band end line. This is better for me :D

I do not see myself an expert but I designed a system, A new Gui and some rules. depending on my new tagging ,software developers may restrict viewer buttons , and restrictions of exporting , exporting format,printing + e-mailing or embeding report to db as a serialized object etc. I attached a screenshot. I extended some classes JButton, JRViewer etc. I built a world for me! But I cant live in this world sadly :(

Finally,

I thought that users may connect a shared drive(mapped network drive) to run this reporting system. So I imagined I can put Java runtime and jasper libs to this shared folder. And I did it.

When I tested my system. I got my first report in 30 seconds. Its long time for users. They havent patience like a software developer. Then I remove groovy lib. Its 1.5MB it effected but not enough and I need groovy. In fact when user run another report it comes faster. Because I dont reconnect db and create Reporting GUI, I just add  a tab to my GUI. Thats all. Yes I know connecting db and network status is importent at this point but I need some tips to load jasper libs faster. Beside this jasper has a new plus. Because I need to close current report to run another report in ora-reports.

This is my story, This is my challenging study. I cant imagine how things challenging for you.

Maybe you have some offers for us to run jasperReports quicker as well.

And thanks again for replying this poor developer,

Note : In Turkey day and time is :10.17.2010 01:04 :)

Best Regards,



Post Edited by davutgurbuz at 10/16/2010 21:37
davutgurbuz's picture
Joined: Apr 12 2010 - 8:02am
Last seen: 1 year 10 months ago
Feedback