Hi, Ryan
I have tried below code, which successfuly saves myfile.pdf file, but
when i am trying to open that myfile.pdf file, its gives me error that "you
can't open. This pdf file is not decoded correctly".
This is code i have tried, Please look at this if you get any idea,
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Response.Clear()
Response.AddHeader("content-disposition", "attachment;filename=myfile.pdf")
Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ContentType = "application/pdf"
Dim stringWrite As New System.IO.StringWriter
Dim htmlWrite As New HtmlTextWriter(stringWrite)
myDataGrid.RenderControl(htmlWrite)
Response.Write(stringWrite.ToString())
Response.End()
End Sub
Regards,
Krunal
Ryan Olshan <[EMAIL PROTECTED]> wrote:
What if you change the stream type to *application/pdf*?
Ryan
On 8/31/05, Krunal Chaklasia wrote:
>
> Hello GroupMembers,
>
> I want to export datagrid to PDF file, i got success export to Excel file
> but didn't find any solutions to export to PDF File.
>
> Anybody have any idea, then please reply me. Anytype of help will useful
> for me.
>
> Thank You,
>
> Regards,
> Krunal Chaklasia
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> [Non-text portions of this message have been removed]
>
>
>
> SPONSORED LINKS
> Basic programming language Computer
> programming languages Programming
> languages Java
> programming language The
> history of computer programming language
> ------------------------------
> YAHOO! GROUPS LINKS
>
>
> - Visit your group "AspNetAnyQuestionIsOk"
> on the web.
> - To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
> - Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service .
>
>
> ------------------------------
>
--
Thank you,
Ryan Olshan
TeraNet Systems
http://www.teranetsystems.com
--------Internet E-Mail Confidentiality Statement--------
The content of and attachment(s) to this electronic transmission contains
information from TeraNet Systems and is intended for the use of the person,
firm or entity to which it is directed herein, and may contain information
that is private, confidential, exempt from disclosure under applicable law,
and/or proprietary to TeraNet Systems and is protected by law. If you are
not the intended recipient, or the employee or agent responsible for
delivering this message to the intended recipient, any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this message in error, please notify the sender,
[EMAIL PROTECTED], immediately by reply e-mail and delete the original
message and any attachment(s) without reading or saving in any matter. Thank
you for your cooperation.
[Non-text portions of this message have been removed]
Yahoo! Groups Links
---------------------------------
Start your day with Yahoo! - make it your home page
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/