Boolean, Error, and Comment support
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
SIGN IN To post a reply.
6 Replies
AD
Administrator
Syncfusion Team
August 31, 2004 11:12 AM UTC
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
>
GR
Greg
September 3, 2004 02:28 PM UTC
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
AD
Administrator
Syncfusion Team
September 4, 2004 03:02 AM UTC
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
>
>
GR
Greg
September 6, 2004 01:50 PM UTC
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.
>
GR
Greg
September 6, 2004 01:53 PM UTC
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
GR
Greg
September 6, 2004 02:04 PM UTC
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
SIGN IN To post a reply.
- 6 Replies
- 2 Participants
-
GR Greg
- Aug 29, 2004 06:22 PM UTC
- Sep 6, 2004 02:04 PM UTC