Posted 1 September 2019, 4:24 pm EST - Updated 30 September 2022, 5:35 pm EST
I am trying to create a drawing in a sub report, for that I need to draw lines dynamically while generating the report, I am trying to use Line control for that But I am not able to view the line in the report., Below is the code snippet I am using
private void DiagramSectionReport_ReportStart(object sender, EventArgs e)
{
var line = new Line
{
X1 = 10,
Y1 = 100,
X2 = 200,
Y2 = 100,
LineColor = Color.Red,
LineWeight = 3
};
this.Sections[1].Controls.Add(line);
this.detail.Controls.Add(line);
GrapeCity.ActiveReports.SectionReportModel.Label lblCategoryID = new GrapeCity.ActiveReports.SectionReportModel.Label();
lblCategoryID.Location = new PointF(0, 0.05F);
lblCategoryID.Text = "Category ID";
lblCategoryID.Alignment = TextAlignment.Center;
lblCategoryID.Font = new System.Drawing.Font("Arial", 10, FontStyle.Bold);
this.Sections[0].Controls.Add(lblCategoryID);
this.Sections[1].Controls.Add(lblCategoryID);
}
I am able to view the Label but not able to view the line, Am I doing something wrong here?
I have attached 2 images below to
1 . Design of sub reports showing 3 sections
2. My reports(pdf’s) section showing the output of my sub report.