Page 1 of 1

Programmatically create a vertical line in a databand

Posted: Wed Jul 15, 2009 7:10 pm
by Fabio Pagano
I need to programmatically create a vertical line in a databand.

I've tried this code:

Code: Select all

Dim VerticalLinePrimitive1 As New Stimulsoft.Report.Components.StiVerticalLinePrimitive
VerticalLinePrimitive1.ClientRectangle = New Stimulsoft.Base.Drawing.RectangleD(MyX, MyY, MyHeight, MyWidth)
VerticalLinePrimitive1.Color = System.Drawing.Color.Black
VerticalLinePrimitive1.Guid = System.Guid.NewGuid.ToString.Replace("-", "")
VerticalLinePrimitive1.Name = "MyName"
MyDataBand.Components.Add(VerticalLinePrimitive1)
but i've noticed that in the StimulReport code the "StartPointPrimitive" and the "EndPointPrimitive" aren't created, while they are created if i manually design the vertical line. This causes some problems in the designer and in the report: if in designer i select the programmatically created vertical line in the databand, then if i move the databand the vertical line remains in its place.

Can you help me to programmatically create a vertical line in a databand?

Thank you.

Programmatically create a vertical line in a databand

Posted: Thu Jul 16, 2009 12:53 am
by Ivan
Hello,
Fabio wrote:I need to programmatically create a vertical line in a databand.
I've tried this code: ...
but i've noticed that in the StimulReport code the "StartPointPrimitive" and the "EndPointPrimitive" aren't created, while they are created if i manually design the vertical line. This causes some problems in the designer and in the report: if in designer i select the programmatically created vertical line in the databand, then if i move the databand the vertical line remains in its place.
Can you help me to programmatically create a vertical line in a databand?
Please use following code:

Code: Select all

Dim VerticalLinePrimitive1 As New Stimulsoft.Report.Components.StiVerticalLinePrimitive
VerticalLinePrimitive1.ClientRectangle = New Stimulsoft.Base.Drawing.RectangleD(MyX, MyY, MyHeight, MyWidth)
VerticalLinePrimitive1.Color = System.Drawing.Color.Black
VerticalLinePrimitive1.Guid = System.Guid.NewGuid.ToString.Replace("-", "")
VerticalLinePrimitive1.Name = "MyName"

Dim start As New Stimulsoft.Report.Components.StiStartPointPrimitive
start.Left = VerticalLinePrimitive1.Left
start.Top = VerticalLinePrimitive1.Top
start.ReferenceToGuid = VerticalLinePrimitive1.Guid
start.Parent = MyDataBand
MyDataBand.Components.Add(start)

Dim end As New Stimulsoft.Report.Components.StiEndPointPrimitive
end.Left = VerticalLinePrimitive1.Right;
end.Top = VerticalLinePrimitive1.Bottom;
end.ReferenceToGuid = VerticalLinePrimitive1.Guid;
end.Parent = MyDataBand;
MyDataBand.Components.Add(end);

VerticalLinePrimitive1.Top += MyDataBand.Top;
VerticalLinePrimitive1.Parent = MyDataBand.Page;
MyDataBand.Page.Components.Add(VerticalLinePrimitive1);
Thank you.

Programmatically create a vertical line in a databand

Posted: Thu Jul 16, 2009 5:17 am
by Fabio Pagano
You're very kind as usual.

Thank you very much.

Programmatically create a vertical line in a databand

Posted: Fri Jul 17, 2009 12:39 am
by Ivan
Hello,

We are always glad to help you.

Thank you.