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. Excel Files

Excel Files

Scheduled Pinned Locked Moved C#
questioncssdatabasetutorial
4 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.
  • D Offline
    D Offline
    DJCRIS12
    wrote on last edited by
    #1

    Hello Code Project I'm developing an app and i'm having some issues so i hope somebody helps me out I have a "form" in that form i made a search to a table from a database named "Vehicle_Information" So i filter the results through checkboxes example ◘ID ◘GPS ID ◘NAME .... So when the user checks ◘ID, the column of "ID" appears on the Data Grid i can create an excel file from a datagrid but when the data is created ALL THE COLUMNS AND DATA APPEARS ON THE EXCEL FILE! and i don't want that , i just want the columns the user selected. My Question is: HOW CAN I SEND TO AN EXCEL FILE A GROUP OF SELECTED COLUMNS OF DATA FROM A DATAGRIDVIEW???? I've tryed so hard :/ Thanks.

    D F 2 Replies Last reply
    0
    • D DJCRIS12

      Hello Code Project I'm developing an app and i'm having some issues so i hope somebody helps me out I have a "form" in that form i made a search to a table from a database named "Vehicle_Information" So i filter the results through checkboxes example ◘ID ◘GPS ID ◘NAME .... So when the user checks ◘ID, the column of "ID" appears on the Data Grid i can create an excel file from a datagrid but when the data is created ALL THE COLUMNS AND DATA APPEARS ON THE EXCEL FILE! and i don't want that , i just want the columns the user selected. My Question is: HOW CAN I SEND TO AN EXCEL FILE A GROUP OF SELECTED COLUMNS OF DATA FROM A DATAGRIDVIEW???? I've tryed so hard :/ Thanks.

      D Offline
      D Offline
      DamithSL
      wrote on last edited by
      #2

      This is what you want http://www.aspsnippets.com/Articles/ASP.Net-GridView-Export-only-selected-columns-to-Excel-Sheet.aspx[^]

      1 Reply Last reply
      0
      • D DJCRIS12

        Hello Code Project I'm developing an app and i'm having some issues so i hope somebody helps me out I have a "form" in that form i made a search to a table from a database named "Vehicle_Information" So i filter the results through checkboxes example ◘ID ◘GPS ID ◘NAME .... So when the user checks ◘ID, the column of "ID" appears on the Data Grid i can create an excel file from a datagrid but when the data is created ALL THE COLUMNS AND DATA APPEARS ON THE EXCEL FILE! and i don't want that , i just want the columns the user selected. My Question is: HOW CAN I SEND TO AN EXCEL FILE A GROUP OF SELECTED COLUMNS OF DATA FROM A DATAGRIDVIEW???? I've tryed so hard :/ Thanks.

        F Offline
        F Offline
        frostcox
        wrote on last edited by
        #3

        Hey Excel object model is a very powerfull object in the .net family. You can easly select Which values to export usind the Range property of the class. For instance if you wanted to export say cell A1 to A12 you can set the Excel.Range("A1 A12") when exporting hope this helps

        D 1 Reply Last reply
        0
        • F frostcox

          Hey Excel object model is a very powerfull object in the .net family. You can easly select Which values to export usind the Range property of the class. For instance if you wanted to export say cell A1 to A12 you can set the Excel.Range("A1 A12") when exporting hope this helps

          D Offline
          D Offline
          DJCRIS12
          wrote on last edited by
          #4

          The thing is i'm not an expert on C#, and here's an image to show u how i want the program to function You can notice the checkboxes so, if only check box of ID is cheked then when i click to EXPORT TO EXCEL only the column of ID will exported.

          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