Results 1 to 2 of 2

Thread: asp.net gridview to pdf

  1. #1
    Join Date
    Dec 2008
    Posts
    33

    asp.net gridview to pdf

    I want to know that is pdf control can be used for asp.net,can i create pdf on the web.I would like to use the render output of a gridview saved as pdf and then open it for printing. Anything similar would be helpful for me so please suggest me how can i do that. thank you.

  2. #2
    Join Date
    Dec 2008
    Posts
    322

    Re: asp.net gridview to pdf

    try this i think helpful for you

    .aspx

    <asp:TemplateField>

    <ItemTemplate>
    <asp:LinkButton runat="server"

    ID="LinkButton1"
    Text="View File"

    CommandName="open"
    CommandArgument='<%# eval("filePath") %>'

    ToolTip="select to view correspondence">
    </asp:LinkButton>

    </ItemTemplate>

    </asp:TemplateField>

    aspx.vb
    Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs)

    If e.CommandName = "open" Then

    Response.ClearContent()

    Response.ClearHeaders()

    Response.ContentType = "application/pdf"
    Response.WriteFile("\\" + e.CommandArgument.ToString())

    Response.Flush()

    Response.Close()

    End If



    If I add target="blank" to the link button, a new window opens but with nothing in it and the following is displayed within the URL

    javascript:__doPostBack('ctl00$ContentPlaceHolder1$GridView1$ctl03$LinkButton1','')



Similar Threads

  1. Export Gridview to Excel in VB.Net
    By Ariadne in forum Software Development
    Replies: 4
    Last Post: 15-06-2010, 06:30 PM
  2. Datagrid VS Gridview
    By Techno Guru in forum Software Development
    Replies: 5
    Last Post: 16-01-2010, 12:42 PM
  3. Replies: 2
    Last Post: 08-06-2009, 09:54 PM
  4. Nested DataTable for GridView
    By Renderman21 in forum Software Development
    Replies: 3
    Last Post: 08-05-2009, 02:08 PM
  5. Getting data from a selected row in gridview in VB.Net
    By Booth in forum Software Development
    Replies: 2
    Last Post: 15-01-2009, 10:39 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,095,154.74915 seconds with 17 queries