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
  1. Home
  2. General Programming
  3. C#
  4. Export as PDF file from C# page

Export as PDF file from C# page

Scheduled Pinned Locked Moved C#
csharpadobearchitecturehelp
1 Posts 1 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.
  • R Offline
    R Offline
    r aa j
    wrote on last edited by
    #1

    hi all, I want export the pdf file.and I am using following code.In my system .But an error is displaying like adobe readercould not open 'down.pdf' because it is either not a supported file type or because the file has been damaged... DataSet Ds = FillGrid2(sessionvalue, cid, cmid, crid, pid, sdate, edate); Response.Clear(); Response.AppendHeader("Content-Type", "application/pdf"); Response.AppendHeader("Content-disposition", "attachment; filename=Download.pdf"); string str = "<table style='border:1px solid #000000;'>"; str += "<tr>"; str += "<td colspan='5'>" + "<b>Client: </b>" + client + "</td>"; str += "</tr>"; str += "<tr>"; str += "<td colspan='5'>" + "<b>Campaign: </b>" + campaign + "</td>"; str += "</tr>"; str += "<tr>"; str += "<td colspan='5'>" + "<b>Report Summary</b>" + "</td>"; str += "</tr>"; str += "<tr>"; str += "<td>" + "Type" + "</td>"; str += "<td>" + "Impression" + "</td>"; str += "<td>" + "Clicks" + "</td>"; str += "<td>" + "Start Date" + "</td>"; str += "<td>" + "End Date" + "</td>"; str += "</tr>"; for (int i = 0; i < Ds.Tables[0].Rows.Count; i++) { str += "<tr style='border:1px solid #000000;'>"; for (int j = 0; j < Ds.Tables[0].Columns.Count; j++) { str += "<td>" + Ds.Tables[0].Rows[i][j].ToString() + "</td>"; } str += "</tr>"; } str += "</table>"; Response.Write(str); If anybody knows please reply me.. thanks...

    Raaj

    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