ArgumentException with clarification similar to "'\u001f', hexadecimal value 0x1F, is an invalid character." is thrown when trying to export document containing characters which are not supported in XML document - such as some control characters like 0x00, 0x1F, 0x1B, etc. Such characters are described in the XML specification here: https://www.w3.org/TR/xml/#charsets. Although the escaped strings are not supported (see https://feedback.telerik.com/Project/184/Feedback/Details/190228 ), the library could prevent the exception and export the document successfully by skipping such characters. Workaround: remove such characters before the export. Check the following StackOverflow answer for some ideas on code for replacing the characters: http://stackoverflow.com/a/14323524/259206 Fix available in R3 2018 SP1 release.
The row declaration is the following: <row r="8" spans="1:18" ht="15.75" x14ac:dyDescent="0.25"> The dyDescent attribute is described as follows: The dyDescent attribute is a double attribute, as specified in [XMLSCHEMA2/2] section 3.2.5, that specifies the vertical distance in pixels from the bottom of the cells in the current row to the typographical baseline of the cell content if, hypothetically, the zoom level for the sheet containing this row is 100 percent and the cell has bottom-alignment formatting. See section 2.2.4.12 for how this element integrates with the Office Open XML file formats specified in [ISO/IEC29500-1:2016]. The dyDescent attribute has a side effect; it sets the customHeight attribute to true even if the customHeight attribute is explicitly set to false. Note: Since the dyDescent attribute is not implemented, the height is not recognized to be custom and therefore it is not imported at all. The row has the default height.
Incorrect calculation of Round function returns wrong results in some cases. For example, test Microsoft Excel and Spreadsheet results of: ROUND(1.365, 2) to see the discrepancy. Available in R3 2018 SP1 release.
Closed as duplicate. Please, follow the item at https://feedback.telerik.com/Project/184/Feedback/Details/190249 .
When the workbook contains multiple styles (e.g. 50000), the import is extremely slow. MS Excel loads this document instantaneously.
When the values that were copied have formatting both on the cell and on the column, the pasted values get the formatting of the column, instead of that of the cell. The same applies to rows.
When inserting cells a check is performed for data loss. This check should take into account the value property, but should not take into account properties like cell value format and data validation. Workaround: clear the values at the end of the worksheet before inserting cells. worksheet.Cells[1048575, 0, 1048575, 16383].ClearDataValidationRule();
Generating document which consists of merged cells in a row and some values then inserting a row on the top and then exporting the document or setting it to the RadSpreadsheet causes wrong merged cells. If the generation is done on a workbook which is already set to the RadSpreadsheet everything is OK. Workaround: The document can be exported and then imported again before the row is inserted.
Most often, the print area will be defined in the Workbook part like so:
<definedName name="_xlnm.Print_Area" localSheetId="3">Data!$A$1:$L$7</definedName>
Sometimes, however, it can be a function instead:
<definedName name="_xlnm.Print_Area" localSheetId="0">OFFSET('Parametrový List'!$A$1,0,0,INDEX({77,148},PocetStran),34)</definedName>
At the moment, the second option is not supported.
The OFFSET function returns a reference to a range that is a specified number of rows and columns from a cell or range of cells.
When the scale factor of a document is smaller, the borders don't seem to scale correctly when exported to PDF. They appear much thicker than they would when exported from Excel.
When a worksheet has name that has spaces and a hyperlink to this worksheet is being inserted in Excel, quotes are used to surround the name (ex: 'Sheet 12'!A1) for a valid hyperlink. If quotes are not added, the hyperlink is invalid. In RadSpreadsheet, it is the opposite: (Sheet 12!A1 is correct, while 'Sheet 12'!A1 is incorrect). Thus, opening such an exported document from RadSpreadsheet in Excel loads it with incorrect hyperlinks; and importing such an Excel document in RadSpreadsheet loads it with incorrect hyperlinks. A way to workaround this issue is to modify the hyperlinks on import/export from/to RadSpreadsheet. You can find attached a project demonstrating this approach.
The format string for dates should be in lowercase so they can work as expected. Ensure this in the internal logic.
When a format code like "General" x"" is applied on e.g. 1, the result is "1 x". At the moment, the result with Spreadprocessing is "General x"
Having cell with custom format string set to "MMM" does not apply correctly. Instead of showing the date in the defined format (for instance "Aug"), what actually is displayed is "MMM".
Provide the customers with the ability to export workbooks to HTML files.
When the automatic scaling options FitToColumns and FitToRows are used, the vertical and horizontal breaks, respectively, should be ignored.
Workaround:
Remove the page breaks if the worksheet uses automatic scaling and restore them if necessary:
public void ExcelToPdf(string path)
{
var provider = new XlsxFormatProvider();
using (Stream input = File.OpenRead(path))
{
var workbook = provider.Import(input);
this.CachePageBreaks(workbook);
var pdfProvider = new PdfFormatProvider();
pdfProvider.ExportSettings = new PdfExportSettings(ExportWhat.EntireWorkbook, false);
using (Stream output = File.Open(@"C:\Users\velcheva\Desktop\26293903-c650-4d28-adee-58a542651f72_exceltopdf\exported.pdf", FileMode.Create))
{
pdfProvider.Export(workbook, output);
}
this.RestorePageBreaks(workbook);
}
}
private Dictionary<Worksheet,List<PageBreak>> verticalPageBreaksCache;
private void CachePageBreaks(Workbook workbook)
{
this.verticalPageBreaksCache = new Dictionary<Worksheet, List<PageBreak>>();
foreach (Worksheet worksheet in workbook.Worksheets)
{
WorksheetPageSetup pageSetup = worksheet.WorksheetPageSetup;
if (pageSetup.FitToPages)
{
this.verticalPageBreaksCache[worksheet] = new List<PageBreak>(pageSetup.PageBreaks.VerticalPageBreaks);
if(pageSetup.FitToPagesWide != 0)
{
List<PageBreak> breaksToRemove = new List<PageBreak>();
breaksToRemove.AddRange(pageSetup.PageBreaks.VerticalPageBreaks);
breaksToRemove.ForEach((br) => pageSetup.PageBreaks.TryRemoveVerticalPageBreak(0, br.Index));
}
// Record the horizontal page breaks if necessary.
}
}
}
private void RestorePageBreaks(Workbook workbook)
{
foreach (Worksheet worksheet in workbook.Worksheets)
{
WorksheetPageSetup pageSetup = worksheet.WorksheetPageSetup;
if (pageSetup.FitToPages)
{
List<PageBreak> cachedbreaks = this.verticalPageBreaksCache[worksheet];
if (pageSetup.FitToPagesWide != 0)
{
foreach (var pageBreak in cachedbreaks)
{
pageSetup.PageBreaks.TryInsertVerticalPageBreak(0, pageBreak.Index);
}
}
// Restore the horizontal page breaks if necessary.
}
}
}
Such objects are defined as oleObject elements in the XML. Currently, they are skipped on import.
Excel provides an option to choose whether cells with number cell value zero should display as "0" or as if they are empty. The option can be found in File -> Options -> Advanced -> "Show a zero in cells that have zero value". The option is set per sheet. The XML attribute is called "zeroValues" and it can be found on page 1625 in the format specification.
KeyNotFoundException is thrown on import. The number formats with id 5, 6, 7 and 8 are missing in the built-in number formats. Available in R2 2018 Official Release version.