Also, put a TDBBarcode2D component to the form and link the TBarcode2D component to the TDBBarcode2D component if the database support is required.
For example:
RvProject1.Open;
RvProject1.Execute;
RvProject1.Close;
In the event function, change the properties of the TBarcode2D component such as Barcode, Module, and Orientation. Then create a temporary TBitmap object, adjust its size in order to accommodate entire barcode symbol, and use the DrawTo method of the TBarcode2D component to draw the barcode symbol to the temporary TBitmap object. At last, adjust the size of the bitmap component in your report, and assign the temporary bitmap to it.
For example:
var
RvReport: TRaveReport;
RvPage : TRavePage;
RvBitmap: TRaveBitmap;
TmpBitmap: TBitmap;
AWidth, AHeight, ASymbolWidth, ASymbolHeight: Integer;
Scale: Integer;
begin
......
Barcode2D_QRCode1.Barcode := '1234567890';
Barcode2D_QRCode1.Module := 2;
......
with RvProject1.ProjMan do
begin
RvReport := FindRaveComponent('Report1', nil) as TRaveReport;
RvPage := FindRaveComponent('Page1', RvReport) as TRavePage;
RvBitmap := FindRaveComponent('Bitmap1', RvPage) as TRaveBitmap;
end;
TmpBitmap := TBitmap.Create;
try
Barcode2D_QRCode1.DrawToSize(AWidth, AHeight, ASymbolWidth, ASymbolHeight);
TmpBitmap.Width := AWidth;
TmpBitmap.Height := AHeight;
Scale := 72;
RvBitmap.Width := RvReport.XI2U(AWidth / Scale);
RvBitmap.Height := RvReport.YI2U(AHeight / Scale);
RvBitmap.MatchSide := msBoth;
Barcode2D_QRCode1.DrawTo(TmpBitmap.Canvas, 0, 0);
RvBitmap.Image.Assign(TmpBitmap);
finally
TmpBitmap.Free;
end;
......
end;