ClientReport Set Default AutoSearch Expression

TECH TIP: ClientReport – Default AutoSearch Expression

The ClientReport.GetAutoSearchParameters method can be used to retrieve Report.AutoSearchFields[] fields from the report server. You can then assign the AutoSearchField.SearchExpression value and call the print method.

As an example, add the following code to the RBServer\Demos\Clients\ClientReport example.

{----------------------------------------------------------}

procedure TfrmClientReport.btnPrintClick(Sender: TObject);
begin

  {set the volume and report name}
  rsClientReport1.VolumeName := 'Report Files';
  rsClientReport1.ReportName := 'Customers\Orders\Order List';

  {retrieve the autosearch paramters from the server and set the default search expression}
  if rsClientReport1.GetAutoSearchParameters then
    rsClientReport1.AutoSearchFields[0].SearchExpression := 'S';
    
  rsClientReport1.Print;
  
end;