This is a migrated thread and some comments may be shown as answers.

Excel crash when using spreadprocessing

6 Answers 114 Views
SpreadProcessing
This is a migrated thread and some comments may be shown as answers.
It
Top achievements
Rank 1
It asked on 16 May 2016, 01:50 PM

Hi,

I have stripped our use down to be a very simple data-dump.

Row 1 = column headers
Rows 2 to N = data

I am using the auto filtering feature  

sheet.Filter.FilterRange = sheet.UsedCellRange;

once all the data has been written

File is being saved

IWorkbookFormatProvider XSLXwriter = new XlsxFormatProvider();

using (FileStream filestream = new FileStream(filename, FileMode.Create))
    XSLXwriter.Export(output, filestream);

Output is a Workbook and filename is a unique string.

I am simulating a user experience of wanting to us the sorting options provided within Excel however this causes a crash and the file to be recovered. Saving and re-opening fixes this problem. Comparing workbook.xml from the before(which crashes) and after(save as copy) it looks like this is missing.

<definedNames>
    <definedName name="_xlnm._FilterDatabase" localSheetId="0" hidden="1">Sheet1!$A$1:$GJ$531</definedName>
  </definedNames>
  <calcPr calcId="0"/>

If you could advise on solving this issue it would be great.

Many Thanks

6 Answers, 1 is accepted

Sort by
0
Nikolay Demirev
Telerik team
answered on 19 May 2016, 09:09 AM
Hello,

I have tried to reproduce the issue, but with no success. I am attaching the sample project I have used to test your case. Please try in on your side and modify it so the issue can be reproduced and send it back to us to investigate and fix it.

Regards,
Nikolay Demirev
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
It
Top achievements
Rank 1
answered on 19 May 2016, 10:30 AM

Hi Nikolay,

Thank you for the quick response. Unfortunately I have not been able to diagnose the issue using the sample project. 

Making 0 modifications to the project myself I am able to replicate the issue. 

Opening the project with
Microsoft Visual Studio Professions 2012, Version 11.0.61219.00 update 5
Microsoft .Net Framework version 4.6.01038
Microsoft Excel 2013, Version 15.0.4823.1002 

Step by Step breakdown of how I have replicated the issue.

1. Run project and save file as file.XLSX
2. Open file in Excel
3. Attempt to sort any column which causes an error.

Opening the XLSX file and attempting to sort recovers the file. Looking at this in more detail it seems that Saving and Opening is not the fix rather removing and reapplying the filters. Please find below a copy of the XML from XLSX file produced as well as a copy after removing and reapplying filters.

XML Before

<?xml version="1.0" encoding="utf-8"?>
  <sheets>
    <sheet sheetId="1" name="Sheet1" state="visible" r:id="rId4" />
  </sheets>
</workbook>

 XML After

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fileVersion appName="xl" lastEdited="6" lowestEdited="6" rupBuild="14420"/><workbookPr/>
<mc:Choice Requires="x15"><x15ac:absPath url="C:\Users\ryan\Desktop\New folder (2)\"  xmlns:x15ac="http://schemas.microsoft.com/office/spreadsheetml/2010/11/ac"/>
</mc:Choice>
</mc:AlternateContent>
<bookViews>
<workbookView xWindow="0" yWindow="0" windowWidth="25125" windowHeight="13620"/>
</bookViews>
<sheets>
  <sheet name="Sheet1" sheetId="1" r:id="rId1"/>
</sheets>
<definedNames>
  <definedName name="_xlnm._FilterDatabase" localSheetId="0"   hidden="1">Sheet1!$A$1:$AX$1</definedName>
</definedNames>
<calcPr calcId="0"/>
</workbook>

Hopefully we can work to resolve this issue.
Many thanks

0
Yana
Telerik team
answered on 24 May 2016, 08:52 AM
Hi,

I am afraid that still we're unable to reproduce the reported behavior.  I have attached a short video showing how it works at our side. Can you take a look at it and let me know if I'm missing anything?

Also can you please confirm that you're using the latest R2 2016 release of UI for WinForms?

Looking forward to your reply.

Regards,
Yana
Telerik
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
It
Top achievements
Rank 1
answered on 26 May 2016, 03:10 PM
Hi,

The issue is with the sorting of data in excel when filters are applied not filtering the data. Please find attached a GIF showing how I replicated the problem.

UI for WinForms Q1 2016 SP1 (version 2016.1.216) is the version we are using.

If you need any additional information just ask.
Thanks
0
It
Top achievements
Rank 1
answered on 26 May 2016, 03:21 PM
Oops, here is the GIF.
0
Nikolay Demirev
Telerik team
answered on 31 May 2016, 08:13 AM
Hello,

I have been able to reproduce the issue and I have logged public item in our Feedback Portal where you can track the process on the matter.

Regards,
Nikolay Demirev
Telerik
Tags
SpreadProcessing
Asked by
It
Top achievements
Rank 1
Answers by
Nikolay Demirev
Telerik team
It
Top achievements
Rank 1
Yana
Telerik team
Share this question
or