printing tab into Excel spreadsheet from C#

Sometimes the tab character moves to the next cell.  At other times it just seems to print spaces.
Why the difference?
string test    
using (StreamWriter sw = new StreamWriter("C:\\FalconIngest\\Output\\test\\File.xls", false))
{
    sw.write (test+"\t")
}
AlHal2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RobOwner (Aidellio)Commented:
It would depend on what is in the "test" variable.  Sorry need more info
0
AlHal2Author Commented:
Given that the "test" variable is a string, what further information do you need?  Perhaps I'll be able to give it to you.  The program is ingesting data from spreadsheets and putting them into reformatted spreadsheets.  The text is alpha numeric.
0
RobOwner (Aidellio)Commented:
More What do you expect it to do? Do you want it to move to the next cell or embedded the tab in the cell?
0
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

AlHal2Author Commented:
Move to the next cell.
0
RobOwner (Aidellio)Commented:
It would depend on your format on creating the xls file.  Are you using XML to create the xls or a COM component?  Or are you just writing text to a file and calling it a spreadsheet?

This example shows how to create an XML based spreadsheet.  It highlights one particular method of doing so but really need to know how you are approaching this.
http://www.codeproject.com/Articles/9380/Export-a-DataSet-to-Microsoft-Excel-without-the-us
0
AlHal2Author Commented:
I'm using streamwriter in c# to write to an excel file and calling it a spreadsheet.  What's the best way  to write to a genuine xls (or xlsx) file from within C# (Visual studio 2008)?
0
RobOwner (Aidellio)Commented:
I would use the COM Interop http://msdn.microsoft.com/en-us/library/ms173186(v=vs.80).aspx but that does require Excel to be installed whereever you run your program.
If you're wanting to do this say on a webserver then either have Excel installed or go down the XML path.  The XML Works just as well, just follows the Office Open XML format.  If it's just for a standard spreadsheet with not too many bells and whistles then that will be the go.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AlHal2Author Commented:
Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.