Restrictions on a report

Is there an easy way to prevent a user from seeing certain records when printing a repport. In this case I would like to deny a user to see or print out “ressource” records of other ressource Nos. than his own. Best regards Karl

You want something easier than setting a Filter???

I think Karl is trying to prevent the user based on permissions. I am assuming Karl you are trying to do this without mods. In that case you may be able to work it with SQL record level security, but more than likely you will need code.

Sorry for not beeing clear with my question. I designed a new report, it works almost perfect. I want to set filters on the report. I use two data items, “ressource” and “Res. Journal Line” When a user runs the report I want his res. No. automatically to appear in the req. filter field, and the Journal Template Name, Journal Batch Name as well. I have acces to the code on the reports, but I am a novice, therefore I am in this forum. I have read the App. Des. Guide but I still don´t know on which trigger to put the the filter, and I don´t know what´s the best command in this situation. Off course the best would be, if the user was denied to change the filter-setings, but it would be a big progress to have the filters set automatically regards, Karl

OnInitReport is before the request form is shown. This is where you could put code that auto-fills values on the request forms. You can add code to the controls of the request form to do any textbox-level validation. That way you can use the ERROR statement without Navision closing out of the report altogether. OnPreReport is after the request form closes, but before the report actually runs. This is where you’d typically put code to set required filters. You can make the dataitem filter tab disappear by setting a key in the ‘DataItemTableView’ property of the dataitem. You could then put code in the OnPreReport trigger to get the right Resource number and set the filters accordingly.