Skip to Content
author's profile photo Former Member
Former Member

Criteria in Main report based on subreport?

Post Author: Robd2007

CA Forum: Formula

Is it possible to base a criteria in the main report on a subreport result?

Really, I want to check if the subreport returns a value, which would be True for the criteria, or if no value is returned, False for the criteria. The subreport is one field only.

Thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 25, 2007 at 07:59 AM

    Post Author: Robd2007

    CA Forum: Formula

    I guess the answer is no then?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 25, 2007 at 04:34 PM

    Post Author: yangster

    CA Forum: Formula

    might i ask why you would need to create a subreport for one field?you can pass a variable back from the subreport to the main report but i don't know what you mean by basing the main report on the subreport

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2007 at 11:24 PM

    Post Author: Robd2007

    CA Forum: Formula

    The reason for the one field is because the field is being used in the main report with a different criteria.

    What I have is a simple report that looks at a list of order numbers and the associated item numbers. I am listing the order numbers along with the items depending on being on of a selection list.

    The aim of the sub report is to see if the order contains a specific item code, which means we no longer want to look at that order, even if that line has one of the selection items.

    Order Number Item Subreport(based on Item4)

    Order1 Item1 |

    Order1 Item2 |-->Show Order1, as it includes Item1 and/or Item2 and/or

    Order1 Item3 |Item3 but no result in subreport

    Order2 Item1 Item4 |--> Don't include Order2, it contains Item1 and/or Item2

    Order2 Item3 Item4 | and/or Item3 but returned aresult for the subreport

    I hope this makes sense, I am not really good at explaining these things sorry 😔

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 12, 2007 at 10:23 PM

    Post Author: mkotza

    CA Forum: Formula

    Maybe this will work?

    Assuming that you have a group on Order Number in your main report and you pass the order number to the subreport: 1) declare a shared boolean variable in your main report which will be your flag that is turned on or off in the subreport (eg. m_flag) 2) make a group footer a and group footer b section. 3) put your subreport in group footer a. 4) put the data you want to print in group footer b. 5) in the subreport set m_flag to true if = item4 (or whatever your condition is). 6) go into the "Section Expert" in the group footer b and click on the x-2 button next to "Suppress". 7) In the suppress formula write

    shared booleanvar m_flag;

    m_flag;

    which will suppress your group footer b line if the subreport set the flag to true. I believe the footers will be run in order, so the subreport in group footer a should always run before the group footer b is printed. Thus the flag will be set and the group footer b output will be conditionally suppressed. You have to make your subreport as small as possible and without borders so you don't see it on the printout.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.