with VB6 ExportToExcel function is not able to export gridline

Posted by: rajnish-kumar on 8 September 2017, 2:08 pm EST

  • Posted 8 September 2017, 2:08 pm EST

    I am generating a report in VB6 where a perticular type of data are grouped and Shown in particular colour, after exporting this report to excel gridlines are missing for coloured column and rows. Reports without coloured column are working fine.

  • Replied 8 September 2017, 2:08 pm EST

    Hello,

    It is the same behavior as you will see in Excel, If you apply any color to a Column in Excel it doesn't show the grid lines for that too. As the color applied to a Cell overrides the color of its Border.

    And I am able to see all the formatting exported properly.

    I have attached an Exported Excel file with some formatting, please have a look.

     

    Thanks,

     

     


    2009/11/FormattingExported.rar
  • Replied 8 September 2017, 2:08 pm EST

    Thanks Deepak for your reply.


                 Border of Colored column are getting overrriden in case of export and print as well. please have a look on attachment and check if you can provide me any solution.


    2009/11/FarPointExport.rar
  • Replied 8 September 2017, 2:08 pm EST

    Rajnish,

    I used the below snippet to apply the column border (using cell's border) and then exporting it to excxel. On a 3*3 spreadsheet, I used the below to apply cell border to all the columns and then exporting it to excel as well:

    FpSpread1.Sheets(0).Cells(0, 0, 2, 2).Border = New FarPoint.Win.LineBorder(Color.Yellow, 4)

    Thanks

  • Replied 8 September 2017, 2:08 pm EST

    I am using spread control 7 in my program.it don't have sheets property
  • Replied 8 September 2017, 2:08 pm EST

    Rajnish,

    I am sorry, I thought you were using Spread for Windows (.net). In spread(COM) are you also setting the Action property to ActionSetCellBorder before performing the export. Try the following:

    fpSpread1.Action = ActionSetCellBorder
    fpSpread1.CellBorderType = 15
    fpSpread1.CellBorderStyle = CellBorderStyleSolid 
    Thanks
Need extra support?

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

Learn More

Forum Channels