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

Can I hide a SubReport based on a Variable OnCalc event

edited October 2005 in General
Hi,

I have a Variable in the footer of a sub report that calculates whether or
not the sub report should be visible. However I cannot actually hide the sub
report in Report Builder 7.04. Does anyone have any ideas?

Comments

  • edited October 2005
    Hi Dan,

    Where are you checking the value of the variable and setting the visibility
    of the subreport? You might try creating a two pass report and checking the
    value and assigning hte visibilty of the subreport on the first pass.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2005
    Nico

    If I add the following code on the the OnEndFirstPass report I cannot
    compile. I get the following message 'Undeclared identifier SubReport1'
    despite dragging the visible property from the properties sub report.

    if (DBCalc1.Value <= 10) then
    begin

    SubReport1.Visible := false;

    end;


  • edited October 2005
    Hi Dan,

    Sorry, I did not realize you were using RAP. For future reference please
    post all RAP related questions to the RAP newsgroup.

    You will need to create a global variable that references the Subreport1
    object to access it inside the actual subreport. Take a look at the
    following demo I created for an example of how to do this in RAP.

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

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.