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. Web Development
  3. ASP.NET
  4. Writing the contents of response object into an ExcelSheet

Writing the contents of response object into an ExcelSheet

Scheduled Pinned Locked Moved ASP.NET
csshelp
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.
  • C Offline
    C Offline
    crazy_mads
    wrote on last edited by
    #1

    Following is the code that i have written to write contents of response object into an ExcelSheet. Response.Clear(); Response.Buffer = true; Response.ContentType = "application/vnd.ms-excel"; Response.Charset = ""; string sep = ""; foreach (DataColumn dc in dt.Columns) { Response.Write(sep + dc.ColumnName); sep = "\t"; } Response.Write("\n"); int count; foreach (DataRow drow in dt.Rows) { sep = ""; for (count = 0; count < dt.Columns.Count; count++) { Response.Write(sep + drow[count].ToString()); sep = "\t"; } Response.Write("\n"); } If less than 30 records are there in the response , its not writting in the excel sheet. Plzzzz help me:( Mads

    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