Pregunta: | 18212 - IMPRIMIR QRLABELS VERTICALES CON QREPORT |
Autor: | Héctor Casals |
Tengo que sacar por impresora unas plantillas para cintas de video por lo que la carátula se imprimirá normalmente pero en el lateral se tiene de imprimir de forma vertical. |
Respuesta: | Luis Felipe García Gutiérrez |
No te compliques...
simplemente coloca en en el QReport un objeto QRDBText y pasas a true la propiedad WordWap (la última), luego te aseguras que en el campo de la base de datos que contenga un espacio entre cada letra... y listo! |
Respuesta: | Luis Fernandez |
Ahí te mando un par de rutinas que escriben el texto inclinado. De todas formas no entiendo porque en un QuickReport tienes que imprimir el texto inclinado.Simplemente imprime normal sobre un control y una vez impreso giras el papel que es más sencillo.Es decir no tiene porque estar inclinada a la vista la etiqueta antes de imprimir si la puedes girar una vez impresa.No se si me has entendido.
=============PRIMERA======================== function CreateAngledFont(Fuente: HFont; Angulo: Longint; Calidad: byte): HFont; var FontInfo: TLogFontA; // Estructura de información de la fuente begin // Obtener la información de la fuente pasada como parámetro if GetObject(Fuente, SizeOf(FontInfo), @FontInfo) = 0 then begin Result := 0; exit; end; // Establecer el ángulo FontInfo.lfEscapement := Angulo; FontInfo.lfOrientation := Angulo; // Establecer la calidad FontInfo.lfQuality := Calidad; // Crear una nueva fuente con la información modificada // La nueva fuente deberá ser liberada llamando a DeleteObject Result := CreateFontIndirect(FontInfo); end; procedure TextOutA(Lienzo: TCanvas; X, Y, Angulo: Integer; Texto: string); var FuenteOriginal, FuenteInclinada: HFont; begin // Crea una fuente inclinada a partir de la fuente actual FuenteInclinada := CreateAngledFont(Lienzo.Font.Handle, Angulo,PROOF_QUALITY); if FuenteInclinada <> 0 then begin // La establemos temporalmente como la fuente actual FuenteOriginal := SelectObject(Lienzo.Handle, FuenteInclinada); if FuenteOriginal <> 0 then begin // Escribimos el texto Lienzo.TextOut(X, Y, Texto); // Restaura la fuente original if SelectObject(Lienzo.Handle, FuenteOriginal) = 0 then begin Lienzo.Font.Handle := FuenteInclinada; // raise Exception.Create('No se pudo restaurar la fuente'); exit; end; end; // Libera la fuente inclinada DeleteObject(FuenteInclinada) end; end; procedure TForm1.Button1Click(Sender: TObject); begin with label1 do begin Font.Name := 'Arial'; // IMPORTANTE: fuente True Type Font.Size := 14; Font.Color:=clBlue; //Canvas.Brush.Color := Color; TextOutA(Canvas, 5, 230, 900, 'tocame las narices'); end; end; =============SEGUNDA======================== procedure TForm1.Button2Click(Sender: TObject); procedure EscribeEnVertical(Donde:TCanvas;x,y:integer;Texto:string); var n : integer; begin for n:=1 to Length(Texto) do begin with Donde do TextOut( x, y+(TextHeight('W')*(n-1)), Texto[n]); end; end; begin EscribeEnVertical(Image1.Canvas,10,10,'Pruebilla'); end; |