I am creating a report by code, which works okay, but does not show a vertical line.
I can't figure out what I am doing wrong.
Text and horizontal line are shown. ( I also tried barcode which works well.)
The version I use is 2012.3.1500.0 (I know quite a bit outdated...)
I've minimized the code to this c# console application:
Code: Select all
static void Main(string[] args)
{
try
{
StiReport rep = new StiReport();
StiPage page = rep.Pages[0];
StiText dataText = new StiText(new RectangleD(0, 0, 14, 14));
dataText.Border.Side = StiBorderSides.None;
dataText.Text = "ABC";
dataText.Name = "DataText" ;
page.Components.Add(dataText);
Stimulsoft.Report.Components.StiHorizontalLinePrimitive hl = new StiHorizontalLinePrimitive();
hl.Color = System.Drawing.Color.Red;
hl.Left = 3;
hl.Top = 4;
hl.Height = 4;
hl.Width = 5;
hl.Size = 5;
hl.Name = "Hor";
hl.Guid = System.Guid.NewGuid().ToString().Replace("-", "");
page.Components.Add(hl);
Stimulsoft.Report.Components.StiVerticalLinePrimitive vl = new StiVerticalLinePrimitive();
vl.Color = System.Drawing.Color.Green;
vl.Left = 2;
vl.Top = 3;
vl.Height = 5;
vl.Width = 5;
vl.Size = 5;
vl.Name = "Vert";
vl.Guid = System.Guid.NewGuid().ToString().Replace("-", "");
page.Components.Add(vl);
StiOptions.Viewer.AllowUseDragDrop = false;
rep.Show(true);
}
catch (Exception eX)
{
Console.WriteLine("Error: " + eX.Message);
}
}