We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Export Excel

Thread ID:

Created:

Updated:

Platform:

Replies:

56732 Feb 20,2007 11:12 AM UTC Jun 25,2007 07:04 AM UTC WinForms 5
loading
Tags: XlsIO
Simon Kakon
Asked On February 20, 2007 11:12 AM UTC

Hi,
I have a problem with the ImportDataView method.
When I use this method with a DataView having null column values, the XlsIo Api throw this
excption :

System.InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'.

Thanks
Simon.



Melba Winshia [Syncfusion]
Replied On February 21, 2007 01:40 PM UTC

Hi Simon,

Thanks for your interest in Essential XlsIO.

I am afraid. I was not able to reproduce the issue [System.InvalidCastException]. Here is the test sample that I used to test this issue.

a rel='nofollow' href="http://www.syncfusion.com/Support/user/uploads/ImportDataTable_Null_661650be.zip">ImportDataTable_Null.zip

Here is the output file generated with out any exception:

SampleOne.xls

Could you please take a look at the sample above and kindly let me know if you still find any problem, if not could you please modify this sample so that I can reproduce the issue. This would help me in investigating this issue further.

Thanks,
Melba

Leonid
Replied On June 18, 2007 08:23 PM UTC

Hi Melba,

You will get that error if you make the following changes in your coding

1. ImportDataTable instead of ImportDataView
2. row["item"] = System.DBNull.Value

Thanks,
Leonid

>Hi Simon,

Thanks for your interest in Essential XlsIO.

I am afraid. I was not able to reproduce the issue [System.InvalidCastException]. Here is the test sample that I used to test this issue.

a rel='nofollow' href="http://www.syncfusion.com/Support/user/uploads/ImportDataTable_Null_661650be.zip">ImportDataTable_Null.zip

Here is the output file generated with out any exception:

SampleOne.xls

Could you please take a look at the sample above and kindly let me know if you still find any problem, if not could you please modify this sample so that I can reproduce the issue. This would help me in investigating this issue further.

Thanks,
Melba

Melba Winshia [Syncfusion]
Replied On June 19, 2007 04:51 AM UTC

Hi Leonid,

I modified the coding as per your suggestions. But I was not able to reproduce the error. Here is the modified sample for your reference:

http://websamples.syncfusion.com/samples/XlsIO.Windows/F56732/main.htm

Could you please take a look at the sample above and kindly let me know if you still find any problem, if not could you please modify this sample so that I can reproduce the issue. This would help me in investigating this issue further.

Thanks,
Melba

Leonid
Replied On June 20, 2007 04:29 PM UTC

Hi Melba,

You didn't make one change that I mentioned in my previous email. If you replace

mySheet.ImportDataView(view, true, 1, 1, true);

with

mySheet.ImportDataTable(table, true, 1, 1, true);

in your coding you will get that error.

Thanks,
Leonid

Melba Winshia [Syncfusion]
Replied On June 25, 2007 07:04 AM UTC

Hi Leonid,

I was able to reproduce the problem in version 4.3.0.30. However, this issue is fixed in version 4.4 and its above version (5.1). Could you please upgrade to our latest versions? Here is the video clip for your reference:(to show that issue is fixed)

http://www.syncfusion.com/Support/user/uploads/Fixedinnewversion_cc2e0750.zip

Kindly let me know if you have any other questions.

Thanks,
Melba



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;