Filters problem in Report

jpnavjpnav Member Posts: 11
Hi Experts!!

Developed a report with 3 data items for export to excel functionality. Tables are
1.contacts
2. address
3. email

export related data is inserting to a temp table from address data item, data printing from contact table.

filters every thing working perfectly.

Now I added one more data item Childinfo to that report.
4. Childinfo

I am facing a problem with filters not working.

I added code for childinfo related printing, its printing properly, but related to filters where should I add code, pls provide me sample code, so that i can solve this issue.

Thanks for your help in advance.

Jp

Comments

  • kinekine Member Posts: 12,562
    If you want to add some filtering through code, use the OnPreDataItem
    If you want to add filtering based on parent dataitem, check the Properties of the dataitem and set the linking...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • jpnavjpnav Member Posts: 11
    Hi Kamil

    Thanks a Lot for your reply. !!

    I want to add filters through code for childinfo table.

    I added code on OnPreDataItem of Contact, Mail, E-Mail as follows:

    Child.SETRANGE(Child."Contact No.",ChildInfo."Contact No.");
    Child.SETFILTER(Child."Contact No.","Contact No.");

    If this code is not suffient then what could be the code or any sample code for this type of fuctionality.

    other 2 data items filters working fine, newly added dataitem(childinfo)'s filters not working properly.

    Exported data is inserting in table Export contact, code written in Mail and childinfo table,

    suggest me for possibilites.

    Pls suggest me in other dataitems(contact, mail, email) this code

    Thanks!

    Jp
  • BeliasBelias Member Posts: 2,998
    Child.SETRANGE(Child."Contact No.",ChildInfo."Contact No.");
    Child.SETFILTER(Child."Contact No.","Contact No.");
    this instructions will filter child table, not childinfo...
    anyway, do as kine said: link the Data Items with properties, and put the filters in onpredataitem but be careful: if you put childinfo filters in a previous data item, they will be resetted when reaching childinfo dataitem.
    You must put the filters on the related dataitem.

    (you can use variables and then copy the filters, but it's too long to explain and maybe useless for you in this report)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.