This project has moved and is read-only. For the latest updates, please go here.

Problem with title in chart

Aug 30, 2011 at 3:13 PM


Ive been using Epplus for some time, and I dont know what happend :o in my other project everything was doing great, but now...

So! I want to change title (im loading template, where are infinity number of charts and in title I have written what column should be X and Y -> {Xseries = C2:E10; Yseries = C3:E10; title = "chartTitle"}). After loading that title:


if ((currentWorksheet.Drawings.Count) != 0)
     for (int i = 0; i < currentWorksheet.Drawings.Count; i++)
           chart = ((ExcelChart)currentWorksheet.Drawings[i]);
           string title = chart.Title.Text;
           string[] titleAttributes = title.Split(';');
           //Building up title
           string titleToBuild = TitleAttributes[2].Substring(titleAttributes[0].IndexOf('\"') + 1);
so now in titleToBuild I have "chartTitle" and I want to set title -> chart.Title.Text = chartTitle; (of course in for loop, so I havent lost my variable) but... i have exception: "The node to be removed is not a child of this node.". And Im asking why?
I have never had something like that :o I can't change title in template? Or have I did something wrong?


Sep 1, 2011 at 7:25 PM


This is a bug. When reading the chart title and then writing it back you get an exception. I think it occures when you have two or more different styles in the richtext.

I'll supply a fix next time I check in.