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 / C++ / MFC
  4. how to save the value/string of CFlexgrid cells as a file onto hard disk?

how to save the value/string of CFlexgrid cells as a file onto hard disk?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
6 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.
  • Z Offline
    Z Offline
    zeus_master
    wrote on last edited by
    #1

    how to save the value/string of CFlexgrid cells as a file onto hard disk? :(

    N 1 Reply Last reply
    0
    • Z zeus_master

      how to save the value/string of CFlexgrid cells as a file onto hard disk? :(

      N Offline
      N Offline
      Nibu babu thomas
      wrote on last edited by
      #2

      I guess you will have to write them yourself. There are no inbuilt methods for this purpose AFAIK.


      Nibu thomas Software Developer

      Z 1 Reply Last reply
      0
      • N Nibu babu thomas

        I guess you will have to write them yourself. There are no inbuilt methods for this purpose AFAIK.


        Nibu thomas Software Developer

        Z Offline
        Z Offline
        zeus_master
        wrote on last edited by
        #3

        use the CFile class? and then read the value/string of every cells? Is there any simple method?:->

        N 1 Reply Last reply
        0
        • Z zeus_master

          use the CFile class? and then read the value/string of every cells? Is there any simple method?:->

          N Offline
          N Offline
          Nibu babu thomas
          wrote on last edited by
          #4

          :shrugs: Can't say. Well I can suggest you this... I don't know how feasible this is... Serialize(or write) the object into a file and then when you need it read back the object from file.


          Nibu thomas Software Developer

          V 1 Reply Last reply
          0
          • N Nibu babu thomas

            :shrugs: Can't say. Well I can suggest you this... I don't know how feasible this is... Serialize(or write) the object into a file and then when you need it read back the object from file.


            Nibu thomas Software Developer

            V Offline
            V Offline
            venadder
            wrote on last edited by
            #5

            The flexgrid has option to save files as CSV. I did it over a year ago, so don't remember the details, but i do remmeber saving files as CSV from Flexgrid. Check the method listings in the help.

            V 1 Reply Last reply
            0
            • V venadder

              The flexgrid has option to save files as CSV. I did it over a year ago, so don't remember the details, but i do remmeber saving files as CSV from Flexgrid. Check the method listings in the help.

              V Offline
              V Offline
              venadder
              wrote on last edited by
              #6

              Check the SaveGrid method for FlexGrid,here is a quick look: SaveGrid Method Saves grid contents and format to a file. Syntax [form!]VSFlexGrid.SaveGrid FileName As String, SaveWhat As SaveLoadSettings, [ FixedCells As Boolean ] Remarks This method saves a grid to a binary or to a text file. The grid may be retrieved later with the LoadGrid method. Grids saved to text files may also be read by other programs, such as Microsoft Excel or Microsoft Word. The parameters for the SaveGrid method are described below: FileName As String The name of the file to create, including the path. If a file with the same name already exists, it is overwritten. SaveWhat As SaveLoadSettings This parameter specifies what should be saved. Valid options are: Constant Value Description flexFileAll 0 Save all data and formatting information. flexFileData 1 Save only the data, ignoring formatting information. flexFileFormat 2 Save only the global formatting, ignoring the data. flexFileCommaText 3 Save data to a comma-delimited text file. flexFileTabText 4 Save data to a tab-delimited text file. flexFileCustomText 5 Save data to a text file using the delimiters specified by the ClipSeparators property. flexFileExcel 6 Save all data and formatting information to an Excel97 file. This filter does not support frozen color rows or columns. Options As Variant (optional) When saving and loading text files, this parameter allows you to specify whether fixed cells are saved and restored. The default is False, which means fixed cells are not saved or restored. When saving and loading Excel files, this parameter allows you to specify the name or index of the sheet to be loaded, or the name of the sheet to be saved. If omitted, the first sheet is loaded. The options for saving fixed rows, columns, and translated combo values include: Constant Value Description flexXLSaveFixedCells 3 Saves fixed cells. flexXLSaveFixedRows 2 Saves fixed rows. flexXLSaveFixedCols 1 Saves fixed columns. flexXLSaveRaw 4 Saves raw (untranslated) data. For example, the options can be written as: fg.SaveGrid "book1.xls", flexFileExcel fg.SaveGrid "book1.xls", flexFileExcel, "sheetName" fg.SaveGrid "book1.xls", flexFileExcel, flexXLSaveFixedCells fg.SaveGrid "book1.xls", flexFileExcel, flexXLSaveFixedRows fg.SaveGrid "book1.xls", flexFileExcel, flexXLSaveFixedCols fg.SaveGrid "book1.xls"

              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