bueno , me respondo a mi mismo , ya se como solucionar el problema
la solucion es exportar el teechart a un qrimage ,
Código Delphi
[-]
Meta := chart1.chart.TeeCreateMetafile(True,chart1.Chart.GetRectangle);
Try
qrimage1.Picture.Metafile.Assign(Meta);
finally
Meta.Free;
end;
ahora estoy intentando que automáticamente , al llamar a la siguiente funcion , en todos los reports que tengo , que me cree los qrimages que hagan falta dinamicamente , exportando todos los tqrcharts que existan en el qreport y asignandolos al qrimage que he creado dinamicamente.
pero algo va mal , no entiendo que pasa , pero el report casca y da un access violation al imprimir la banda.
aqui pongo la funcion , por si alguien me puede ayudar.
( si le quito el RtfImage.Parent:=banda ya no casca , pero no funciona).
sin embargo si creo los qrimages en diseño si funciona.
Código Delphi
[-]
Procedure TrepDetalleDiario.CreaQrChartImagenes(Banda:TqrCustomBand);
var i:integer;
RtfImage:TQRImage;
Meta: TMetaFile;
Begin
for i:=0 to SELF.ComponentCount-1 do begin
if SELF.Components[i] is TQRChart then begin
RtfImage:=TQRImage.Create(banda);
RtfImage.ParentReport:=self;
RtfImage.Parent:=banda;
RtfImage.Enabled:=True;
RtfImage.visible:=true;
RtfImage.size.Width:=TQRChart(Self.Components[i]).Size.Width;
RtfImage.size.Height:=TQRChart(Self.Components[i]).size.Height;
RtfImage.size.Top:=TQRChart(Self.Components[i]).size.Top;
RtfImage.size.Left:=TQRChart(Self.Components[i]).size.Left;
RtfImage.Width:=TQRChart(Self.Components[i]).Width;
RtfImage.Height:=TQRChart(Self.Components[i]).Height;
RtfImage.Top:=TQRChart(Self.Components[i]).Top;
RtfImage.Left:=TQRChart(Self.Components[i]).Left;
Meta := TQRChart(SELF.Components[i]).Chart.TeeCreateMetafile(True,TQRChart(SELF.Components[i]).Chart.GetRectangle);
Try
RtfImage.Picture.Metafile.Assign(Meta);
finally
Meta.Free;
end;
end;
End;
End;
la funcion la llamo desde aqui
Código Delphi
[-]
procedure TRepDetallediario.QRBand2BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
begin
CreaQrChartImagenes(sender);
end;
alguien sabe que estoy haciendo mal ?
Saludos