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.

Fri Jan 08, 2021 11:13 am

Trying to same workwork object to XLSX
but keep getting
System.FormatException: 'The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. '
even when using the demo ImportDataFromDataTable.

Code: Select all
  Workbook workbook = new Workbook();

            //Create an empty worksheet
            workbook.CreateEmptySheets(1);
           
            //Get the first worksheet
            Worksheet sheet = workbook.Worksheets[0];

            //Create a DataTable object
            DataTable dataTable = new DataTable("Customer");
            dataTable.Columns.Add("No", typeof(Int32));
            dataTable.Columns.Add("Name", typeof(string));
            dataTable.Columns.Add("City", typeof(string));

            //Create rows and add data
            DataRow dr = dataTable.NewRow();
            dr[0] = 1;
            dr[1] = "Tom";
            dr[2] = "New York";
            dataTable.Rows.Add(dr);
            dr = dataTable.NewRow();
            dr[0] = 2;
            dr[1] = "Jerry";
            dr[2] = "China";
            dataTable.Rows.Add(dr);
            dr = dataTable.NewRow();
            dr[0] = 3;
            dr[1] = "Dive Time";
            dr[2] = "Berkely";
            dataTable.Rows.Add(dr);
            dr = dataTable.NewRow();
            dr[0] = 4;
            dr[1] = "Amor Aqua";
            dr[2] = "Florida";
            dataTable.Rows.Add(dr);

            //Import datatable in worksheet
            sheet.InsertDataTable(dataTable, true, 1, 1);

            //Save the Excel file
            string result = "ImportDataFromDataTable_output.xlsx";
            workbook.SaveToFile(result, ExcelVersion.Version2013);

            //Launch the Excel file
            ExcelDocViewer(result);

warrenboard
 
Posts: 4
Joined: Thu Jan 07, 2021 3:06 pm

Mon Jan 11, 2021 2:01 am

Hello,

Thanks for your inquiry and sorry for the late reply as weekend.
I tested your scenario with the latest Spire.XLS Pack(Hotfix) Version:10.12.0, but did not reproduce your issue. If you are using an older version, please download the latest version and try again.
If there are still any issues, please tell us your OS information (e.g. Windows7, 64bit) and the region setting (e.g. China, Chinese) to help us investigate further. Thanks in advance.

Sincerely,
Brian
E-iceblue support team
User avatar

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

Mon Jan 11, 2021 10:06 am

No Joy, is it a license problem
Windows 10 64Bit

warrenboard
 
Posts: 4
Joined: Thu Jan 07, 2021 3:06 pm

Tue Jan 12, 2021 7:45 am

Hello,

Yes, after testing I found that this issue is related to the license. You should be using the wrong license key. Kindly note the correct license key is the value/string of the Key attribute of the element License of your license xml file. And I checked our records and found that your license key starts with “CvX1KxUDRF/g” and ends with “nUa42g3aMKQ==”. Please check it on your side.
If there are any questions, please feel free to contact us.

Sincerely,
Brian
E-iceblue support team
User avatar

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

Tue Jan 12, 2021 9:07 am

licence key is ok

warrenboard
 
Posts: 4
Joined: Thu Jan 07, 2021 3:06 pm

Tue Jan 12, 2021 10:44 am

What's the best way to apply the license in a .net console app

warrenboard
 
Posts: 4
Joined: Thu Jan 07, 2021 3:06 pm

Tue Jan 12, 2021 10:52 am

Hello,

We recommend you apply your license by license key, since sometimes your application could not read the license file because of lack of permission or other reason.
I applied your license key and tested your code in a similar environment, but still did not reproduce your issue. I have sent my test project to you (your registered email address) via email, please run it directly on your side and then let us know your testing results. Looking forward to your feedback.

Sincerely,
Brian
E-iceblue support team
User avatar

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

Return to Spire.XLS