Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. datagrid problem

datagrid problem

Scheduled Pinned Locked Moved ASP.NET
helpcsharpcssdesign
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kissy16
    wrote on last edited by
    #1

    Here i am trying to convert grid data into pdf format. when i am running i am getting the following error. Acrobat reader 'File does not begin with %PDF-' Here is my code on button click event,on page load i am filling datagrid(dg) with data Response.ContentType = "application/pdf" Response.Charset = "" Me.EnableViewState = False Dim tw As System.IO.StringWriter = New System.IO.StringWriter Dim hw As System.Web.UI.HtmlTextWriter = New HtmlTextWriter(tw) dg.RenderControl(hw) Response.Write(tw.ToString()) Response.End() Can anybody solve my problem. i want to write griddata into pdf format. i am using .net 1.1.

    kissy

    K P 2 Replies Last reply
    0
    • K Kissy16

      Here i am trying to convert grid data into pdf format. when i am running i am getting the following error. Acrobat reader 'File does not begin with %PDF-' Here is my code on button click event,on page load i am filling datagrid(dg) with data Response.ContentType = "application/pdf" Response.Charset = "" Me.EnableViewState = False Dim tw As System.IO.StringWriter = New System.IO.StringWriter Dim hw As System.Web.UI.HtmlTextWriter = New HtmlTextWriter(tw) dg.RenderControl(hw) Response.Write(tw.ToString()) Response.End() Can anybody solve my problem. i want to write griddata into pdf format. i am using .net 1.1.

      kissy

      K Offline
      K Offline
      Karan_TN
      wrote on last edited by
      #2

      I THINK..... you cannot convert the datagrid information to PDF directly. we need some third party tool

      K 1 Reply Last reply
      0
      • K Karan_TN

        I THINK..... you cannot convert the datagrid information to PDF directly. we need some third party tool

        K Offline
        K Offline
        Kissy16
        wrote on last edited by
        #3

        if u have any idea just post the code/link.please

        kissy

        1 Reply Last reply
        0
        • K Kissy16

          Here i am trying to convert grid data into pdf format. when i am running i am getting the following error. Acrobat reader 'File does not begin with %PDF-' Here is my code on button click event,on page load i am filling datagrid(dg) with data Response.ContentType = "application/pdf" Response.Charset = "" Me.EnableViewState = False Dim tw As System.IO.StringWriter = New System.IO.StringWriter Dim hw As System.Web.UI.HtmlTextWriter = New HtmlTextWriter(tw) dg.RenderControl(hw) Response.Write(tw.ToString()) Response.End() Can anybody solve my problem. i want to write griddata into pdf format. i am using .net 1.1.

          kissy

          P Offline
          P Offline
          Prashant B Lavate
          wrote on last edited by
          #4

          use this code Response.ContentType = "application/pdf"; Response.AddHeader("Content-Disposition", strReportName); Response.AppendHeader("content-length", Result.Length.ToString()) ; Response.BinaryWrite(Result); Response.Flush(); Response.Close(); this will render the data in the grid(result) to pdf

          Thanks & Regards, Prashant B. Lavate Software Engineer Mobile : +919423872257 Pune(India)

          K 1 Reply Last reply
          0
          • P Prashant B Lavate

            use this code Response.ContentType = "application/pdf"; Response.AddHeader("Content-Disposition", strReportName); Response.AppendHeader("content-length", Result.Length.ToString()) ; Response.BinaryWrite(Result); Response.Flush(); Response.Close(); this will render the data in the grid(result) to pdf

            Thanks & Regards, Prashant B. Lavate Software Engineer Mobile : +919423872257 Pune(India)

            K Offline
            K Offline
            Kissy16
            wrote on last edited by
            #5

            in the above code what is strreportname and result. I dont want to use anytype of report or third party control.can it be possible?

            kissy

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups