Rich no print!

Hello,

1. I make new report.
2. In MasterData put RichObject write long text on 5 lines.
3. Set True to MasterData/AllowSplit and Streched.
4. Set smMaxHeight in RichObject.
5. Preview.

All look normal. Rich show correctly but when print the text show in top-left corner in small margins.
How to fix the problem or this is BUG?

Thank you.

Comments

  • edited 9:59AM
    Hello again,
    I return version 3.03 and this problem fix. Maybe problem is in version 3.04.

    Please check version 3.04.
    Thanks
  • edited 9:59AM
    ????
  • edited 9:59AM
    Please change the frxRich.pas file:
    procedure TfrxRichView.DrawRich;
    var
      Range: TFormatRange;
      LogX, LogY: Integer;
      EMFCanvas: TMetafileCanvas;
      EMF: TMetafile;
    begin
      EMF := nil;
      EMFCanvas := nil;
      FillChar(Range, SizeOf(TFormatRange), 0);
    
      with Range do
      begin
        if IsPrinting then
        begin
          hdc := FCanvas.Handle;
          LogX := GetDeviceCaps(hdc, LOGPIXELSX);
          LogY := GetDeviceCaps(hdc, LOGPIXELSY);
          rc := Rect(FX * 1440 div LogX, FY * 1440 div LogY,
            FX1 * 1440 div LogX, FY1 * 1440 div LogY);
        end
        else
        begin
          LogX := 96;
          LogY := 96;
          EMF := TMetafile.Create;
          EMF.Width := Round(Width);
          EMF.Height := Round(Height);
          EMFCanvas := TMetafileCanvas.Create(EMF, 0);
          if Color = clTransparent then
            FRichEdit.Color := clWhite else
            FRichEdit.Color := Color;
          hdc := EMFCanvas.Handle;
          rc := Rect(Round(GapX * 1440 / LogX), Round(GapY * 1440 / LogY),
            Round((Width - GapX) * 1440 / LogX),
            Round((Height - GapY) * 1440 / LogY));
        end;
    
        rcPage := rc;
        hdcTarget := hdc;
    
        chrg.cpMin := 0;
        chrg.cpMax := -1;
        FRichEdit.Perform(EM_FORMATRANGE, 1, Integer(@Range));
      end;
    
      FRichEdit.Perform(EM_FORMATRANGE, 0, 0);
    
      if not IsPrinting then
      begin
        EMFCanvas.Free;
        FCanvas.StretchDraw(Rect(FX, FY, FX1, FY1), EMF);
        EMF.Free;
      end;
    end;
    
  • edited 9:59AM
    I have same problem, but I have Standard edition of FR 3.04, so I don't have frxRich.pas. Can you please change it in file to be donwloaded in Download area? Or do I have to wait for FR 3.05 ?

    Lubos
  • edited 9:59AM
    Wait for 3.05, it will out soon.
  • edited 9:59AM
    How soon is soon? Is there a date for the new Release?
  • edited 9:59AM
    In the next week.

Leave a Comment