How to filter by Name in Report

kolaboy
kolaboy Member Posts: 446
Hi Experts,
I have designed a report that is filtering by Employee No., Employer No., but is not filtering by Name and the rest of the fields in the employee table.
I have added First name, middle name, last name in the property of the report as shown
"ReqFilterFields=No.,Employer No.,First Name,Middle Name,Last Name"
But i am still not able to filter by Name. My primary key is employee No.
Can anyone tell me what my problems are please.
Thanks in advance.

Comments

  • ara3n
    ara3n Member Posts: 9,258
    hello kolaboy
    I need a little more info about your report. how many data items, are you using?

    How is the report done? do you have any code to reset the filter. What tables are using?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • kolaboy
    kolaboy Member Posts: 446
    Hi are3n,
    I have only one data item called employee.
    I designed the report using the wizards with sorting by No. as default.
    I have only one code which i wrote to be able to have the Name of institutions and their N0s. as heading when the report is run.
    Here is the Code :
    Employer.GET("Employer No.")
    Name := (Employer. Name);

    I used the employee table to design the report.
    I hope these information will be enough for you to help me.
    Please is urgent.
    Thanks.
  • ara3n
    ara3n Member Posts: 9,258
    ok so the employer is not a dataitem, but a variable.
    Here is what you can do.
    1. Create a dummy dataitem Employer (dummyEmployer).
    onprereport.
    dummyEmployer.copyfilters(Employer);

    You need to change your code.
    Employer.setrange("No.","Employer No.");
    if not Employer.find('-') then
    currReport.skip;
    Name := (Employer. Name);

    Onpredataitem of dummyEmployer add
    currReport.break;
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • kolaboy
    kolaboy Member Posts: 446
    Hi are3n,
    I know that dataitems are taken from tables. But dummyEmployer is not a table, therefore i don't think i can create dummyEmployer as dataitem.

    Am i going to create a new table called dummyEmployer and then use it in dataitem? How can i create dummyEmployer as dataitem? please help.
    Thanks
  • ara3n
    ara3n Member Posts: 9,258
    You are going to use the Employer table. The variable name is DummyEmployer. Do not create a new table
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • kolaboy
    kolaboy Member Posts: 446
    HI ara3n,

    Thanks you very much for your brilliant ideas.
    I have tried what you said, it was giving me small error,but i have managed to solve it . Your ideas gave me lot of glue.
    Thanks once again.
  • ara3n
    ara3n Member Posts: 9,258
    you are welcome. :)
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n