ActiveDelphi - Índice do Fórum ActiveDelphi
.: O site do programador Delphi! :.
 
 FAQFAQ   PesquisarPesquisar   MembrosMembros   GruposGrupos   RegistrarRegistrar 
 PerfilPerfil   Entrar e ver Mensagens ParticularesEntrar e ver Mensagens Particulares   EntrarEntrar 

Problema com relatório (RAVE)

 
Novo Tópico   Responder Mensagem    ActiveDelphi - Índice do Fórum -> Automação Comercial
Exibir mensagem anterior :: Exibir próxima mensagem  
Autor Mensagem
AndreZc
Membro Junior
Membro Junior


Registrado: Quinta-Feira, 22 de Abril de 2010
Mensagens: 383
Localização: Rio de Janeiro

MensagemEnviada: Ter Abr 19, 2011 3:42 pm    Assunto: Problema com relatório (RAVE) Responder com Citação

Bom dia. Então, estou gerando relatórios com cód. barra através do Rave, no entanto, alguns códigos acabam encavalando encima de outros. A rotina que estou usando para avanço é esta:

Código:
procedure TFPrincipal.avancaEtiqueta;
begin
  CurColuna:= CurColuna+3.4; {+3.4} {5}
  if CurColuna > 10.9 then  {2x3,4 = 10,2}     {10.6} {9.15}
  begin
    CurColuna:= 0.6;
    CurLinha:= CurLinha+1.5;
   if curLinha > 1 then {>}
   begin
      ReportSystem1.BaseReport.NewPage;
      CurColuna:= 0.6;
      CurLinha:= 1;
    end;
  end;
end;


e a que estou usando para imprimir é essa:

Código:

procedure TFPrincipal.ReportSystem1Print(Sender: TObject);
Var
  CampoCodBarras: string;
  descDoProduto: string;
  descProdutoCort: string;
  I: Integer;

begin
  MarginLeft := edtMargemEsq.Value; { 1 } { Margem lado }
  MarginTop := edtMargemEsq.Value; { 1 }   { Margem Topo }
  LabelWidth := 3.4; { 4.9 } { 3.2 } { 3.5 }
  LabelHeight := 2.5; { 2.8 } { Altura entre um campo e outro }
  LabelRows := 1; { Quantidade de etiquetas por folha }
  LabelCols := 3; { Quantidade de colunas }
  CurLabel := 0; { Inicia na primeira coluna }

  conexao.CDS_VIRTUAL.first;

  ReportSystem1.BaseReport.SetFont('Arial', 6.5); { Arial } { 4 }

  { Cria o componente MemoBuf }
  MemoBuf := TMemoBuf.Create;

  while not conexao.CDS_VIRTUAL.eof do { Eof = End of file }
  begin
    CampoCodBarras := conexao.CDS_VIRTUAL.fieldbyname('COD_BARRAS').asstring;
    Factor := (CurLabel mod LabelCols);
    CurColuna := (Factor * LabelWidth) + MarginLeft - 0.4;
    CurLinha := (LabelRow * LabelHeight) + MarginTop;

    ReportSystem1.BaseReport.GotoXY(CurColuna, CurLinha - 0.4); { -0.4 }
    ReportSystem1.BaseReport.Bold := true;

    ReportSystem1.BaseReport.Bold := false;

    for I := 0 to conexao.CDS_VIRTUAL.fieldbyname('quantidade').AsInteger - 1 do
    begin
      descDoProduto:= conexao.CDS_VIRTUAL.FieldByName('NM_PRODUTO').AsString;
      if length(trim(descDoProduto)) > 34 then
      begin
            {Desc. cortada}
            descProdutoCort:=  cortaString(descDoProduto, 35, False);
            MemoBuf.Text := descProdutoCort;
      end
      else
      begin
        MemoBuf.Text := descDoProduto;
      end;


      MemoBuf.SaveBuffer;
      with Sender as TBaseReport do
      begin
        YPos := 0.7; {0.4} {0.6}
        MemoBuf.PrintStart := CurColuna -0.5; {-1} { Margem inicial } {-0.6}
        MemoBuf.PrintEnd := MemoBuf.PrintStart + 2.8; {3.8} { Margem final }
        MemoBuf.Justify := pjCenter;  {pjRight}
        PrintMemo(MemoBuf, 0, true);
      end;

      if length(trim(conexao.CDS_VIRTUAL.fieldbyname('COD_BARRAS').asstring))
          = 13 then PrintBarcodeEAN(ReportSystem1, CurLinha+0.1, CurColuna,
          conexao.CDS_VIRTUAL.fieldbyname('COD_BARRAS').asstring)

          else if (length(trim(conexao.CDS_VIRTUAL.fieldbyname('COD_BARRAS').asstring))
          = 11) or (length(trim(conexao.CDS_VIRTUAL.fieldbyname('COD_BARRAS').asstring))
          = 12) then
          begin
          PrintBarcode128(ReportSystem1, CurLinha+0.1, CurColuna -0.29,
          conexao.CDS_VIRTUAL.fieldbyname('COD_BARRAS').asstring);
          end



          else  PrintBarcode128(ReportSystem1, CurLinha+0.1, CurColuna,  {-0.3}
          conexao.CDS_VIRTUAL.fieldbyname('COD_BARRAS').asstring);











          if conexao.CDS_VIRTUAL.fieldbyname('quantidade')
          .AsInteger > 1 then begin
              avancaEtiqueta;

           end; end;
                    Inc(CurLabel); If Factor = LabelCols - 1 Then Inc(LabelRow);
        If LabelRow >= LabelRows Then Begin LabelRow := 0;
        ReportSystem1.BaseReport.NewPage;
         End;

        conexao.CDS_VIRTUAL.next;
           end;

        pgAltura := 11.0; pgLargura := 10.50; // Aqui está bom!
        alturaDaFolha := (LabelHeight + 0.3) * CurLinha; end;


PorFavor, alguém sabe me dizer onde está o meu erro lógico?

Grato desde já.[/code]
Voltar ao Topo
Ver o perfil de Usuários Enviar Mensagem Particular
Mostrar os tópicos anteriores:   
Novo Tópico   Responder Mensagem    ActiveDelphi - Índice do Fórum -> Automação Comercial Todos os horários são GMT - 3 Horas
Página 1 de 1

 
Ir para:  
Enviar Mensagens Novas: Proibido.
Responder Tópicos Proibido
Editar Mensagens: Proibido.
Excluir Mensagens: Proibido.
Votar em Enquetes: Proibido.


Powered by phpBB © 2001, 2005 phpBB Group
Traduzido por: Suporte phpBB