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.

Thu Sep 09, 2021 1:10 pm

Hi, Team E-ICEBlue
I am trying to load CSVfile then save it to excel and then fill it into data table but there an error occur. Kindly see the attachment below for reference.
Attachments
Spire Xlx Error CSV to XLX.JPG
Spire Xlx Error CSV to XLX.JPG (46.37 KiB) Viewed 2623 times

saqib016
 
Posts: 4
Joined: Thu Sep 09, 2021 1:05 pm

Fri Sep 10, 2021 6:14 am

Hello,

Thanks for your inquiry.
Are you trying to use multiple components of Spire in the same project? Since each of our products is independent and incompatible, if you want to use multiple components of Spire in a same project, you need to download Spire.Office (the latest version is Spire.Office Platinum(Hotfix) Version: 6.8.2 ) to avoid incompatibility issues.
Or if I misunderstood, please share your project with us for further investigation. You could send it to us(support@e-iceblue.com) via email. Thanks in advance.

Sincerely,
Brian
E-iceblue support team
User avatar

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

Fri Sep 10, 2021 9:22 am

Thanks for your reply yes I am using multiple components now I understand the problem when you describe so I am going to check it with your suggestion if any problem occur ill post reply again.
Thanks Team ICE-BLUE

saqib016
 
Posts: 4
Joined: Thu Sep 09, 2021 1:05 pm

Fri Sep 10, 2021 2:46 pm

Hi Team ICE-Blue,
Thanks for Your Collaboration It help me to much at every time now I have new Inquiry please see this also.
I want to pick minimum or maximum value from a date column suppose in my file date column is [2] so I want to pick its Minimum and Maximum date value and save it any two different string variables.
Attachments
Sample.JPG
Sample.JPG (20.71 KiB) Viewed 2600 times

saqib016
 
Posts: 4
Joined: Thu Sep 09, 2021 1:05 pm

Fri Sep 10, 2021 4:21 pm

Hi Team ICE-Blue,
Thanks for Your Collaboration It help me to much at every time now I have new Inquiry please see this also.
I want to pick minimum or maximum value from a date column suppose in my file date column is [2] so I want to pick its Minimum and Maximum date value and save it any two different string variables.
Attachments
getMax or Min value.JPG
getMax or Min value.JPG (46.02 KiB) Viewed 2596 times

saqib016
 
Posts: 4
Joined: Thu Sep 09, 2021 1:05 pm

Mon Sep 13, 2021 3:57 am

Hello,

Thanks for your inquiry and sorry for the late reply as weekend.
Please refer to the following code to meet your needs.
Code: Select all
            Workbook workbook = new Workbook();
            workbook.LoadFromFile(@"CSVToExcel.csv", ",");
            workbook.SaveToFile("result.xlsx",ExcelVersion.Version2016);
            workbook.LoadFromFile(@"result.xlsx");
            Worksheet worksheet = workbook.Worksheets[0];
            string text = worksheet.Columns[2].CellList[1].Text;
            DateTime max = DateTime.ParseExact(text, "dd/MM/yy HH:mm", System.Globalization.CultureInfo.InvariantCulture);

            DateTime min = DateTime.ParseExact(text, "dd/MM/yy HH:mm", System.Globalization.CultureInfo.InvariantCulture);

            for (int i=2; i< worksheet.Columns[2].Count; i++)
            {
                string text1 = worksheet.Columns[2].CellList[i].Text;
                if (DateTime.Compare(max, DateTime.ParseExact(text1, "dd/MM/yy HH:mm", System.Globalization.CultureInfo.InvariantCulture)) < 0)
                {
                    max = DateTime.ParseExact(text1, "dd/MM/yy hh:mm", System.Globalization.CultureInfo.InvariantCulture);
                }

                if (DateTime.Compare(min, DateTime.ParseExact(text1, "dd/MM/yy HH:mm", System.Globalization.CultureInfo.InvariantCulture)) > 0)
                {
                    min = DateTime.ParseExact(text1, "dd/MM/yy HH:mm", System.Globalization.CultureInfo.InvariantCulture);
                }
            }

            Console.WriteLine(max.ToString("dd/MM/yy H:mm"));
            Console.WriteLine(min.ToString("dd/MM/yy H:mm"));
            Console.ReadKey();


Sincerely,
Brian
E-iceblue support team
User avatar

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

Sat Sep 18, 2021 10:08 am

Hello,

Greetings from E-iceblue!
Did the code we provided work for you? Any feedback will be greatly appreciated.

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