JohnDotOwl
JohnDotOwl

Reputation: 3755

Pasting Data into excel file correctly from textbox

 foreach (string TempSize in sizeArr)
            {
                txtResult.Text += store + "\t" + attributeSet + "\t" + configurableAttri + "\t" + type + "\t" + (ID + "_" + TempColour + TempSize) + "\n";
            }

I am trying to generate Multiple Rows that i can use to paste into excel file. "\n" doesn't seem to show on the "new line" of the textbox.

I tried manually doing "\n" aka shift+enter and copy paste the 3 rows into excel, Excel place a empty space between each of them, anyway to remove that problem too?

Thanks in advance!

Upvotes: 0

Views: 296

Answers (1)

JohnDotOwl
JohnDotOwl

Reputation: 3755

Problem Fixed with "\r\n" instead of "\n" hat's how Windows controls represent newlines

Upvotes: 1

Related Questions