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.
Unfortunately, activation email could not send to your email. Please try again.

Boolean, Error, and Comment support

Thread ID:

Created:

Updated:

Platform:

Replies:

18371 Aug 29,2004 02:22 PM Sep 6,2004 10:04 AM Windows Forms 6
loading
Tags: XlsIO
Greg
Asked On August 29, 2004 02:22 PM

Good Day, I am able to open and read many more files, thanks. A problem I encountered today is not being able to read boolean entries, directly edited error entries, and comments. I suspect that I simply don''t know how to go about reading comments, although I did successfully write comments (wish the comment box size was auto-created - I had to give it a height to be practical) In Excel, enter True into a cell, and False into another cell, and #Value! into another cell. All without quotes. The first two create Boolean cell types, while the third creates an Error cell type (as seen in XML Spreadsheet export). When I read this xls file, I get cell.IsBlank is true on all three of these. I want to be able to read and write these value types, but it seems you are only currently supporting Formulas, Text, and Numbers. Also note that the HasFormula returns a System.Object instead of a bool. There is another, I think FormulaHidden that also is typed as object when it should be bool. As for the comment, entering one in Excel, I can discover no method to retrieve it during ExcelRW reading. I was able to create one with AddComment, but had to strip out my \r and \n characters as Excel displayed unknown graphics for those. Not sure what I need to use for newlines in comments yet. Please let me know how to do all of the above. Thanks, Greg

Administrator [Syncfusion]
Replied On August 31, 2004 07:12 AM

Hi Greg, 1) The bug with ExcelRW not reading Bool entries, error entries will be fixed soon. 2) The bug with HasFormula and FormulaHidden returning objects will also be fixed. 3)You can read the comments in a cell using IWorksheet.Range["A2"].Comment.Text 4) Comments height issue will also be fixed. 5) Use \n for new lines in comments mySheet.Range["B4"].AddComment().Text = "Hello\nWorld\nThis\nis\na\ntest"; We really appreciate your suggestions and feedback. Best regards, Stephen. >Good Day, > >I am able to open and read many more files, thanks. A problem I encountered today is not being able to read boolean entries, directly edited error entries, and comments. I suspect that I simply don''t know how to go about reading comments, although I did successfully write comments (wish the comment box size was auto-created - I had to give it a height to be practical) > >In Excel, enter >True >into a cell, and >False >into another cell, and >#Value! >into another cell. All without quotes. The first two create Boolean cell types, while the third creates an Error cell type (as seen in XML Spreadsheet export). When I read this xls file, I get cell.IsBlank is true on all three of these. I want to be able to read and write these value types, but it seems you are only currently supporting Formulas, Text, and Numbers. > >Also note that the HasFormula returns a System.Object instead of a bool. There is another, I think FormulaHidden that also is typed as object when it should be bool. > >As for the comment, entering one in Excel, I can discover no method to retrieve it during ExcelRW reading. I was able to create one with AddComment, but had to strip out my \r and \n characters as Excel displayed unknown graphics for those. Not sure what I need to use for newlines in comments yet. > >Please let me know how to do all of the above. > >Thanks, >Greg >

Greg
Replied On September 3, 2004 10:28 AM

Stephen, 3) I presumed that was the syntax. Unfortunately it doesn''t work. irange.Comment fails. 5) Yes, that actually works. My bug appears to be with .Net''s string.Trim() function (not researched further). I''ve changed it to .Replace() and all is good. Please actually try reading a comment from an xls file that you open. ... OK, I''ll send you one. I get error: ''ecell.Comment.Text'' does not exist (and yes, the ecell is the correct irange, verified by checking ecell.Text) Thanks, Greg >Hi Greg, > >1) The bug with ExcelRW not reading Bool entries, error entries will be fixed soon. > >2) The bug with HasFormula and FormulaHidden returning objects will also be fixed. > >3)You can read the comments in a cell using > >IWorksheet.Range["A2"].Comment.Text > >4) Comments height issue will also be fixed. > >5) Use \n for new lines in comments > >mySheet.Range["B4"].AddComment().Text = "Hello\nWorld\nThis\nis\na\ntest"; > >We really appreciate your suggestions and feedback. > >Best regards, > >Stephen. > >>Good Day, >> >>I am able to open and read many more files, thanks. A problem I encountered today is not being able to read boolean entries, directly edited error entries, and comments. I suspect that I simply don''t know how to go about reading comments, although I did successfully write comments (wish the comment box size was auto-created - I had to give it a height to be practical) >> >>In Excel, enter >>True >>into a cell, and >>False >>into another cell, and >>#Value! >>into another cell. All without quotes. The first two create Boolean cell types, while the third creates an Error cell type (as seen in XML Spreadsheet export). When I read this xls file, I get cell.IsBlank is true on all three of these. I want to be able to read and write these value types, but it seems you are only currently supporting Formulas, Text, and Numbers. >> >>Also note that the HasFormula returns a System.Object instead of a bool. There is another, I think FormulaHidden that also is typed as object when it should be bool. >> >>As for the comment, entering one in Excel, I can discover no method to retrieve it during ExcelRW reading. I was able to create one with AddComment, but had to strip out my \r and \n characters as Excel displayed unknown graphics for those. Not sure what I need to use for newlines in comments yet. >> >>Please let me know how to do all of the above. >> >>Thanks, >>Greg >> comment1_2732.zip

