Locate record in dataset from report script.

Hi,
This is my second day working with fast report and I have a question about locating a record by using script provides by fast report designer. I'm using Delphi 6 and Fastreport 3
Let say I have prepared a dataset for my report in my program and named it as DS1. DS1 has 2 fields: USERNAME and PHONENo and there are about 100000 records in this dataset. In my report, I just want to print user name for user that has phone number = 123-4567 and ignore the rest. I know there is a way to do that by adding code on the event MasterData1BeforePrint, tocompare the phone number to the above number. If it equals to the number I'm searching then I print the record out, other wise, skip to the next record. This works but it may take long time to skip 99999 users before find the user that is printed out ( I assumed this is the worst case senario). I wonder if anyone know how to use DS1.Locate function in the report script to locate the record instead of the method I have mentioned above.
Thank in advanced for your help
SN

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.