Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Control Preview Form visibility

edited February 2002 in General
I need to control visibility of the preview form.This means that i want to
create the form but keep it invisible until some conditions are true. I
couldn't make this just using the preview form because in
ppProd.PrintToScreen you call show, what makes the form visible.I create a
ShowForm property, add a if in the show, and get my problem solved.
Did i miss something? Can i make this without change anything in rb code? If
not i sugest you to include this in your next release, because this creates
the folowing problem:
I do not use RAP, but if by mistake i click on the Calc tab or something
like that, RB includes raCodMod unit in the form (as well as other units of
RAP) and then i can't build project because raCodMod was compiled with
another version of ppClass.TppCostumReport.To solve it i get into TextDFM
and delete CodeModule object, and all works fine, but this can be very
anoying when working with people new to RB in the same project.

Thanks for your atencion.

Artur Azevedo

Comments

  • edited February 2002
    This is when the user clicks from the design workspace to the preview
    workspace, you do not want to show the preview form for some reason? What
    is the goal of these conditions? Are your conditions search parameters for
    the query? You should use the Autosearch feature of RB in this case. There
    are autosearch demos in the installed ..\RBuilder\Demos directory.

    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited February 2002
    Jim:

    The client application sends a report request, the Report server
    recieves the request, print the report to archive, then the client opens the
    raf file, and create it, then show it if is in conditions to do this else
    keeps it invisible, and show it when the user asks to do it. It's a little
    more complex than this, but it makes sense, believe.This is the reason why i
    need to control the preview form visibility.

    The raCodMod problem, it's just a consequence of change ppProd.pas. Before
    changing this file, something like 40 reports had the raCodMod include
    without any problem.RaCodMod is included if in design time i click on the
    calc tab or something like that, and then i can't build the project.

    Best Regards,
    Artur Azevedo
  • edited February 2002
    Sorry, I wasn't sure what you were codin' for. You aren't gonna want to
    change the interface section of RB source if you have RAP. The TppProducer
    ancestor provides a PreviewForm property, so you should be able to set its
    Visible property. But why not suspend the call to ArchiveReader.Print,
    instead? Create a notification so that the archived report can be printed
    only in response to an event. Have your archive reader form class listen to
    the other object which is performing this condition check. Once the
    condition is met on the object, it will send a notification to its
    listeners. Then the listener will call ArchiveReader.Print. Maybe I'm out in
    left field somewhere. I would certainly rather try to call Print only when
    needed, instead of trying to control the previewer and have to change the
    source.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.