Avoiding OnBeforePrint

Hi,

I'm changing the "PrintTable" demo from FastReports to don't use the OnBeforePrint event, instead fill in the CrossView on the button click. This is not working.

I need this because I have other thread to fill in the CrossView data, so my program doesn't freezes while a long loop is executing.

Anyone knows how to do this or if there is other way?

Comments

  • gpigpi
    edited 6:22AM
    You can fill cross in OnBeforePrint event only, so you should redesign your program to fill cross in OnBeforePrint event
  • edited 6:22AM
    So in this case my users will view my program freeze because this component?

    FastReport team foresse that filling a crossview manually in the OnBeforePrint event will freeze the program and this is not a good pratice.

    Why I must use the OnBeforePrint event? If I could fill before call the ShowReport method I can show a progress to the user while the crossview is being filled.
  • gpigpi
    edited 6:22AM
    wrote:
    If I could fill before call the ShowReport method
    your program will freeze before ShowReport method. What difference?
    Try to prepare report and then show prepared report
  • edited 6:22AM
    Really there is no difference, but I don't want my program freeze. So I'm looking for an way to generate the report so that the program doesn't freeze while filling the report in the OnBeforePrint event.
  • gpigpi
    edited 6:22AM
    Prepare report in separate thread

Leave a Comment