Hi all.
I have a problem to set the size of a rectangle dynamically.
I have a text "Text10" and a Data Source I get the size of the text box for each record to paint.
I tried setting the value of the text: {this.Text10.ClientRectangle = new Stimulsoft.Base.Drawing.RectangleD (7.4, 0.1, DataSource.SizeText, 0.5)}
The report paints the first text to default size in the design. The second text is painted with the size of the first. The third with the size of the second.
Do you understand?
example:
My Data Source with 3 records.
1. 6
2. 8
3. 2
What the report shows:
1. | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (default text size in design, 10.6)
2. | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (6)
3. | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (8)
So I show 3 records, but as the first is bad, all others are displayed wrong.
Can you help me?
Text size dynamically
Text size dynamically
Hello.
If you still have any problem, send us your report template with data.
Thank you.
Please, try to use your expression in the Before Print event.Rodrigo wrote:I have a problem to set the size of a rectangle dynamically.
I have a text "Text10" and a Data Source I get the size of the text box for each record to paint.
I tried setting the value of the text: {this.Text10.ClientRectangle = new Stimulsoft.Base.Drawing.RectangleD (7.4, 0.1, DataSource.SizeText, 0.5)}
The report paints the first text to default size in the design. The second text is painted with the size of the first. The third with the size of the second.
Do you understand?
example:
My Data Source with 3 records.
1. 6
2. 8
3. 2
What the report shows:
1. | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (default text size in design, 10.6)
2. | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (6)
3. | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (8)
So I show 3 records, but as the first is bad, all others are displayed wrong.
Can you help me?
If you still have any problem, send us your report template with data.
Thank you.
Text size dynamically
I tried setting the expression "new Stimulsoft.Base.Drawing.RectangleD (7.4, 0.1, DataSource.SizeText, 0.5)" in the code view, but when I save the changes, updates itself and returns to "new Stimulsoft. Base.Drawing.RectangleD (7.4, 0.1, 10.6, 0.5) "
Thanks for answering.
Thanks for answering.
Text size dynamically
This code in in the region with message:Rodrigo wrote:I tried setting the expression "new Stimulsoft.Base.Drawing.RectangleD (7.4, 0.1, DataSource.SizeText, 0.5)" in the code view, but when I save the changes, updates itself and returns to "new Stimulsoft. Base.Drawing.RectangleD (7.4, 0.1, 10.6, 0.5) "
Thanks for answering.
Code: Select all
#region StiReport Designer generated code - do not modify
In next video you could find out when to change Events How to Add Event Handler to Component
Thank you.