Difference between printing straight to printer or preview?

edited December 2013 in FastReport 4.0
I have two tables, InItems which contains various Items/goods, and InBarcodes which contains Barcodes (zero or more) connected to an Item.
Trying to print out labels containing InItems as MasterData and InBarcodes as DetailData, I managed to make printing from preview work with the following event on a TfrxBarCodeView on the label (OnBeforePrint):
procedure MasterData1OnBeforePrint(Sender: TfrxComponent);
begin
  if <InItems."ITEMCODE"> <> <InBarcodes."ITEMCODE"> then
       BarCode1.Visible := FALSE
  else
       BarCode1.Visible := TRUE;                                                                   
end;
But then, when I try to Print straight to Printer, the Barcode never shows, and I've tested and found the OnBeforePrint event to be the problem there. Anyone have any idea why the difference is?

Additional information: It seems the InBarcodes table is not correctly positioned when Printing to Printer. I am using FilterRecord on the table:
procedure TdkReportSlipManager.OnInBarcodesFilterRecord(DataSet: TDataSet;
  var Accept: Boolean);
var
  tb : TTableInBarcode absolute Dataset;
begin
  Accept := InTable.Obj.ItemCode.AsString = tb.Obj.ItemCode.AsString;
end;
Where the former ItemCode is the current number in the InItem table and it only returns true (Accept) if it finds the corresponding ItemCode in the InBarcodes table.
Happy holidays,
Gisli

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.