[ segment @ 18.02.2015. 21:11 ] @
Dali znae nekoj kako mozam TQRDBText da se pecati vertikalno Najdov nekoj kod function CreateRotatedFont(Font: TFont; Degrees: Integer): HFONT; var LF : TLogFont; begin FillChar(LF, SizeOf(LF), #0); with LF do begin lfHeight := Font.Height; lfWidth := 0; lfEscapement := Degrees*10; lfOrientation := 0; if fsBold in Font.Style then lfWeight := FW_BOLD else lfWeight := FW_NORMAL; lfItalic := Byte(fsItalic in Font.Style); lfUnderline := Byte(fsUnderline in Font.Style); lfStrikeOut := Byte(fsStrikeOut in Font.Style); lfCharSet := DEFAULT_CHARSET; StrPCopy(lfFaceName, Font.Name); lfQuality := DEFAULT_QUALITY; lfOutPrecision := OUT_DEFAULT_PRECIS; lfClipPrecision := CLIP_DEFAULT_PRECIS; case Font.Pitch of fpVariable: lfPitchAndFamily := VARIABLE_PITCH; fpFixed: lfPitchAndFamily := FIXED_PITCH; else lfPitchAndFamily := DEFAULT_PITCH; end; end; Font.Size := 5; //--- Result := CreateFontIndirect(LF); end; (U will need to add "uses Windows, Graphics, SysUtils;") 2. IN THE ONPRINT EVENT OF A LABEL, PLACE THIS CALL TO THE UNIT: TQRDBText(Sender).Font.Handle := CreateRotatedFont(TQRDBText (Sender).Font,90); // 90 is the degree of rotation OR TQRLabel(Sender).Font.Handle := CreateRotatedFont(TQRDBText (Sender).Font,90); // 90 is the degree of rotation 3. VERY IMPORTANT : PRINTMETAFILE PROPERTY OF REPORT U can find this property in: TQuickReport.PrinterSettings.PrintMetaFile This must be set to TRUE, otherwise only the preview will rotate the label, not the printer. Ova funkcionira za da ja izrotira sodrzinata samo na preview no ne i na print t.e. mene mi treba da snimam vo pdf |