Spire.XLS for .NET is a professional Excel .NET library that can be used to any type of .NET( C#, VB.NET, ASP.NET, .NET Core) application and Java (J2SE and J2EE) application.

Tue Oct 24, 2017 2:09 pm

Hello.
I'm trying out the Spire.XLS to merge some OpenXml Excel files.
My problem is that when create a Workbook and load the files from disk, there are rows missing.
The source Excel files has first row with values, then three empty rows, and then six additional rows with values. This is represented in OpenXml as:
Code: Select all
<x:row r="1" spans="1:64">
<x:row r="5" spans="1:64">
<x:row r="6" spans="1:64">
<x:row r="7" spans="1:64">
<x:row r="8" spans="1:64">
<x:row r="9" spans="1:64">
<x:row r="10" spans="1:64">

This would be row 1 to 10 in the excel file.
However, after loading it into a Workbook object I only get rows 1 to 6 corresponding to rows 1 to 6 in the excel file, including the empty rows ie missing rows 7, 8, 9 and 10. The same issue exists with all the files I'm working with(provided to me from a 3rd party).
Loading the files like this:
Code: Select all
Workbook wb = new Workbook();
wb.LoadFromFile(@"C:\temp\960b6192-dc68-4c84-b204-4e28c8acefcc.xlsx", true);

And accessing the sheet rows like this for example:
Code: Select all
var rows = wb.Worksheets[6].Rows;

What could be the problem? Any suggestions?

// Hakan

haktho
 
Posts: 4
Joined: Fri Oct 20, 2017 12:04 pm

Wed Oct 25, 2017 2:42 am

Hello Hakan,

Thanks for your inquiry.
Sorry I didn't reproduce the issue you mentioned. To help us with a better investigation, could you send your sample file to us(support@e-iceblue.com)?

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Wed Oct 25, 2017 7:07 am

Hello Hakan,

Thanks for sharing your file.
After an initial test, I confirm that your sample file works well with the latest hotfix Spire.XLS Pack Hotfix Version:7.12.100. Please upgrade to it and try again. In addition, we can offer you a 1-month free license of Spire.XLS to help remove the warning message. Please contact our sales team (sales@e-iceblue.com) to get it if you need.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Wed Oct 25, 2017 8:52 am

Initial tests is working.
Thank you very much for the quick support.

// Hakan

haktho
 
Posts: 4
Joined: Fri Oct 20, 2017 12:04 pm

Wed Oct 25, 2017 9:00 am

Hi Hakan,

Thanks for your feedback.
Please feel free to contact us if you need further assitance.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Wed Oct 25, 2017 2:14 pm

I am trying to copy rows from one sheet to another and having problem getting the formatting right.
Code: Select all
target.InsertRow(lastrow + 1, rowCount);
CellRange from = source.Range[6, 1, source.LastRow, source.Columns.Length];
CellRange to = target[lastrow + 1, 1];
target.Copy(from, to, true);

There are a couple of columns/cells with NumberFormatting "YYYY-mm-dd" in the source sheet. However, the resulting inserted/copied rows does not. It has NumberFormatting "General", even though I set the bool parameter copyStyle to 'true' in the Worksheet.Copy method. This means that instead of "2017-02-14" Excel displays "42780".

I have verified that the cells in question, in the CellRange source, actually have a style, and is set correctly. What could be the reason for this? Any suggestion?

haktho
 
Posts: 4
Joined: Fri Oct 20, 2017 12:04 pm

Thu Oct 26, 2017 7:19 am

Hello Hakan,

Thanks for your inquiry.
Please change your code to source.Copy(from, to, true).
Besides, I found another problem of the incorrect column width after copying and I have referred it to our dev team for a further investigation. Once there's any update, I will let you know.
If there's still any doubt, please share your entire code and the sample files .

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Thu Oct 26, 2017 8:12 am

Hello again,
Please change your code to source.Copy(from, to, true).

This did the trick. Its working now.

Thank you very much for your support.

// Hakan

haktho
 
Posts: 4
Joined: Fri Oct 20, 2017 12:04 pm

Thu Oct 26, 2017 8:18 am

Hello Hakan,

Thanks for your feedback.
Welcome to contact us if you need any help.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Tue Nov 07, 2017 2:21 am

Hello Hakan,

Greetings from e-iceblue support team!
We are glad to inform that the incorrect column width issue has been resolved in the latest hotfix Spire.XLS Pack(Hotfix) Version:7.12.109. Welcome to download it.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Return to Spire.XLS