Unplanned
Last Updated: 04 Jan 2017 09:32 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 02 Sep 2016 09:17
Category: GanttView
Type: Bug Report
3
FIX. RadGanttView - ArgumentException when printing ganttview with a lot of records
To reproduce:

public Form1()
{
    InitializeComponent();

    DataTable tasks = new DataTable("Tasks");
    tasks.Columns.Add("Id", typeof(int));
    tasks.Columns.Add("ParentId", typeof(int));
    tasks.Columns.Add("Title", typeof(string));
    tasks.Columns.Add("Start", typeof(DateTime));
    tasks.Columns.Add("End", typeof(DateTime));
    tasks.Columns.Add("Progress", typeof(decimal));
    DataTable links = new DataTable("Links");
    links.Columns.Add("StartId", typeof(int));
    links.Columns.Add("EndId", typeof(int));
    links.Columns.Add("LinkType", typeof(int));
    DataSet data = new DataSet();
    data.Tables.Add(tasks);
    data.Tables.Add(links);

    Random rand = new Random();
    int cnt = 3000;
    int cnt2 = 6000;
    for (int i = 1; i < cnt; i++)
    {
        tasks.Rows.Add(i, 0, "Summary task title", DateTime.Now.AddDays(i), DateTime.Now.AddDays(i + 5), 30m);
    }

    for (int i = cnt; i < cnt2; i++)
    {
        tasks.Rows.Add(i, rand.Next(1, cnt), "First child task title", new DateTime(2010, 10, 10), new DateTime(2010, 10, 12), 10);  
    }
    for (int i = 0; i < 2000; i++)
    {
        links.Rows.Add(rand.Next(cnt, cnt2), rand.Next(1, cnt), 1);
    } 
    
    
    this.radGanttView1.GanttViewElement.TaskDataMember = "Tasks";
    this.radGanttView1.GanttViewElement.ChildMember = "Id";
    this.radGanttView1.GanttViewElement.ParentMember = "ParentId";
    this.radGanttView1.GanttViewElement.TitleMember = "Title";
    this.radGanttView1.GanttViewElement.StartMember = "Start"; 
    this.radGanttView1.GanttViewElement.EndMember = "End";
    this.radGanttView1.GanttViewElement.ProgressMember = "Progress";
    this.radGanttView1.GanttViewElement.LinkDataMember = "Links";
    this.radGanttView1.GanttViewElement.LinkStartMember = "StartId";
    this.radGanttView1.GanttViewElement.LinkEndMember = "EndId";
    this.radGanttView1.GanttViewElement.LinkTypeMember = "LinkType";
    this.radGanttView1.GanttViewElement.DataSource = data;
    this.radGanttView1.Columns.Add("Start");
    this.radGanttView1.Columns.Add("End");
}

private void radButton1_Click(object sender, EventArgs e)
{
    this.radGanttView1.PrintPreview();
}

Attached Files:
2 comments
ADMIN
Stefan
Posted on: 17 Sep 2016 11:00
Hi Dzmitry,

at first sight, this exception is being thrown due to the large size of the an image RadGanttView needs to be drawn on, hence when we try to create it the Bitmap class throws an exception.

We will think of ways how to overcome this limitation in future, but most likely we will have to take completely new approach for printing the control.
Dzmitry
Posted on: 14 Sep 2016 12:33
would be nice to schedule a fix for this bug