Filtering a report by userid

sabzamsabzam Member Posts: 1,149
Dear All,

I need to set a filter on a report which is the userid. That is instead of having the user entering his user id it is automatically filtered. Should I use setrange or setfilter because they don't seem to work out?

Comments

  • flfl Member Posts: 184
    They will work both. Hard to say why it doesn't work like that. Can you post your code here ?
    Francois
    Consultant-Developper

    http://www.CreaChain.com
  • sabzamsabzam Member Posts: 1,149
    BankLedgerEntry.Setfilter("User ID", USERID);

    Where BankLedgerEntry is of type record "Bank Account Ledger Entry". This code has been set up in the pre-data item.
  • kinekine Member Posts: 12,562
    is "BankLedgerEntry" name of the DataItem or just some global variable?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • aliennavaliennav Member Posts: 449
    No more replies??
  • MbadMbad Member Posts: 344
    Kines question needs to be answered first.
  • aliennavaliennav Member Posts: 449
    Mbad wrote:
    Kines question needs to be answered first.

    thats what i was talking about
  • MbadMbad Member Posts: 344
    Damn missed that one aliennav, sorry
  • vyankuvyanku Member Posts: 791
    create a key of userid in bank ledger entry table.
    In report
    Change the dataItemTableView property to userid .
    it will work. :D
  • kinekine Member Posts: 12,562
    vyanku wrote:
    create a key of userid in bank ledger entry table.
    In report
    Change the dataItemTableView property to userid .
    it will work. :D

    1) Field or Key? do not mix that... why creating key with User ID if it is not necessary.
    2) dataItemTableView has two parts - sorting (active key) and filters. Why to set sorting to USERID if you need filtering?

    It seems that you are answering question which was not asked... 8-[
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.