The preface I don't like QuickReport because it has too many problems, it is too flexible. However, during the development process, it is still unable to avoid contact with this problem, especially the control left, almost impossible to replace so many reports to other report controls. I wrote myself using QuickReport in a project. Of course, some are from other places, and I will integrate. 1. Use the Delphi to own the control. Quick Report still exists in Delphi 7, just because Delphi 7 default report tool is RAVE, you can't find it on the toolbar. You can use Components | Install Packages, then click Add, find the Delphi7 installation directory / bin directory and add DCLQRT70.bpl. However, the self-container has no source code, as long as there is a little unsatisfactory requirements, you have to change each report, and the project is simply unable to carry out. Therefore, the source code is too important. 2. Using QuickReport 4.0 ProfessionalFor Delphi7. Www.playicq.com has a source version of the source code, first download, install it. The default is below the Quickrpt subdirectory of the Delphi installation directory. Don't worry! Because there are too many problems. Let's solve the following questions one by one: (1) QrDbText Chinese Fold Problem QrDBText has a attribute wordWrap, I thought that this attribute set to True, I have a good thing, and you will be chaotic! After checking for a long time, it is said that version 3.06 has solved this problem, and later versions have left the road! I am dizzy, but there is any way.
Thousands of hard work, finally found a solution in the rich in the original text: http://www.delphibbs.com/delphibbs/dispq.asp? LID = 620364 Step 1: In the ... / delphi7 / lib directory , Find qrctrls.dcu, delete, or rename, qrctrs.pas and qrdefs.pas and qrdefs.inc on the ... / delphi7 / quickrpt directory Copy to ... / Delphi7 / lib directory, then qrdefs.inc The // {$ Define Ver100} is changed to {$ Define Ver100} Step 2: Then find the TQRCUSTOMLABEL.FORMATLINES process in qrctrls.pas, modify it as follows: Procedure TQRCUSTOMLABEL.FORMATLINES; VAR I, J: Integer; Newline : string; LineFinished: boolean; hasParent: boolean; MaxLineWidth: integer; AAlignment: TAlignment; function aLineWidth (Line: string): integer; begin if hasParent then result: = Muldiv (Longint (ParentReport.TextWidth (Font, Line)), Zoom, 100) else Result: = Canvas.TextWidth (Line); end; procedure FlushLine; begin FFormattedLines.Add (NewLine); NewLine: = ''; end; procedure AddWord (aWord: string); // {$ ifdef ver100 Var S: String; // {$ ENDIF} Begin IF ALINEWIDTH (NEWLINE AWORD)> Width Then Begin if newline = '' TEN BEGIN / / {$ IFDEF VER100} if syslocale.fare Ast1 Begin While True Do Begin IF (AWORD [1] in Leadbytes) and (AWORD)> 1) THEN S: = Copy (AWORD, 1, 2) ELSE S: = Copy (AWORD, 1, 1); IF alinewidth: = newline s; delete (AWORD, 1, Length (s)); end else break; end; end else While AlineWidth (Newline Copy (AWORD, 1, 1 )) Delete (AWORD, 1, 1); end; // {$ else} // While AlineWidth (Newline Copy (AWORD, 1, 1)) 0) Do Begin Repeat // {$ IFDEF VER100} Begin INC (J); if Line [J] in LeadBytes Then Begin Inc (J); Break; End; End; // {$ Else} // INC (j) // {$ ENDIF} or (j> = length (line)); AddWord (Line, 1, J)); Delete (Line, 1, J); J: = 0; end; if not LineFinished then FlushLine; end; end; end; procedure FormatFromCaption; begin AddLine (FPrintCaption); if not UpdatingBounds and hasParent then begin UpdatingBounds: = true; if Height <(longint (ParentReport.TextHeight (Font, ' W ') * zoom Div 100) 1) THEN Height: = (longint (PARENTREPORT.TEXTHEIGHT (Font,' W ')) * Zoom Div 100) 1; UpDatingBounds: = false; end; procedure formatfromstringlist; var j : Integer; Begin IF (Flines.count <> 0) THEN BEGIN IF AutoSize Then Fformatt Else for J: = 0 to flines.count - 1 do addline (FLINES [J]); ELSE IF CSDESIGN ComponentState Then Begin Fcaption: = Name; FormatFromcaption; FCAPTION: = ''; end; end; begin if Parent <> nil then begin if assigned (FFormattedLines) then FFormattedLines.Clear else FFormattedLines: = TStringList.Create; hasParent: = ParentReport <> nil; LineFinished: = false; if CaptionBased then FormatFromCaption else FormatFromStringList; if AutoSize and (not UpdatingBounds) and hasparent the begin MaxlineWidth: = 0; for I: = 0 to FFormattedLines.Count - 1 do if aLineWidth (FFormattedLines [I])> MaxLineWidth then MaxLineWidth: = aLineWidth (FFormattedLines [I]); if Frame.DrawLeft then MaxLineWidth: = MaxLineWidth Frame.Width; if Frame .DrawRight then MaxLineWidth: = MaxLineWidth Frame.Width; UpdatingBounds: = true; AAlignment: = Alignment; // {$ ifdef ver110} if UseRightToLeftAlignment then ChangeBiDiModeAlignment (AAlignment); // {$ endif} case AAlignment of taCenter: Left: = Left ((Width - MaxLineWidth) div 2); taRightJustify: Left: = Left Width - MaxLineWidth; end; Width: = MaxLineWidth; if (FFormattedLines.Count = 0) and (csDesigning in ComponentState) then Height: = ( LONGINT (PARENTREPORT.TEXTHEIGHT (Font, 'W')) * Zoom Div 100) 1; IF (Height "* Zoom Div 100) 1)) THEight: = (longint (Parentreport.TextHeight (font, 'w')) * Zoom Div 100) 1; UpdatingBounds: = false; end; end; doneformat: = true; end; (2) Chinese problem QuickReport's preview box has always been very ugly, or English, after installation 4.0, oh? The print preview interface has changed, increasing the thumbnail and the function of searching text.