Problem with changing size of Rectangle

Stimulsoft Reports.NET discussion
Post Reply
Stephan1
Posts: 122
Joined: Fri Aug 31, 2007 7:22 am
Location: Germany

Problem with changing size of Rectangle

Post by Stephan1 »

Hi,

we have a problem changing a size of a Rectangle component via code of our report. Version is the last from 02.11.2009.

We're using the following code:

Dim Rectangle1 As Stimulsoft.Report.Components.StiRectanglePrimitive
Rectangle1= stireport1.GetComponentByName("Rectangle1")
Rectangle1.Width = 15.6

When the report is show it still show the old size of 19.8.

For other components like StiShape
Dim GeoForm As Stimulsoft.Report.Components.StiShape
GeoForm = stireport1.GetComponentByName("Geom_Formen1")
GeoForm.Width = 15.6

everything works fine.

Also if were using: Rectangle1.Enabled = False the rectangle is not show which is correct.

So i guess there must be something wrong setting the size of the rectangle seems it doesn't work correct.

We're using .DLL reports so we're not compiling the report again.

Any help ?

Thx
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Problem with changing size of Rectangle

Post by Andrew »

Hello,

The StiRectanglePrimitive consist of StiStartPointPrimitive and StiEndPointPrimitive. So to change Width and Height of the StiRectanglePrimitive from code you need to directly change coordinates of StiStartPointPrimitive and StiEndPointPrimitive. Please use the ClientRectangle property.

Thank you.
Stephan1
Posts: 122
Joined: Fri Aug 31, 2007 7:22 am
Location: Germany

Problem with changing size of Rectangle

Post by Stephan1 »

Andrew wrote:Hello,

The StiRectanglePrimitive consist of StiStartPointPrimitive and StiEndPointPrimitive. So to change Width and Height of the StiRectanglePrimitive from code you need to directly change coordinates of StiStartPointPrimitive and StiEndPointPrimitive. Please use the ClientRectangle property.

Thank you.
Hi Andrew,

i tried using the ClientRectangle, but this doesn't work also.

Here is a codesnippet how we call the report:

Dim Rechteck1 As Stimulsoft.Report.Components.StiRectanglePrimitive
Rechteck1 = stireport1.GetComponentByName("Rechteck1")
Rechteck1.ClientRectangle = New Stimulsoft.Base.Drawing.RectangleD(0, 2.8, 15.6, 2.8)


After setting the Rectangle we call:

stireport1.Show(Me, True)

But when the report is shown, the size of the above Rectangle still is (0,2.8,19.0,2,8)

Also were using .DLL reports cause they are much faster then using the .MRT files.

Any help ?

thx again

Stephan

Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Problem with changing size of Rectangle

Post by Andrew »

Hello,

We have created a small sample how to change the size of StiRectanglePrimitive. Please see the attached file.

Thank you.
Attachments
269.WindowsApplication1.zip
(44.81 KiB) Downloaded 231 times
Stephan1
Posts: 122
Joined: Fri Aug 31, 2007 7:22 am
Location: Germany

Problem with changing size of Rectangle

Post by Stephan1 »

Andrew wrote:Hello,

We have created a small sample how to change the size of StiRectanglePrimitive. Please see the attached file.

Thank you.
Hi Andrew,

thx that's working like a charm.

Cheers
Stephan
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Problem with changing size of Rectangle

Post by Edward »

Hi Stephan,

Please let us know if any additional help is required.

Thank you.
Post Reply