c# - Resize a chart data range using infragistics -
i'm trying insert new column in loaded workbook. when insert resize existing table chart related table update not. , apparently there no way modify loaded chart using infragistics. way can access worksheet.shapes collection may guess it's shape cannot manipulate data in it.
so when open modified excel file, table resized on other hand chart related table not updated. data source range still previous range of table.
here did :
private static void main() { string outputfile = "book1.xlsm"; workbook workbook = workbook.load(outputfile); workbook temp = setindicatorsworkbook(); var jenkinsvalues = new list<int>(); (int j = 0; j < 13; j++) { jenkinsvalues.add((int)temp.worksheets["unit & integration tests"].rows[j].cells[0].value); } var worksheet = workbook.worksheets["unit testing"]; //id of column related first asset (fixedincome) in loaded worksheet var k = 8; var count = worksheet.rows[8].cells.count(cell => cell.value != null); string lastcelladress = worksheetcell.getcelladdressstring(worksheet.rows[20], worksheet.columns[count + 1].index, cellreferencemode.a1, true); stringbuilder lastcellreference = new stringbuilder(); (int = 16; < lastcelladress .length; i++) { if (!lastcelladress[i].equals('$')) { lastcellreference.append(lastcelladress [i]); } } worksheet.columns.insert(count + 1); worksheet.tables["table5"].resize(string.format("c3:{0}", lastcellreference)); int totalvalues = 0; foreach (var value in jenkinsvalues) { worksheet.rows[k].cells[count + 1].value = value; totalvalues += value; k++; } datetime date = datetime.parse(worksheet.rows[2].cells[count].gettext()); worksheet.rows[2].cells[count + 1].value = date.addmonths(1); worksheet.rows[4].cells[count + 1].value = totalvalues; workbook.save(outputfile); }
Comments
Post a Comment