Ir para conteúdo
  • Cadastre-se

Novo Layout Impressão Boleto


Ver Solução Respondido por FabioPenha77,
  • Este tópico foi criado há 928 dias atrás.
  • Talvez seja melhor você criar um NOVO TÓPICO do que postar uma resposta aqui.

Recommended Posts

Postado

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

  • Consultores
Postado
20 horas atrás, FabioPenha77 disse:

Eu adicionei um novo layout na unit ACBR\Fontes\ACBrBoleto\FC\Fortes\ACBrBoletoFCFortesFr.pas

Boa tarde !
fez de acordo com algum manual específico respeitando as especificações?
Caso queira contribuir com o projeto, se puder anexar o manual que utilizou, as units modificadas e se desejar anexar um print do novo layout.
Vai entrar para uma análise do time sobre a necessidade de um novo layout.

Consultor SAC ACBr

Daniel de Morais (Infocotidiano)
Ajude o Projeto ACBr crescer - Assine o SAC

Projeto ACBr     Telefone:(15) 2105-0750 WhatsApp(15)99790-2976.  Discord

  • Solution
Postado

eu formatei minha maquina e o problema estava em algum resquício de arquivos, após a formatação o novo layout foi reconhecido!

Obrigado por responder e pode considerar o post como resolvido! 

  • Consultores
Postado

Obrigado por reportar.

Fechando. Para novas dúvidas, criar um novo tópico.

image.png

Alexandre de Paula
Gerente de Projetos
Ajude o Projeto ACBr crescer - Assine o Clube PRO                    

Projeto ACBr     Telefone:(15) 2105-0750 WhatsApp(15)99790-2976.  ícone Discórdia Discord   

Projeto ACBr - A maior comunidade Open Source de Automação Comercial do Brasil

 

 

  • Este tópico foi criado há 928 dias atrás.
  • Talvez seja melhor você criar um NOVO TÓPICO do que postar uma resposta aqui.
Visitante
Este tópico está agora fechado para novas respostas
×
×
  • Criar Novo...

Informação Importante

Colocamos cookies em seu dispositivo para ajudar a tornar este site melhor. Você pode ajustar suas configurações de cookies, caso contrário, assumiremos que você está bem para continuar.

The popup will be closed in 10 segundos...
The popup will be closed in 10 segundos...