如果某一个字段中内容太长,有什么方法(比如自动使字体变小,或自动使这一栏变宽以便于自动换行)可以处理?该如何做?敬请不吝赐教。

解决方案 »

  1.   

    使用DataMemo就可以轻松实现自动折行,
    但是在中文字符可能会出现乱码
    这种情况在Rave5.1.1中不是经常出现
    但是在低版本的Rave中经常出现
      

  2.   

    是在Databand中的datatext字段,换成DataMemo好像不行?
      

  3.   

    to konhon:比如用datamemo替换Name字段,有十条纪录,好像datamemo中只有第十条纪录的Name字段的数据,datamemo的属性设置和被替换的datatext应该是一样的。(我是用向导生成的一张报表)谢谢。
      

  4.   

    你这个问题应该是出在了前台数据集或者报表的DataView上面
    你找到DataView刷新以下,我在我的报表中使用了
    DataMemo没有出现你说的问题,
    如果不行,放置过一个Databand加DataMemo试试
    我用的是Rave5.1.1
      

  5.   

    Rave之Memo控件断行中文乱码问题的完美解决 
    delphi7所附Rave5之Memo控件,在中文一行不能打印完时能够自动断行,但不能按整字来断行,有时一个中文字会被截断,造成下行的混乱.      問題已經被我完美解決!請把RpMemo.pas文件中的TMemoBuf.GetLine函數進行如下的脩改。然后重新編譯RvCore.dpk包。把編譯獲得的RvCore50.bpl拷貝到Rave.exe對應的目錄即可!function TMemoBuf.GetLine( Width: longint;
    var Eol: boolean): string;
    var
    TestWidth: longint;
    SavePos: longint;
    NewWord: string;
    S1: string;
    S2: string;
    StartPos: longint;
    FormatState: TFormatState;
    StartState: string;
    AdjWidth: longint;
    FirstLine: boolean;//SCYANGYU ************** Start **************
    Function CurLineEndHalfCHS(Const CurLineStr:String):Boolean;
    Var
    bIsDBCS:Boolean;
    jLength,jFor:Integer;
    Begin
    bIsDBCS := False;
    jLength:=Length(CurLineStr);
    for jFor := 1 to jLength do
    begin
    if bIsDBCS then
    bIsDBCS := False
    else
    Begin
    if Windows.IsDBCSLeadByte(byte(CurLineStr[jFor])) then
    bIsDBCS := True;
    End;
    end; //end of for
    Result:=bIsDBCS;
    End;
    //SCYANGYU ************** End **************begin { GetLine }
    { Get a line of text that will fit within PrintStart to PrintEnd }
    EOL := false;
    NewLine := true;
    StartPos := -1;
    S1 := '';
    S2 := '';
    StartState := '';
    Result := '';
    FirstLine := NewParagraph;
    AdjWidth := Width;repeat
    SavePos := FPos; { Save off current position}
    NewWord := GetWord; { Get next word }if StartPos < 0 then
    begin { Initial run through }
    StartPos := NonSpacePos;
    if HasRPTF then 
    begin { Get state of line start }
    FormatState := GetStateAtPos(SavePos);
    StartState := StateToRPTF(FormatState);
    if FirstLine then 
    begin
    LeftIndent := FormatState.Para.FirstIndent + FormatState.Para.LeftIndent;
    end
    else 
    begin
    LeftIndent := FormatState.Para.LeftIndent;
    end; { else }
    RightIndent := FormatState.Para.RightIndent;
    AdjWidth := Width - Round((LeftIndent + RightIndent) * BaseReport.XDPI);
    if AdjWidth < BaseReport.XDPI then
    begin { Don't allow width less than 1" }
    AdjWidth := BaseReport.XDPI;
    end; { if }
    end; { if }
    end; { if }if (NewWord = #13) or (NewWord = '') then
    begin { Finish off line }
    EOL := true;
    if Result = '' then
    begin
    Result := StartState;
    end; { if }
    Break;
    end
    else
    begin { Test width with new word }
    S2 := S2 + NewWord;
    S1 := StartState + FillRPTF(S2,StartPos);if System.Pos(RPTFPrefix,S1) = 0 then
    begin 
    TestWidth := SimpleTextWidth(BaseReport,S1,0);
    end
    else
    begin 
    TestWidth := RPTFTextWidth(BaseReport,S1);
    end; { else }if TestWidth <= AdjWidth then
    begin { Add new word }
    Result := S1;
    end
    else
    begin 
    { Reset position to before this word}
    FPos := SavePos;
    end; { else }if TestWidth >= AdjWidth then
    begin
    if UnformatLen(Result) = 0 then
    begin { First word was too long, cut it down }
    repeat { Add on characters until enough width }
    S1 := Result;
    while FBuffer^[FPos] = RPTFPrefix do 
    begin { Add on RPTF stuff }
    repeat
    S1 := S1 + FBuffer^[FPos];
    Inc(FPos);
    until FBuffer^[FPos] = RPTFSuffix; 
    S1 := S1 + FBuffer^[FPos];
    Inc(FPos);
    end; { while }
    S1 := S1 + FBuffer^[FPos];if System.Pos(RPTFPrefix,S1) = 0 then 
    begin 
    TestWidth := SimpleTextWidth(BaseReport,S1,0);
    end
    else
    begin 
    TestWidth := RPTFTextWidth(BaseReport,S1);
    end; { else }
    if TestWidth <= AdjWidth then
    begin
    if S1 = ' ' then
    begin
    Result := '';
    end
    else
    begin
    Result := S1;
    end; { else }
    Inc(FPos);
    end; { if }
    until (TestWidth >= AdjWidth) or (FPos >= FSize);
    end; { if }
    Break;
    end; { if }
    end; { else }
    until false;//SCYANGYU ************** Start **************
    If CurLineEndHalfCHS(Result) Then
    Begin
    System.Delete(Result,Length(Result),1);
    Dec(FPos);
    End;
    //SCYANGYU ************** End **************end; { GetLine }