New Button in Preview Window

I would like to add a Button to the Report Preview Toolbar

I would like to use the Excel Icon, and copy/export the column headings and Data from the currently display report to an xlsx file.

Anyone done anything like this or could offer any insights.

I am using VB.Net.

I have been able to hide buttons, but not add a new one.

Thanks for any advise offered.

Bill Sutton

Comments

  • Hello!

    Here is an example in VB.NET in the Form_Load event:

    Dim btnExcel As New FastReport.DevComponents.DotNetBar.ButtonItem("btnExcelCustom", "Export Excel")
    btnExcel.Image = My.Resources.ExcelIcon
    AddHandler btnExcel.Click, AddressOf OnCustomExcelClick
    PreviewControl1.ToolBar.Items.Add(btnExcel)
    PreviewControl1.ToolBar.RecalcLayout()
    

    In the OnCustomExcelClick handler, you can export previewControl1.Report using Excel2007Export or save the data.

This discussion has been closed.