Export Excel
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.
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.
SIGN IN To post a reply.
5 Replies
MW
Melba Winshia
Syncfusion Team
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
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
LE
Leonid
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
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
MW
Melba Winshia
Syncfusion Team
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
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
LE
Leonid
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
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
MW
Melba Winshia
Syncfusion Team
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
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
SIGN IN To post a reply.
- 5 Replies
- 3 Participants
-
SK Simon Kakon
- Feb 20, 2007 11:12 AM UTC
- Jun 25, 2007 07:04 AM UTC