Prevent user from viewing all records?

Prevent user from viewing all records?

I have a report that is meant to be used by vendors to view only the records that are assigned to them.
All the vendor information is stored in a separate application, so I need to call a function to get the current user's ID (not the zoho user ID).

The report settings criteria doesn't support using function calls, so instead I'm embedding the report in an html page like this:
  1. if (thisapp.Global.CurrentUserIs("Vendor"))
  2. {
  3.       personID = common.getLoggedInPersonID();
  4.       query = "Assigned_Vendor.ID=" + personID;%>       
  5.       <div elName='zc-component' viewLinkName='Open_Corrective_Actions' params='zc_Header=true& ... &zc_ColMenu=false&<%=query%>'>Loading View...</div>
  6. <%}

The report is supposed to look like this, with only the records that belong to the user:

However, if I try to search for something, or use the show/hide columns menu, this happens:

It displays the search that was used to select that user's records and allows the user to clear the search, which causes the report to show all the records.

Is there any way to prevent the user from viewing the records that they shouldn't be able to access? Preferably without sacrificing the ability to search at all?