Results 1 to 8 of 8

Thread: Exporting Flexigrid to Semicolon delimeted File

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2007
    Posts
    9

    Exporting Flexigrid to Semicolon delimeted File

    How can I export data to a "Semicolon" delimeted file using flexgrid?
    There are following 4 options while using flexgrid:

    1. gridExport.SaveGrid(dialogSave.FileName, C1.Win.C1FlexGrid.FileFormatEnum.TextComma
    2. dgExport.SaveGrid(dialogSave.FileName, C1.Win.C1FlexGrid.FileFormatEnum.TextCustom
    3. dgExport.SaveGrid(dialogSave.FileName, C1.Win.C1FlexGrid.FileFormatEnum.TextExcel
    4. dgExport.SaveGrid(dialogSave.FileName, C1.Win.C1FlexGrid.FileFormatEnum.TextTab

    Can i cutomerise my delimeter to semicolon or something else?

    How can this be done?

    Please help me out!!!

    Regards
    Sandeep

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Exporting Flexigrid to Semicolon delimeted File

    Have you consulted the documentation for the control? Presumably the TextCustom option is the one you want, but the documentation provided with the control will tell if and how you can specify a custom delimiter.

    Alternatively you could save using a comma delimiter, read the whole file, replace all commas with semicolons then write out the whole file again.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2007
    Posts
    9

    Re: Exporting Flexigrid to Semicolon delimeted File

    Alternate option wont work out as the data itself may contain "," and it may result into change of some meaningfull data to something undesired.

    Please let me know how can i get the documentation of this control?

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Exporting Flexigrid to Semicolon delimeted File

    If you own the control then you have the documentation already. If you're using a trial version then presumably you got it from ComponentOne, so that's the logical place to look for accompanying documentation. They have extensive downloadable and online help documentation for all their components.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    New Member
    Join Date
    May 2007
    Posts
    9

    Re: Exporting Flexigrid to Semicolon delimeted File

    After reading the documnetation which says:

    TextCustom
    Cells are separated with the character specified in the ClipSeparators property.


    I tried the following code

    dim ClipSeparators as string

    datagrdExport.ClipSeparators.Equals(";")
    ClipSeparators = ";"

    datagrdExport.SaveGrid(dialogSave.FileName, C1.Win.C1FlexGrid.FileFormatEnum.TextCustom, C1.Win.C1FlexGrid.FileFlags.IncludeFixedCells, System.Text.Encoding.Default)

    but it didnt worked.....on exporting I am still getting a file which is tab seperated and not semicolon sseperated.

    Please help me...

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Exporting Flexigrid to Semicolon delimeted File

    This line:
    vb.net Code:
    1. datagrdExport.ClipSeparators.Equals(";")
    is checking whether the ClipSeparators property of the grid is equal to ";" and never using the answer. This line:
    vb.net Code:
    1. ClipSeparators = ";"
    is assigning the value ";" to a local variable that is never used. You have to assign the value ";" to the ClipSeparators property of the grid.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7

    Thread Starter
    New Member
    Join Date
    May 2007
    Posts
    9

    Re: Exporting Flexigrid to Semicolon delimeted File

    Thank you so much

    Following code sets the value of delimiter to semicolon
    datagrd.ClipSeparators = ";,"

    prior to this i was trying something like this
    datagrd.ClipSeparators = ";" //only one character
    datagrd.ClipSeparators = ";;" //both characters are same

    But ClipSeparators takes two distinct character long string as input.

    Although i am able to export to a "semicolon delimited file" but still i am not sure what is the use of second character in the ClipSeparators string.

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Exporting Flexigrid to Semicolon delimeted File

    The documentation tells you that the ClipSeparators property contains the column and row delimiters.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width