Difference between printing straight to printer or preview?
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):
Additional information: It seems the InBarcodes table is not correctly positioned when Printing to Printer. I am using FilterRecord on the table:
Happy holidays,
Gisli
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