When importing a XLSX file with a frozen pane using server implementation(using the Document Processing Library), the dimensions of the frozen pane are missed.
The imported xlsx file appears to overflow the Kendo UI Spreadsheet component. See screencast(SpreadhsheetOverflowFrozenPane.zip)
When importing a file using server implementation, the file should be contained within the Kendo UI Spreadsheet component's view.
Reduce the amount of frozen rows/columns to fit into the widget.
Reproducible in the demos:
A popup with an error message appears.
The user should be able to navigate to the desired cell, in order to add it as a reference to the formula.
Dojo example: https://dojo.telerik.com/UWicoqeJ
The cell will display: "NO OK"
The cell should display: "OK" as it does in Excel.
When dragging a cell to edit other cells in the Spreadsheet, the Change event of the DataSource is not fired.
The issue is a regression starting with Kendo - 2022.2.621
Try to edit multiple cells by dragging a cell.
The Change event is not triggered.
The Change event should be fired.
Reported in Ticket ID: 1529288
Create an MVC application:
View:
@{
ViewBag.Title = "Home Page";
string sfile = System.IO.Path.Combine(Server.MapPath("~"), "File1.xlsx");
}
@Html.Kendo().Spreadsheet().Name("spreadsheet"))
<br />
<br />
<button class="k-button k-primary" id="export" onclick="ExportExcel()">Export Spreadsheet content</button>
<script>
function ExportExcel() {
var spread = $('#spreadsheet').getKendoSpreadsheet();
var data = JSON.stringify(spread.toJSON());
var fd = new FormData();
fd.append('wbook', data);
fd.append('sfile', "File1.xlsx");
$.ajax({
url: "@Url.Action("SaveFileExcel", "Home")",
data: fd,
contentType: "application/x-www-form-urlencoded",
processData: false,
contentType: false,
type: "POST",
statusCode: {
200: function (xhr, status, err) {
console.log('File exported!');
},
500: function (xhr, status, err) {
console.log('Internal Server Error!');
}
}
});
}
</script>
Controller:
[HttpPost]
public ActionResult SaveFileExcel(string wbook, string sFile)
{
var workbook = Telerik.Web.Spreadsheet.Workbook.FromJson(wbook);
string physicalPath = Path.Combine(Server.MapPath("~/"), sFile);
//workbook.Save("C:/inetpub/wwwroot/" + sFile
workbook.Save(physicalPath);
return new EmptyResult();
}
The Save method throws System.ExecutionEngineException
The file is saved.
Dojo example.
All filters are cleared.
The Spreadsheet shows Company filtered by value "Excella". This is the behavior when different columns are filtered consecutively and then "Undo" is clicked.
Regression introduced in R3 2019.
Open this Spreadsheet demo. Even though the Toolbar configuration is set to false, it is not hidden. This applies only for ASP.Net Core and ASP.Net MVC.
The Toolbar is visible when set to false.
The Toolbar should be hidden.
The Workbook.FromDocument() method freezes the panes based on the coordinates of the TopLeftCellIndex of the pane instead of the XSplit and YSplit properties of the pane. Reproduced with the attached Excel file
var pane = documentWorksheet.ViewState.Pane;
if (pane != null && pane.State == PaneState.Frozen)
{
sheet.FrozenRows = pane.TopLeftCellIndex.RowIndex;
sheet.FrozenColumns = pane.TopLeftCellIndex.ColumnIndex;
}
Solution:
var pane = documentWorksheet.ViewState.Pane;
if (pane != null && pane.State == PaneState.Frozen)
{
sheet.FrozenRows = pane.YSplit;
sheet.FrozenColumns = pane.XSplit;
}
WORKAROUND: Loading the Excel file with DocumentProcessingLibrary API and change the pane
var fileName = <YourFilePathHere...>;
if (!File.Exists(fileName))
{
throw new FileNotFoundException(String.Format("File {0} was not found!", fileName));
}
Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook;
IWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider();
using (Stream input = new FileStream(fileName, FileMode.Open))
{
workbook = formatProvider.Import(input);
foreach (var sheet in workbook.Worksheets)
{
if (sheet.ViewState.Pane != null && sheet.ViewState.Pane.State == Telerik.Windows.Documents.Spreadsheet.Model.PaneState.Frozen)
{
var originalPane = sheet.ViewState.Pane;
var pane = new Pane(new CellIndex(originalPane.YSplit, originalPane.XSplit), originalPane.XSplit, originalPane.YSplit, originalPane.ActivePane);
sheet.ViewState.Pane = pane;
}
}
}
var sheets = Telerik.Web.Spreadsheet.Workbook.FromDocument(workbook).Sheets;
This is a regression introduced in R2 2019.
Textboxes and charts currently are not supported in the Spreadsheet, however, if the loaded excel file contains such, saving the file should not throw a js exception.
On saving the file the following exception is thrown:
kendo.all.js:12938 Uncaught TypeError: Cannot read property 'target' of undefined
No js exceptions on saving the file.
Calling insertRow multiple times over many sheet data causes a slower performance since 2020.1.219.
http://dojo.telerik.com/EBEtaFOj (2020.1.114)