Click here to Skip to main content
15,890,527 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi,
I am actually building a project where i need to pass data to an excel sheet and also multiline comments for particular cells.But after end of first line and then before starting and after ending of each line i am getting a square symbol in excel sheet as output.Can you tell me why is this happening because while debugging the code i cannot find any such symbol.
Posted
Comments
[no name] 3-Jul-12 10:16am    
Well gee... after carefully reviewing the code that you posted that demonstrates your problem and comparing that to the example data that you provided....
dimpledevani 3-Jul-12 10:26am    
i am sorry but i didnt get you...
[no name] 3-Jul-12 10:32am    
I am not surprised. You ask us why your code is doing what it is doing but you did not post any code the demonstrates your problem. And you did not give us an example of the data that you are seeing. How are we supposed to know what your code is doing? Do you take your car to a mechanic and tell him "it's broke" and expect that they know what you mean?
Sandeep Mewara 3-Jul-12 10:31am    
This is not a well framed question! We cannot work out what you are trying to do/ask from the post. Please elaborate and be specific.
Use the "Improve question" link to edit your question and provide better information.
Shemeer NS 3-Jul-12 10:31am    
I doubt that there's some charachetr is going extra that's not identified by the excel

As others said without seeing samples it is difficult to determine.

I would recommend evaluating the string the ends up with that value.

You can do this by iterating each char in string and check if it is a control char and if it is log or trace the value of the character for evaluation (you will need the numeric value of the char since it is not a printable character).

If you find you have a control character that is typically in your string you should be able to trim it out before sending it to excel.

Typically that is caused when you have a control character in the string, such as Chr(10) or Chr(13) by itself. Chr(13)+Chr(10) is the CR LF characters.

EDIT:
Also, if you are using the C# "\n" creating your lines you may be causing the issue in your code, you would probably need to use "\r\n" (I think that is the correct order) so you don't end up with a single LF character.
 
Share this answer
 
v2
Hey Thank you all for suggestions, but i found the solution myself.The combination of \r\n gave me that square symbol.I just replaced it with \n only and its working fine.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900