An error occurs while importing an XLSX document with charts. Here is the stack trace:
at Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.Contexts.XlsxWorkbookImportContext.PairSeriesGroupsWithAxes() at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.Chart.PlotAreaElement.CopyPropertiesTo(IOpenXmlImportContext context, DocumentChart chart) at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.Chart.ChartElement.CopyPropertiesTo(IOpenXmlImportContext context, DocumentChart chart) at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.Chart.ChartSpaceElement.OnAfterRead(IOpenXmlImportContext context) at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.Read(IOpenXmlReader reader, IOpenXmlImportContext context) at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Parts.ChartPart.Import(IOpenXmlReader reader, IOpenXmlImportContext context) at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Parts.OpenXmlPartBase.Import(Stream stream, IOpenXmlImportContext context) at Telerik.Windows.Documents.FormatProviders.OpenXml.OpenXmlImporter`1.ImportPartFromArchive(ZipArchiveEntry zipEntry, PartBase part, IOpenXmlImportContext context) at Telerik.Windows.Documents.FormatProviders.OpenXml.OpenXmlImporter`1.Import(Stream input, IOpenXmlImportContext context) at Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider.ImportOverride(Stream input, CancellationToken cancellationToken) at Telerik.Windows.Documents.Spreadsheet.FormatProviders.WorkbookFormatProviderBase.Import(Stream input, Nullable`1 timeout)
Add support for pivot tables.
Currently, RadSpreadProcessing supports the following options:
namespace Telerik.Windows.Documents.Model.Drawing.Charts
{
/// <summary>
/// Specifies where a chart legend is placed relative to the plot area.
/// </summary>
public enum LegendPosition
{
/// <summary>
/// Positions the legend to the right of the plot area.
/// </summary>
Right,
/// <summary>
/// Positions the legend below the plot area.
/// </summary>
Bottom,
/// <summary>
/// Positions the legend to the left of the plot area.
/// </summary>
Left,
/// <summary>
/// Positions the legend above the plot area.
/// </summary>
Top
}
}MS Excel supports setting "Top Right" Legend Position:
Currently, if you have a decimal column in the DataTable, it is imported as a text column in the workbook. It should be preserved as a numeric column after importing.
Note: When importing a DataTable, each of the column's type is checked and a respective cell type is imported.
if (dataType.IsValueType && dataType.IsPrimitive && !dataType.IsEnum)
{
newValue = new NumberCellValue(Convert.ToDouble(value));
}The check ensures only “simple” CLR value types are treated as numbers when importing from DataTable to the worksheet.LocalizableException is thrown after removing columns from a workbook with set Print Titles.
Workaround - Remove the PrintTitles before removing the columns:
WorksheetPageSetup pageSetup = workbook.ActiveWorksheet.WorksheetPageSetup;
pageSetup.PrintTitles.RepeatedRows = null;
pageSetup.PrintTitles.RepeatedColumns = null;
at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) at System.Collections.Generic.Dictionary`2.FindValue(TKey key) at System.Collections.Generic.Dictionary`2.ContainsKey(TKey key) at Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.Model.Elements.Worksheets.ConditionalFormattingRuleElementX14.OnAfterRead(IXlsxWorksheetImportContext context) in C:\Work\document-processing\Documents\Spreadsheet\FormatProviders\OpenXml\Xlsx\Model\Elements\Worksheets\ConditionalFormatting\x14\ConditionalFormattingRuleElementX14.cs:line 62
string inputFileName = "input.xlsx";
if (!File.Exists(inputFileName))
{
throw new FileNotFoundException(String.Format("File {0} was not found!", inputFileName));
}
Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook;
IWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider();
using (Stream input = new FileStream(inputFileName, FileMode.Open))
{
workbook = formatProvider.Import(input, TimeSpan.MaxValue);
}
string outputFilePath = "output.xlsx";
using (Stream output = new FileStream(outputFilePath, FileMode.Create))
{
formatProvider.Export(workbook, output, TimeSpan.MaxValue);
}
Process.Start(new ProcessStartInfo() { FileName = outputFilePath, UseShellExecute = true });At this point the culture used by RadSpreadProcessing (in the FormatHelper and internally in SpreadsheetCultureHelper) is determined by the current thread culture on startup. Provide ability to: - to change the culture at runtime. Currently, when the thread culture is changed, RadSpreadProcessing is "stuck" with the original one. - set this culture independently of the current thread's one.
In Excel formulas, the double minus (--) is known as the "double unary operator." Its main purpose is to convert Boolean values (TRUE/FALSE) into numeric values (1/0).
How it works:
• TRUE becomes 1
• FALSE becomes 0
Example: Suppose you have an array formula like:
=SUM(--(B2:B20="Gamma"))
• (B2:B20="Gamma") produces an array of TRUE/FALSE.
• --(B2:B20="Gamma") converts that array to 1/0.
• SUM(...) then adds up the number of matches.
Some Excel functions (like SUM, SUMPRODUCT) require numbers, not Booleans.
The double unary is a concise way to force this conversion.