By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,146 Members | 1,614 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,146 IT Pros & Developers. It's quick & easy.

Exporting question

P: 1
I'm attempting to export data from a datagrid. I'm successful at exporting it in xls, doc, html types - but csv and pdf are giving me a headache.

The code I'm using isn't anything fancy:

Response.ContentType="application/pdf";
Response.AddHeader("content-disposition","fileattachment;filename=whatever.pdf ");
Response.Write(oStringWriter.ToString());
Response.End();
break;

I can save the pdf when prompted - but when I try to open it, it says it's corrupt or not a real pdf. Same code above for XML as well, but that just makes an xml file of my entire aspx webpage..not the actual data from my datagrid.

Any suggestions on pdf and xml exporting from datagrids?

Thanks in advance.
Oct 10 '06 #1
Share this Question
Share on Google+
1 Reply


scripto
100+
P: 143
read all of this thread - it may help

http://forums.devx.com/showthread.php?t=143454
Oct 10 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.