Using TWPReportBandsDialog

  • Hello,
    We're using WPReporter and WPTools (4.21) with BCB5.

    We've made a model for mail merge. In this model there is some BANDS associated with datasources.

    The first time the procedure ReportBandDialog->Execute() is executed there is a exeption. The second time, and after, the procedure is called there's no problems. We've got the dialog form and we can do modifications.

    What must I do to avoid this first exeption ?

    Inside the form I have a TWPReportBandsDialog with the properties :
    AutoActivate = false
    DataBase = List of datasources
    EditBox = name of a TWPRichText component
    ShowFormulas = false
    StayOnTop = true
    SuperMerge = name of a TWPSuperMerge component
    Tag = 0

    The menu option for accessing the properties of a band contains this code

    TWPReportBandsDialog->Execute()

    The error message is :
    Le projet a provoqué une classe d'exception EAccessViolation avec le message : Violation d'accès à l'adresse 0070B56C Lecture de l'adresse 00000030. Processus stoppé.

  • Hello,
    Thanks for the files you sent to me. The new files didn't solve the problem but they have shown me where to search the problem. I modified the file WPRepED.pas and I have found that the problem was inside two instructions :
    FWPReportBandsDialogForm.Left := Application.MainForm.Left;
    FWPReportBandsDialogForm.Top := Application.MainForm.Top + 32;
    In fact the pointer Application.MainForm is NULL. This explains why I have a exeption. Most of the windows of my project are developed with WINDEV. C++Builder's forms are used for mail merge with WPTOOLS. The main form isn't a C++Builder's form but a WINDEV form.
    I have modified my project and Application.MainForm isn't NULL. Now all works fine.
    Thanks a lot for your responses and your help.

    Jean-Marie DOPPLER