Not finding any examples or similar, so I wanted to see if there is a way to include a Gantt Chart into a WordsProcessing document. I am currently bringing the data into a table, but my end-user has requested to see the chart view of the same data.
if (JobMilestones.Count > 0)
{
editor.InsertText("MILESTONES").FontWeight = FontWeights.Bold;
Table tblMilestone = editor.InsertTable(JobMilestones.Count + 1, 3);
tblMilestone.PreferredWidth = new TableWidthUnit(720);
Paragraph p = tblMilestone.Rows[0].Cells[0].Blocks.AddParagraph();
tblMilestone.Rows[0].RepeatOnEveryPage = true;
tblMilestone.Rows[0].Cells[0].Borders = tcb;
tblMilestone.Rows[0].Cells[1].Borders = tcb;
tblMilestone.Rows[0].Cells[2].Borders = tcb;
editor.MoveToParagraphStart(p);
editor.InsertText("Task").FontWeight = FontWeights.Bold;
p = tblMilestone.Rows[0].Cells[1].Blocks.AddParagraph();
editor.MoveToParagraphStart(p);
editor.InsertText("Start").FontWeight = FontWeights.Bold;
p = tblMilestone.Rows[0].Cells[2].Blocks.AddParagraph();
editor.MoveToParagraphStart(p);
editor.InsertText("End").FontWeight = FontWeights.Bold;
int x = 1;
foreach (FlatModel fm in JobMilestones)
{
p = tblMilestone.Rows[x].Cells[0].Blocks.AddParagraph();
editor.MoveToParagraphStart(p);
editor.InsertText(fm.TaskTitle);
p = tblMilestone.Rows[x].Cells[1].Blocks.AddParagraph();
editor.MoveToParagraphStart(p);
editor.InsertText(fm.StartDate.ToShortDateString());
p = tblMilestone.Rows[x].Cells[2].Blocks.AddParagraph();
editor.MoveToParagraphStart(p);
editor.InsertText(fm.EndDate.ToShortDateString());
tblMilestone.Rows[x].Cells[0].Borders = tcb;
tblMilestone.Rows[x].Cells[1].Borders = tcb;
tblMilestone.Rows[x].Cells[2].Borders = tcb;
x += 1;
}
editor.MoveToTableEnd(tblMilestone);
//editor.InsertLine("");
editor.InsertBreak(BreakType.LineBreak);
}