Show Resources that NOT ..

superbrugersuperbruger Member Posts: 41
edited 2004-11-11 in Navision Financials
I have made a new table where I store Resource no. and som other thing when a resource have participated in some education.

Now I want to make a report, where I set the filters for the education, and then show all the Resources that NOT have been at this education.

How do I doo this the easy way?

I tried running the education table, and then mark all the Resources I find, but then - how to show the unmarked Resources ?

Comments

  • ArhontisArhontis Member Posts: 667
    Hi,

    Make a Resource child item on your report, under the education table, but do not link it with the DataItemLink propery. Instead go to the OnPreDataItem trigger of the Resource and enter something like:
    Resource.SETFILTER("No.",'<>'+Education."Resource No.");
    

    That way, for every line in your education table, you will get all the resources that have not been to that education.
  • superbrugersuperbruger Member Posts: 41
    If I understand you, that will not work.

    Each line in then education table is 1 resource.
    Then, if there are 10 resources that have been at this education, the 9 of them will show for each line, among the other resources.

    I made a "work-arround", but I'm not sure that its the best / easiest way.
    When I run through the education table, I put the resource no. in a temporary table.
    Then I go through then resource table, but if I can get the resource no. from the temporary table, I skip this resouce.

    But perhaps there is a better way ?
  • ArhontisArhontis Member Posts: 667
    You are right, that solution is when the Educations is 1 to 1 with the Resources.

    The best way I can think of is to make a table Education with a Code and a Description, and insert that Code to your "Education Resource" table.

    Then you create a report with an Education item and a non linked Resource child item to that, you enter into the Resource OnAfterGetRecord code like:
    "Education Resource".SetRange("Education Code",Education.Code);
    "Education Resource".SetRange("Resource No.",Resource."No.");
    IF "Education Resource".FIND('-') then
      CurrReport.SKIP;
    

    where "Education Resource" is a record variable to your table.

    That solution is like yours but you get to group your educations and you use no buffer tables.
  • superbrugersuperbruger Member Posts: 41
    Yes - I get your idea.
    Will try that too, and see what performs the best, and can give me the best output.

    Thank you. :)
Sign In or Register to comment.