472,127 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

Exporting question

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
1 1361
scripto
143 100+
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.

Similar topics

3 posts views Thread by chetan | last post: by
1 post views Thread by Jacky11 | last post: by
2 posts views Thread by Yaseen D M | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.