RAVE ... como alinhar corretamente?
seguinte .,... peguei um codigo que imprime em etiquetas, porem o alinhamento das frases esta saindo meio estranho ... tipo justificado ... ex:
´isso eh um teste de impressao´
com os espaços e talz ...
alguem sabe como resolver?
valeuz!!! :wink:
´isso eh um teste de impressao´
com os espaços e talz ...
alguem sabe como resolver?
valeuz!!! :wink:
procedure TForm1.RvSystem1Print(Sender: TObject);
var Factor : Double;
CurLabel : Integer;
CurCol : Double;
CurRow : Double;
MarginTop : Double;
MarginLeft : Double;
LabelRow : Integer;
LabelRows : Integer;
LabelCols : Integer;
LabelWidth : Double;
LabelHeight : Double;
begin
{---------------------------------------------------------------------------}
{ Configurações externas do formulario de Etiquetas }
{---------------------------------------------------------------------------}
MarginLeft := StrToFloat(suiedit8.Text); {Margem esquerda para impressao da primeira etiqueta}
MarginTop := StrToFloat(suiedit7.Text); {Margem superior para impressao da primeira etiqueta}
LabelWidth := StrToFloat(suiedit9.Text); {Largura da Etiqueta}
LabelHeight := StrToFloat(suiedit10.Text); {Altura da Etiqueta}
LabelRows := StrToInt(suiedit11.Text); {Numero de linhas de etiquetas}
LabelCols := StrToInt(suiedit12.Text); {Numero de colunas de etiquetas}
{---------------------------------------------------------------------------}
CurLabel := 0; {Retorna o numero da etiqueta que está sendo impressa}
LabelRow := 0; {Retorna o numero atual da linha de etiquetas em impressao}
RVSystem1.BaseReport.SetFont(´Arial´,10);
while not Query1.Eof do
begin
Factor := (CurLabel mod LabelCols); {um pequeno artificio matematico pra calcular}
CurCol := (Factor*LabelWidth)+MarginLeft; {a posicao de cada etiqueta dinamicamente.}
CurRow := (LabelRow * LabelHeight) + MarginTop;
RVSystem1.BaseReport.GotoXY(CurCol,CurRow); {Imprime na posicao calculada acima}
RVSystem1.BaseReport.Bold := True;
RVSystem1.BaseReport.PrintLeft(Query1.FieldByName(´rs´).AsString,CurCol);
RVSystem1.BaseReport.NewLine;
RVSystem1.BaseReport.Bold := False;
RVSystem1.BaseReport.PrintLeft(Query1.FieldByName(´ende´).AsString,CurCol);
RVSystem1.BaseReport.NewLine;
RVSystem1.BaseReport.PrintLeft(Query1.FieldByName(´bairro´).AsString+´ - CEP: ´+Query1.FieldByName(´cep´).AsString,CurCol);
RVSystem1.BaseReport.NewLine;
RVSystem1.BaseReport.PrintLeft(Query1.FieldByName(´cidade´).AsString+´ / ´+Query1.FieldByName(´estado´).AsString,CurCol);
RVSystem1.BaseReport.NewLine;
RVSystem1.BaseReport.PrintLeft( ´AT: ´+atenciosamente,CurCol);
RVSystem1.BaseReport.NewLine;
Inc(CurLabel);
{TROCA DE LINHA DE ETIQUETA}
{Se preencheu uma linha de etiquetas, reposiciona na margem e calcula a posicao da proxima etiqueta}
if (Factor = LabelCols-1) then Inc(LabelRow);
{TROCA DE PAGINA}
{Se preencheu uma pagina de etiquetas, reinicializa a impressao}
if (LabelRow >= LabelRows) then
begin
LabelRow := 0;
RVSystem1.BaseReport.NewPage;
end;
{proximo registro}
Query1.Next;
end;
end;
procedure TForm1.dxButton4Click(Sender: TObject);
begin
if not (Dc_MessageDlgCheck(´[AVISO]: Deseja realmente imprimir as etiquetas?´, mtConfirmation,[mbYes, mbNo],0,mrNo,True) = mrYes) then exit;
RVSystem1.SystemPrinter.MarginBottom := 1;
RVSystem1.SystemPrinter.MarginLeft := 1;
RVSystem1.SystemPrinter.MarginTop := 1;
RVSystem1.SystemPrinter.MarginBottom := 1;
RVSystem1.SystemPrinter.Units := unCM;
RVSystem1.SystemPrinter.UnitsFactor := 2.54;
rpDev.Copies := 1;
RVSystem1.SystemPrinter.Copies := rpDev.Copies;
rpDev.Orientation := poPortrait;
RVSystem1.SystemPrinter.Orientation := rpDev.Orientation;
RVSystem1.SystemPreview.FormState := wsMaximized;
RVSystem1.SystemSetups := RVSystem1.SystemSetups - [ssAllowSetup];
rpDev.SelectPaper(´A4´,false);
RVSystem1.SystemPreview.RulerType := rtBothCm;
RVSystem1.Execute;
end;
Salsa
Curtidas 0