We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Save Grid Data into Text / Excel File format

Thread ID:

Created:

Updated:

Platform:

Replies:

46776 Jul 20,2006 07:14 AM Jul 20,2006 09:31 AM Windows Forms 1
loading
Tags: GridControl
Aruni Khanna
Asked On July 20, 2006 07:14 AM

Hi,

I am working on the Syncfusion Datagrid (Essential Suite 1.6.1.0). I am facing a problem when I am trying to save the grid data into a Text file Format. what I am doing right now, is written below:

private void SaveAsTextButton_Click(object sender, System.EventArgs e)
{
try
{
SaveAnalysisFileDialog.ShowDialog();

string temp = @"C:\Documents and Settings\akhanna\Desktop\abcd\temp.txt";
AnalysisResultsGrid.SaveBinary(temp);
StreamReader sr =new StreamReader(temp,System.Text.Encoding.ASCII);

string fileName = SaveAnalysisFileDialog.FileName;

StreamWriter sw = new StreamWriter(fileName,false);

sw.Write(sr.ReadToEnd());

}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}

It is writing the grid data in temp.txt file, But when I am trying to read it, this file is locked. So I am getting nothing in stream reader.

Please suggest me some solution for this problem??

Thanks
Aruni

Administrator [Syncfusion]
Replied On July 20, 2006 09:31 AM

Hi Aruni,

Please refer the forum thread for Text format export.
http://www.syncfusion.com/support/forums/message.aspx?MessageID=45762

Please refer the forum thread for Excel export,
http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=44533

Thanks
Haneef

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;