Administrator [Syncfusion]
Replied On September 3, 2004 11:02 PM

Hi Greg, I tested with the attached file but was able to successfully read the comment in cell A1. Please try running this sample F18371ReadComments_8637.zip and let me know if you see the problem in this sample also. I am using version 2.1.0.9. Also, the other issues[Bool, error support] that you had reported in this thread have been fixed internally. Thank you for your co-operation. Best regards, Stephen. >Stephen, > >3) I presumed that was the syntax. Unfortunately it doesn''t work. irange.Comment fails. > >5) Yes, that actually works. My bug appears to be with .Net''s string.Trim() function (not researched further). I''ve changed it to .Replace() and all is good. > >Please actually try reading a comment from an xls file that you open. ... OK, I''ll send you one. I get error: ''ecell.Comment.Text'' does not exist (and yes, the ecell is the correct irange, verified by checking ecell.Text) > >Thanks, >Greg > > >>Hi Greg, >> >>1) The bug with ExcelRW not reading Bool entries, error entries will be fixed soon. >> >>2) The bug with HasFormula and FormulaHidden returning objects will also be fixed. >> >>3)You can read the comments in a cell using >> >>IWorksheet.Range["A2"].Comment.Text >> >>4) Comments height issue will also be fixed. >> >>5) Use \n for new lines in comments >> >>mySheet.Range["B4"].AddComment().Text = "Hello\nWorld\nThis\nis\na\ntest"; >> >>We really appreciate your suggestions and feedback. >> >>Best regards, >> >>Stephen. >> >>>Good Day, >>> >>>I am able to open and read many more files, thanks. A problem I encountered today is not being able to read boolean entries, directly edited error entries, and comments. I suspect that I simply don''t know how to go about reading comments, although I did successfully write comments (wish the comment box size was auto-created - I had to give it a height to be practical) >>> >>>In Excel, enter >>>True >>>into a cell, and >>>False >>>into another cell, and >>>#Value! >>>into another cell. All without quotes. The first two create Boolean cell types, while the third creates an Error cell type (as seen in XML Spreadsheet export). When I read this xls file, I get cell.IsBlank is true on all three of these. I want to be able to read and write these value types, but it seems you are only currently supporting Formulas, Text, and Numbers. >>> >>>Also note that the HasFormula returns a System.Object instead of a bool. There is another, I think FormulaHidden that also is typed as object when it should be bool. >>> >>>As for the comment, entering one in Excel, I can discover no method to retrieve it during ExcelRW reading. I was able to create one with AddComment, but had to strip out my \r and \n characters as Excel displayed unknown graphics for those. Not sure what I need to use for newlines in comments yet. >>> >>>Please let me know how to do all of the above. >>> >>>Thanks, >>>Greg >>> > >comment1_2732.zip > >

Greg
Replied On September 6, 2004 09:50 AM

Hey Stephen, Glad to read that ExcelRW will be supporting booleans and errors. Thanks for your example on reading comments. It took a bit of work to figure out why I couldn''t see comments in my project, yet your example worked. The answer: I was using Immediate Command Mode and/or Quickview whereas you just used it directly in running code. I often use debug command mode to query and peer into data structures before writing the code. Since I received an error message stating that Comments.Text was not there, I assumed it wasn''t! Please address the Command Mode bug, and if you can, educate me as well as to why they are different (two different symbol tables, maps, etc.??) Maybe this lack of info in command mode and quickview is why I can''t find Group information (to read)? Thanks, Greg >Hi Greg, > >I tested with the attached file but was able to successfully read the comment in cell A1. Please try running this sample > >F18371ReadComments_8637.zip > >and let me know if you see the problem in this sample also. I am using version 2.1.0.9. >

Greg
Replied On September 6, 2004 09:53 AM

Unfortunately, when I attempt to access Comment.Text and it is not there, the system blows. Since I avoid try/catch as much as possible, I would prefer that it either returns a blank string("") or that you implement a .HasComment function. If there is another mechanism that I am failing to use, please enlighten me. Thanks, Greg

Greg
Replied On September 6, 2004 10:04 AM

Strike my last message. I discovered that I can merely test for (.Comment != null) The prior complaint about debug Command Window mode stands, however. Thanks, Greg

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.

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.

;