how to edit Preview Toolbar's Buttons?

Hello,

I want to edit the report Preview Toolbar's Buttons,my codes are below:

Dim objFRT As New FastReport.Report

objFRT.Load("test.frx")
objFRT.Preview.Buttons = FastReport.PreviewButtons.Close + FastReport.PreviewButtons.Print 'error occured when running
objFRT.Show()

Any solution?

Thanks.

BTW:Sorry for my bad english.

VB2005+SP1,.NET Framework 2.0+SP1

Comments

  • StarkStark Syria
    edited June 2010
    Hi , have a good day
    I am Not a VB person but I think you should replace + with Or

    More over you must assign your buttons in the EnvironmentSetting Control
    Like :
    // Call this before loading your report
    FastReport.EnvironmentSettings fsetting = new FastReport.EnvironmentSettings();
    fsetting.PreviewSettings.Buttons = FastReport.PreviewButtons.All | FastReport.PreviewButtons.Close;
    


    objFRT.Load("test.frx")
    objFRT.Preview.Buttons = FastReport.PreviewButtons.Close Or FastReport.PreviewButtons.Print 
    objFRT.Show()
    

    Hope this help
  • edited 2:40PM
    Stark wrote: »
    Hi , have a good day
    I am Not a VB person but I think you should replace + with Or

    More over you must assign your buttons in the EnvironmentSetting Control
    Like :
    // Call this before loading your report
    FastReport.EnvironmentSettings fsetting = new FastReport.EnvironmentSettings();
    fsetting.PreviewSettings.Buttons = FastReport.PreviewButtons.All | FastReport.PreviewButtons.Close;
    


    objFRT.Load("test.frx")
    objFRT.Preview.Buttons = FastReport.PreviewButtons.Close Or FastReport.PreviewButtons.Print 
    objFRT.Show()
    

    Hope this help


    It's work fine.

    Thanks a lot.

Leave a Comment