For example:
Renaming a sheet named "Sheet1" to "Sheet 1", should update formulas references to it to 'Sheet 1!' (notice single quotes), which it does not. The formula =SUM(Sheet1!A2:C2) changes to the invalid expression =SUM(Sheet 1!A2:C2). This breaks formulas referencing that sheet.
Workaround:
Iterate all cells with formulas in the workbook and add single quotes to the beginning and end of sheet name reference. The attached project changes the name of Sheet1 and then fixes all formula references to it by enclosing its name in single quotes.
Workbook wb = new Workbook();
Worksheet worksheet = wb.Worksheets.Add();
PatternFill fill = new PatternFill(PatternType.DiagonalStripe, Colors.Red, Colors.Transparent);
worksheet.Cells[0, 0].SetFill(fill);
string outputFilePath = "Sample.pdf";
File.Delete(outputFilePath);
Telerik.Windows.Documents.Spreadsheet.FormatProviders.Pdf.PdfFormatProvider pdfFormatProvider =
new Telerik.Windows.Documents.Spreadsheet.FormatProviders.Pdf.PdfFormatProvider();
//export to file
using (Stream output = File.OpenWrite(outputFilePath))
{
pdfFormatProvider.Export(wb, output, TimeSpan.FromSeconds(10));
}
Process.Start(new ProcessStartInfo() { FileName = outputFilePath, UseShellExecute = true });RadSpreadProcessing expects an integer, instead of boolean. However, according to the specification, it should be boolean:
Add support for strikethrough font effect for cell formatting. Currently this is not supported by the model and is omitted on import.
The XlsxPartNames class expects a strict name for reading the comments parts:
public const string CommentsPartName = @"/xl/comments{0}.xml";
However, some third-party tools may change the name to GemComments.xml for example.
MS Excel recognizes this naming for the comments part. It would be nice to provide such functionality in RadSpreadProcessing.
XlsFormatProvider: InvalidOperationException is thrown when importing a document with an unsupported BIFF record.
Workaround: Re-save the file with Excel before importing it.
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.
When the worksheet contains fraction numbers with fractional parts > 0.5 and < 0.5 and both these numbers have fraction format applied, the number with fractional part < 0.5 will have incorrect whole part.