ArgumentException at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.Theme.SystemColorElement.GetColor(IOpenXmlImportContext context)
The problematic value is val="windowText"
The charts have a display blanks as property which is represented by the dispBlanksAs element. The absence of this element sometimes makes drastic difference in the way a chart might look. E.g. the following chart has a gap in its data and depending on what value dispBlanksAs has, it looks very different.
Use the below code snippet to generate XLSX document and export it. You will notice that the export operation is extremely slow:
Stopwatch sw = new Stopwatch();
sw.Start();
IWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider();
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets.Add();
Worksheet worksheet2 = workbook.Worksheets.Add();
worksheet2.Name ="Days";
List<string> weekdays = new List<string>() { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
for (int i = 0; i < 7; i++)
{
worksheet2.Cells[0, i].SetValue(weekdays[i]);
}
for (int i = 0; i < 200; i++)
{
for (int j = 0; j < 10; j++)
{
CellIndex cellIndex = new CellIndex(i, j);
CellSelection selection = worksheet.Cells[cellIndex];
selection.SetValue("Wednesday");
var context = new ListDataValidationRuleContext(worksheet, cellIndex)
{
InputMessageTitle = "InputMessageTitle",
InputMessageContent = "InputMessageTitle"
};
context.ErrorStyle = ErrorStyle.Stop;
context.ErrorAlertTitle = "ErrorAlertTitle";
context.ErrorAlertContent = "ErrorAlertContent";
context.InCellDropdown = true;
context.Argument1 = "=Days!A0:A6"; //"Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday";
ListDataValidationRule rule = new(context);
worksheet.Cells[cellIndex].SetDataValidationRule(rule);
}
}
string outputFile = @"..\..\..\output.xlsx";
File.Delete(outputFile);
using (Stream output = new FileStream(outputFile, FileMode.Create))
{
formatProvider.Export(workbook, output);
}
sw.Stop();
Debug.WriteLine("Export " + sw.ElapsedMilliseconds);
Add support for "Invert if negative" property of chart data series fill.
When I need to populate a cell that I find using a DefinedName I should parse RefersTo to get Worksheet name. But DefinedName class contains Scope property which has CurrentWorksheet and Workbook properties (internal). It would be very useful if these properties could be public.
A reference that refers to the same cell or range on multiple sheets. Example: =SUM(Den1:Den31!C10) will sum C10 from all sheets between Den1 and Den3.
When a formula contains new lines, it is parsed incorrectly as follows: - When it is shared formula it breaks the imported expression and replaces it with #NAME? error. - In normal case it simply preserves the formula string converting it to StringExpression. Workaround: Remove the new lines in the formulas. Have in mind that this code will fix the issue only for the second scenario, when the formula is not shared. CellRange usedCellRange = workbook.ActiveWorksheet.UsedCellRange; for (int row = usedCellRange.FromIndex.RowIndex; row < usedCellRange.ToIndex.RowIndex; row++) { for (int column = usedCellRange.FromIndex.ColumnIndex; column < usedCellRange.ToIndex.ColumnIndex; column++) { CellSelection cell = workbook.ActiveWorksheet.Cells[row, column]; ICellValue value = cell.GetValue().Value; if (value.RawValue.Contains("\n")) { cell.SetValue(value.RawValue.Replace('\n', ' ')); } } }
When defaultThemeVersion is missing from the file, some styles are not shown when the document is opened in MS Excel.
WorksheetPageSetup.ScaleFactor is limited in the range 0.5 - 4 due to limitations in the UI implementations, but this is not needed in RadSpreadProcessing alone.