Programmatically create a vertical line in a databand

Stimulsoft Reports.NET discussion
Post Reply
User avatar
Fabio Pagano
Posts: 355
Joined: Mon Apr 16, 2007 12:38 pm
Location: Bari (Italy)

Programmatically create a vertical line in a databand

Post 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.
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Programmatically create a vertical line in a databand

Post 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.
User avatar
Fabio Pagano
Posts: 355
Joined: Mon Apr 16, 2007 12:38 pm
Location: Bari (Italy)

Programmatically create a vertical line in a databand

Post by Fabio Pagano »

You're very kind as usual.

Thank you very much.
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Programmatically create a vertical line in a databand

Post by Ivan »

Hello,

We are always glad to help you.

Thank you.
Post Reply