Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Sat Aug 31, 2019 5:09 pm

Hello, i have a problem with method ExportDataTable because after i exported, the value in datatable isn't show in displayedtext (because i want data in displayedtext.)

Could you have any suggestions for me about this problem.

I try to write sourcecode and use for loop but it's very slow performance than method ExportDataTable.

This is my code

Code: Select all

            Workbook workbook = new Workbook();
            workbook.LoadFromFile(@"D:\MasterData.xlsx");

            Worksheet ws = workbook.Worksheets["Product"];

            DataTable table = new DataTable();
            object[] param = new object[4];

            for (int i = 3; i <= ws.Rows.Count(); i++)
            {
                CellRange cellrange = ws.Rows[i];

                for (int j = 1; j <= 4; j++)
                {
                    param[j] = cellrange[i, j].DisplayedText;
                }

                table.Rows.Add(param);
            }




Thank you.

redphantom23
 
Posts: 1
Joined: Fri Nov 09, 2018 3:49 am

Mon Sep 02, 2019 6:44 am

Hi,

Thanks for your inquiry.
Do you set the bool value computedFormulaValue as true in the method ExportDataTable?
Code: Select all
             DataTable dt = ws.ExportDataTable(CellRange, false, true);

If you still have the issue, please provide your input Excel file and also tell us what values are different between ExportDataTable and DisplayedText for further investigation.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Thu Oct 17, 2019 9:11 am

Hi,

Greetings from E-iceblue.
Has your issue been resolved? Could you please give us some feedback at your convenience?

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Thu Dec 17, 2020 5:38 pm

Hello,

I have the same issue.

The values from Date column are like 1/3/2020 12:00:00 AM instead of Thursday, January 2, 2020.
The values from Currency column are like 100 instead of $100.00.

Here is my code:

Code: Select all
using (var excel = new Workbook())
{
    excel.LoadFromFile(file);

    var ws = excel.Worksheets[0];
    var dt = ws.ExportDataTable(ws.Range, true, true);
}


We use Spire.Office for .NET version: 5.12.0.

Excel file is attached.

Regards
Attachments
Contacts - Join with Excel.zip
(7.55 KiB) Downloaded 129 times

profiler007
 
Posts: 72
Joined: Wed Nov 13, 2019 11:32 am

Fri Dec 18, 2020 4:04 am

Hello,

Thanks for your inquiry.
I tested your scenario and indeed observed the behavior you mentioned. I have posted it to our Dev team with the ticket SPIREXLS-3033. If there is any update, we will let you know.
Besides, since the display format of the datetime in Microsoft Excel is related to the region settings, in order to ensure that the fix for this issue will work perfectly for you, please tell us your region settings (e.g. English, US). Looking forward to your response.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Fri Dec 18, 2020 7:05 am

Country: United States
Regional format: English (United States)
Time Zone: UTC +02:00

profiler007
 
Posts: 72
Joined: Wed Nov 13, 2019 11:32 am

Fri Dec 18, 2020 8:13 am

Hello,

Thanks for sharing more information.
We will notify you immediately if there is any update.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Mon Jan 25, 2021 7:13 am

Hello,

Glad to inform you that we just released Spire.Office Platinum Version:6.1 which fixes your issue, please download it from the following links to test on your side. Looking forward to your testing result.
Website link: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget link: https://www.nuget.org/packages/Spire.Office/6.1.0

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Wed Feb 03, 2021 7:37 am

Hello,

How is your issue now? Does this hotfix solve your issue? Could you please give us some feedback at your convenience?

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.XLS

cron