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

Newbie: is there a way to hide subreports based on parameters?

edited August 2003 in General
Hi all,

I'm completely new to ReportBuilder, and I'm taking a look at
it to see if it can replace my Rave reports...

What I would like to do, is to create a highly run-time customizable
report, by hiding parts of the reports based on parameters.

Would it be possible to show/hide, for example, subreport based
on parameters? (or Regions, for that matter). If so, how?

--

With regards,

Martijn Tonies
Database Workbench - the developer tool for InterBase & Firebird
Upscene Productions
http://www.upscene.com

Comments

  • edited August 2003
    Hi Martijn,

    Below is a quick example I coded that will hide or show a subreport
    connected to a detail pipeline based on the user selection using parameters.
    Be sure you are using the Enterprise or Server trial edition of
    ReportBuilder before you run this example as it uses some RAP code.

    http://www.digital-metaphors.com/tips/HideDetailWithParameters.zip

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2003
    Hi Nico,

    ok - I've installed the Enterprise version... :-/


    It works! :-)

    (something you probably expected *g*)

    But there's no way to do this without some coding? That is, I need the
    enterprise version of RB?

    Thanks for your time.


    --

    With regards,

    Martijn Tonies
    Database Workbench - the developer tool for InterBase & Firebird
    Upscene Productions
    http://www.upscene.com
  • edited August 2003
    Hi Martijn,

    It is possible to do this without using RAP code. (Enterprise Edition). You
    can simply move the code I had in RAP to the ppReport1.OnBeforePrint event
    in Delphi. The code will look something like the following.

    procedure TForm1.ppReport1BeforePrint(Sender: TObject);
    begin
    if ppReport1.Parameters['Visible'].Value then
    ppSubReport1.Visible := True
    else
    ppSubReport1.Visible := False;
    end;

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2003
    Hi Nico,


    I guess this doesn't work if I use load-able templates, right :-)

    --
    Martijn
  • edited August 2003
    Hi Martijn,

    If you are loading different templates in your application, you should
    seriously consider using RAP code instead of Delphi Event Handlers. This
    way all code will be local to the template, not just the application. If
    you try to do this without RAP, you will forced to keep track of the names
    of all the components of each template you load.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2003
    Hi Nico,


    Thought so.

    Thanks for your help.


    --

    With regards,

    Martijn Tonies
This discussion has been closed.