Boa Tarde!
Eu adicionei um novo layout[RLReport] chamado LayoutPadraoCarta na unit ACBR\Fontes\ACBrBoleto\FC\Fortes\ACBrBoletoFCFortesFr.pas.
e Adicionei o tipo lPadraoCarta na unit ACBR\Fontes\ACBrBoleto\ACBrBoletoConversao.pas
conforme abaixo:
TACBrBolLayOut = (lPadrao, lCarne, lFatura, lPadraoEntrega, lReciboTopo, lPadraoEntrega2, lFaturaDetal, lTermica80mm, lPadraoPIX, lPrestaServicos, lCarneA5, lPadraoCarta);
*Ja desinstalei e limpei o componente ACBR da maquina inteira, ele reconhece o lPadraoCarta normalmente no assistente de codigo.
mas o problema é q ele nao carrega o RElatorio na Variavel RLLayout, e isso acontece apenas no Layout novo q eu Criei,
conforme abaixo:
procedure TACBrBoletoFCFortes.ImprimirInternal(AStream: TStream);
var
frACBrBoletoFortes : TACBRBoletoFCFortesFr;
RLFiltro : TRLCustomSaveFilter;
RLLayout: TRLReport; ***VAriavel Citada***
i: Integer;
Bitmap : TBitmap;
JPEG: TJPEGImage;
begin
frACBrBoletoFortes := TACBrBoletoFCFortesFr.Create(Self);
try
with frACBrBoletoFortes do
begin
case LayOut of
lCarne : RLLayout := BoletoCarne;
lReciboTopo : RLLayout := BoletoReciboTopo;
lFaturaDetal : RLLayout := LayoutFaturaDetal;
lTermica80mm : RLLayout := LayoutTermica;
lPrestaServicos: RLLayout := LayoutServicos;
lCarneA5 : RLLayout := LayoutCarneA5;
lPadraoCarta : RLLayout := LayoutPadraoCarta; ***VAriavel q nao esta sendo carregada, debuguei e esta passando normalmente na linha mas simplesmente retorna nulo***
else
RLLayout:= LayoutBoleto;
end;
if (NumCopias > 0) and (RLPrinter.Copies <> NumCopias) then
begin
RLPrinter.Copies := NumCopias;
end;
RLLayout.PrintDialog := MostrarSetup; ***Aqui retorna um erro, pq a variavel RlLayout esta chegando nula***
RLLayout.ShowProgress := MostrarProgresso;
RLLayout.Title := TituloRelatorio;
RLLayout.JobTitle := 'boleto ' + ACBrBoleto.Banco.nome;
if TituloPreview <> '' then
begin
RLLayout.PreviewOptions.Defaults := pdIgnoreDefaults;
RLLayout.PreviewOptions.Caption := TituloPreview;
end
else
RLLayout.PreviewOptions.Defaults := pdUseDefaults;
if PrinterName <> '' then
RLPrinter.PrinterName := PrinterName;
if Filtro = fiNenhum then
begin
if MostrarPreview then
begin
RLLayout.Title := '';
RLLayout.PreviewModal;
end
else
RLLayout.Print;
end
else
begin
if not RLLayout.Prepare then
Exit;
case Filtro of
fiHTML : RLFiltro := RLHTMLFilter1;
fiJPG:
begin
for i := 0 to RLLayout.Pages.PageCount - 1 do
begin
Bitmap := NeedAuxBitmap;
Bitmap.Width := RLLayout.Pages[i].Width;
Bitmap.Height := RLLayout.Pages[i].Height;
Bitmap.PixelFormat := pf32bit;
Bitmap.Canvas.Brush.Color := clWhite;
Bitmap.Canvas.Brush.Style := bsSolid;
Bitmap.Canvas.FillRect(Rect(0, 0, Bitmap.Width, Bitmap.Height));
RLLayout.Pages[i].PaintTo(Bitmap.Canvas, Rect(0, 0, Bitmap.Width, Bitmap.Height));
NomeArquivo := ChangeFileExt(NomeArquivo, '');
JPEG := TJPEGImage.Create;
try
JPEG.CompressionQuality := 100;
JPEG.Assign(Bitmap);
JPEG.SaveToFile(NomeArquivo + FormatCurr('000', I+1) + '.jpeg');
finally
JPEG.Free;
end;
end;
exit;
end;
else
RLFiltro := RLPDFFilter1;
end;
RLFiltro.ShowProgress := MostrarProgresso;
RLFiltro.FileName := NomeArquivo;
if RLFiltro = RLPDFFilter1 then
begin
RLPDFFilter1.DocumentInfo.Title := RLLayout.Title;
if Assigned(AStream) then
RLPDFFilter1.FilterPages(RLLayout.Pages, AStream)
else
RLPDFFilter1.FilterPages(RLLayout.Pages)
end
else
RLFiltro.FilterPages(RLLayout.Pages);
end;
end;
finally
frACBrBoletoFortes.Free ;
end;
end;
Alguem poderia me ajudar?
estou esquecendo de adicionar em mais alguma lugar do componente?
Desde ja agradeço a ajuda!
Por favor me desculpem se o post estiver fora do padrão, é meu primeiro Post aqui!
Atenciosamente,
Fabio