ColumnDragMove -problem

Posted by: doron on 8 September 2017, 12:27 pm EST

  • Posted 8 September 2017, 12:27 pm EST

    hi


    i have a spread that is binded to a data table


    the data table has for each column a caption


    because of this when trying to ColumnDragMove


    it does not do so - to solve this i use the ColumnDragMove event


    and e.MoveContent = false


    but after doing so i want to use SaveExcel - the excel I get is messed up !!!!


    help please !!!


    doron


     


    ColumnDragMove


     

  • Replied 8 September 2017, 12:27 pm EST

    doron -

    By caption do you mean the text in the column header?  I do not have a problem moving columns when bound to a database.
  • Replied 8 September 2017, 12:27 pm EST

    hi Scotts


    I have attached a small project in zip


    you will see that after draging a column


    when you save the spread as excel the columns


    are not as displayed in spread .


     


    thanks


    Doron


     


     


    2007/03/WindowsApplication17.zip
  • Replied 8 September 2017, 12:27 pm EST

    Doron -

    I ran your project and it works fine for me.  What are you seeing in the saved excel file?
  • Replied 8 September 2017, 12:27 pm EST

    hi Bob


    you will see that after draging a column to a new position


    for example move column 1 to  column 0


    you will see that the column header names have changed but


    THE DATA DID NOT !!!!!!!!!


    please help !!!!!


    doron


     


     

  • Replied 8 September 2017, 12:27 pm EST

    hi Bob


    you will see that after draging a column to a new position


    for example move column 1 to  column 0


    WHEN SAVEING the spread as Excel ( with SaveExcel function )


    you will see that the column header names have changed but


    THE DATA DID NOT !!!!!!!!!


     


    please help !!!!!


    doron

  • Replied 8 September 2017, 12:27 pm EST

    Doron,


    Try setting the AutoGenerateCOlumns property to False and assign the DataField property to each Column you want bound.

  • Replied 8 September 2017, 12:27 pm EST

    hi Scotts


     


    I'll try that :-)


     


    doron

  • Replied 8 September 2017, 12:27 pm EST

    hi scottss


    your edvice did not help .


    I tried using the AutoGenerateColumns property  = false  still no good .


     


     


     


     


     


     


     


     


     

  • Replied 8 September 2017, 12:27 pm EST

    Doron,


    What code did you use to set the captions to the columns? Could you post a small zipped project for us to debug the issue you are seeing?

  • Replied 8 September 2017, 12:27 pm EST

    doron,


    When exporting to Excel, the data that is exported is from the DataModel and not the View on the screen. Moving columns will not move the columns in the DataModel unless you have the MoveContent parameter set to True. So, setting the parameter to false, should give you a resulting Excel file like you see except the header text is in the incorrect location. I have reported this as a bug (#20165) for the development team to fix for the next maintenance release.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels