Skip record in report

ShahShah Member Posts: 15
hi,
first of all, sorry for my english :roll:

i have a general problem with reports. imagin we have a report using 3 recordsets:
activity
user
timeentries

the report shows for each activity for each user the timeactivities. this is no problem. but what if for one activity there is no timeentries and so you want that the report skips this activity?

i dont know how...

Comments

  • krikikriki Member, Moderator Posts: 9,118
    On the dataitem there is a property "PrintOnlyIfDetail". Put this to yes for both Activity and User. (I suppose Activity is first level, User second level and time third level).
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • SavatageSavatage Member Posts: 7,142
    you could change the property on the dataitem for "PrintOnlyIfDetail" to YES

    or use the SKIP see c\side reference guide

    SKIP
    Use this function to skip the current iteration of the current data item.

    SKIP
    Comments
    While you can use SHOWOUTPUT to suppress printing the output from a section in a report, SKIP allows you to suppress any processing at all and move on.

    Example
    If you perform some processing in the OnAfterGetRecord trigger of a data item, and do not want this processing to take place in some situations, you can use SKIP in this way:

    IF Balance = 0 THEN
    CurrReport.SKIP
    ELSE
    ... // some processing

    A typical situation where you will use SKIP like this is when you want to retrieve records from a related table, using values in the current record for forming a filter. If the values in the current record already indicate that no records from the related table will be retrieved, there is no need to perform this processing - and you can use SKIP to avoid it.
  • SavatageSavatage Member Posts: 7,142
    I Guess I was too slow 8)
  • krikikriki Member, Moderator Posts: 9,118
    Savatage wrote:
    I Guess I was too slow 8)
    But you gave also other possibilities =D>
    I'm getting close to 1000!
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • SavatageSavatage Member Posts: 7,142
    kriki wrote:
    I'm getting close to 1000!

    It's a long satisfing journey, isn't it \:D/
  • ShahShah Member Posts: 15
    tx all for the replies....
    but that dont solve my problem because there is no relation between activity and user...
    and i can't use the funktion skip in activity because at that time i dont know whether there is an entry in timeentries...

    :?
  • krikikriki Member, Moderator Posts: 9,118
    So if I understand well, for each activity, you have to search the users who have entries and print the user and the entries?
    In this case, you can make a dataitem with activity.
    Under it and indented a dataitem on User. You have to scan all users for each activity. So this can be a little slow.
    Under user, you have the entries (indented twice). This you link to the user, so it only shows the entries of the user. In the "OnPreDataItem()"-trigger, you have to put a filter so the entries show only the entries of current Activity.
    And you can use "PrintOnlyIfDetail"=YES on User and entries.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • ShahShah Member Posts: 15
    that's it
    i already genarated the report the way u said und sat the "PrintOnlyIfDetail"=YES for activities. but forgot to set "PrintOnlyIfDetail"=YES for user....

    thank u and all the others
    =D> :D
Sign In or Register to comment.