0
Answer

Not able to paste data in open office using c#.net from list

parvathi devi

parvathi devi

11y
1k
1
#piccshare_pic_options, #piccshare_pic_options > *, #piccshare_tint, #piccshare_logo { border-radius: 0; -moz-border-radius: 0; border: none; margin: 0; padding: 0; } i am copying data from listview and pasting it in excel it is pasting.but instead of excel.I want to paste in open office excel(calc).for first time copying data from listview it was working fine.but if you copy second time and paste it in open office it is not pasting.but same thing you can paste in excel it is pasting.how to resolve this please any one tell me.here is my code.

StringBuilder buffer = new StringBuilder();

for (int i = 0; i < lv.Columns.Count; i++)
{
buffer.Append(lv.Columns[i].Text);
buffer.Append("\t");
}

buffer.Append("\n");

for (int i = 0; i < lv.Items.Count; i++)
{

buffer.Append(lv.Items[i].SubItems[0].Text);
buffer.Append("\t");
buffer.Append(lv.Items[i].SubItems[1].Text);
buffer.Append("\t");
buffer.Append(lv.Items[i].SubItems[2].Text);

//}

buffer.Append("\n");

Clipboard.SetDataObject(buffer.ToString();