Wordwrap to each line with fixed textbox height

Stimulsoft Reports.NET discussion
Post Reply
ymc
Posts: 31
Joined: Tue Oct 30, 2007 9:00 pm
Location: Hong Kong

Wordwrap to each line with fixed textbox height

Post by ymc »

I have a Databand with a textbox height 8 and it can contain 50 characters.
Recently, I have more then 50 up to 4000.
So, I use a wordwrap and can grow function....However, I want to display first 50 characters in the first line textbox with no grow and the following 50 charaters in the second line textbox.
It is because I have a preprint form of dot matrix printer with the line on it. You can imaging you have a paper with line on it and write on the paper for each line.
For the wordwrap function you cannot control the height and the place for display.
Thus, how can I do it?
I would like to think about if wordwrap first count out how many line after wrapped, for example 5 line wrapped and create 5 count of the databand and put each line of wrapped word in the textbox and display another line of word in other count of databand.
One more thing, the databand have other textfield to display but those fields just need to display once, no need to display with the word wrapped databand.
Any idea?
Image
Thx
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Wordwrap to each line with fixed textbox height

Post by Vital »

Hello,

If i right understand you can use property RenderTo of text component. Text component must have properties CanGrow and WordWrap = true.

Thank you.
ymc
Posts: 31
Joined: Tue Oct 30, 2007 9:00 pm
Location: Hong Kong

Wordwrap to each line with fixed textbox height

Post by ymc »

I think there may have some misunderstanding.
I have uploaded another pic for reference.
For the middle row the text need to separate into the pre-printed form line...if I just use the wordwrap and can grow function...I cannot control the space between each line thus the following records will shift the space up or down.
Thus, I would like to make the description textbox can wrap as the pic shown as to keep it printing in each pre-printed line.
Thx.

Image
ymc
Posts: 31
Joined: Tue Oct 30, 2007 9:00 pm
Location: Hong Kong

Wordwrap to each line with fixed textbox height

Post by ymc »

Any idea?
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Wordwrap to each line with fixed textbox height

Post by Edward »

ymc wrote:I think there may have some misunderstanding.
I have uploaded another pic for reference.
For the middle row the text need to separate into the pre-printed form line...if I just use the wordwrap and can grow function...I cannot control the space between each line thus the following records will shift the space up or down.
Thus, I would like to make the description textbox can wrap as the pic shown as to keep it printing in each pre-printed line.
The result you need can be achieved with help of the RenderTo property, custom defined function which adds a line break symbol after certain number of symbols in the input string and a set of textboxes. These textboxes must be placed directly on page for exact matching of your pre-printed form.

Please see the example report which is resolving the required task. Function SplitMyText is defined in the 'Code' tab. This function just adds line break symbols after each tenth symbol.

So each Text will contain exactly ten symbols per one StiText. Please note that all stiText in 'Wysiwyg' mode, because this method of rendering requires exact calculations of the height and width of the StiText component.

Thank you.
Attachments
37.RenderTo.mrt
(16.31 KiB) Downloaded 526 times
ymc
Posts: 31
Joined: Tue Oct 30, 2007 9:00 pm
Location: Hong Kong

Wordwrap to each line with fixed textbox height

Post by ymc »

oh..thx...but how about using typograhic...coz I have chinese in it so the result come out with no chinese display just a not machine code.

Moreover, in the sample the number of textbox is fixed...But I would like to know any method can auto generate out the textbox box like
400/50 words per line --> 8 textbox fit with the line...and the remain record can foloowing the text splitted with the right position.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Wordwrap to each line with fixed textbox height

Post by Edward »

Ok, here is the decision based on all previous information.

Please open it in the Demo.exe example application from the standard delivery, because Demo database is used there.

Thank you.

Attachments
38.CountDataInDetailBand.mrt
(19.75 KiB) Downloaded 581 times
ymc
Posts: 31
Joined: Tue Oct 30, 2007 9:00 pm
Location: Hong Kong

Wordwrap to each line with fixed textbox height

Post by ymc »

Very Helful.
But another issue come out. I have send the sample mrt/database/screen shot to support[@]stimulsoft.com

Thx.
Post Reply