Page 1 of 1

2016.17 and TQRchart

Posted: Wed May 04, 2016 1:39 pm
by 16578207
I just upgraded my license and im trying to get all my compoenents to work Under Delphi 10.1 Berlin.

So now, i have QuickReport 6 and i see there is no TeeQR6 stuff in the source folder. I could still use the QuickReport 5 since i modify it a lot and maybe i wont try to update it but the max Delphi version of the QRChart seems to be 20. im still not sure of what version is the 10.1 ( i guess it is 24)

I Found a link to get the files for D23 on the forum but before i start loosing my mind on it, (Because i always had so much issue installing the QRChart on any of my system) i just want to be sure i have the right files to make it happen.

Thanks.

(Been a long time since i havent post here from version 8 lol)

Re: 2016.17 and TQRchart

Posted: Wed May 04, 2016 2:00 pm
by 16578207
Sorry for double post i havent seen a "Edit post" anywhere.

I Finally manage to make it work with QR6. I used the file from a post in the TeeTree QR5 with Delphi 10.1 (Was a D23 tho)

Now all is working fine.

If you want me to send the files (DclTee9QR6D24.dpk and Tee9QR6D24.dpk) i will.

Btw, is this version of TQRChart able to export itself to PDF ? cuz i do remember that i had to modifed the others to be able to be exported to PDF.

Thanks for the info.

Re: 2016.17 and TQRchart

Posted: Thu May 05, 2016 10:06 am
by yeray
Hello,
GoToXY wrote:Sorry for double post i havent seen a "Edit post" anywhere.
I'll check that.
GoToXY wrote: I Finally manage to make it work with QR6. I used the file from a post in the TeeTree QR5 with Delphi 10.1 (Was a D23 tho)

Now all is working fine.
Good!
GoToXY wrote:If you want me to send the files (DclTee9QR6D24.dpk and Tee9QR6D24.dpk) i will.
Yes, that would be welcome.
GoToXY wrote:Btw, is this version of TQRChart able to export itself to PDF ? cuz i do remember that i had to modifed the others to be able to be exported to PDF.
I don't think we changed anything for TeeQR specifically in this release. If you want to share these changes, we'll study if they can be included in the production version.

Re: 2016.17 and TQRchart

Posted: Thu May 05, 2016 3:46 pm
by 16578207
To make QRChart to export, i made changes to the print procedure.

Note: The Bitmap is used to boost the res and get a better render of the chart in the pdf. the normal metafile isnt high res enought for my taste. If there is better solution feel free to modify it (And let me know :D heheh)

Code: Select all

procedure TQRChart.Print(OfsX, OfsY : Integer);
Var QuickRect : TRect;

  Procedure PrintGraphic(AGraphic:TGraphic);
  begin
    QRPrinter.Canvas.StretchDraw(QuickRect,AGraphic);
    AGraphic.Free;
  end;

Var tmpRect  : TRect;
    tmpChart : TQRDBChart;
    QRImage : TQRImage;
    AGraphic:TGraphic;
    Bmp : TBitmap;

begin
  tmpChart:=Chart;

  if Assigned(tmpChart) then
  begin
    {$IFNDEF NOUSE_BDE}
    tmpChart.RefreshData;
    {$ENDIF}
    If (ParentReport.Exporting)
       Then Begin
            QRImage := TQRImage.Create(Nil);
            QRImage.Top := Top;
            QRImage.Left := Left;
            QRImage.Width := Width;
            QRImage.Height := Height;
            QRImage.Tag := 999;
            tmpRect := tmpChart.GetRectangle;
            AGraphic := tmpChart.TeeCreateMetafile(True,tmpRect);
            Bmp := TBitmap.Create;
            Bmp.SetSize(tmpRect.Width * 4, tmpRect.Height * 4);
            Bmp.Canvas.StretchDraw(Rect(0,0,Bmp.Width,Bmp.Height),AGraphic);
            AGraphic.Free;
            QRImage.Picture.Assign(Bmp);
            Bmp.Free;
            TQRExportFilter(ParentReport.ExportFilter).AcceptGraphic(ParentReport.QRPrinter.Xpos(OfsX+Size.Left), ParentReport.QRPrinter.Ypos(OfsY+Size.Top),QRImage);
            QRImage.Free;
            End
       Else With ParentReport.QRPrinter do
            begin
           QuickRect:=TeeRect( Xpos(OfsX+Size.Left),
                               Ypos(OfsY+Size.Top),
                               Xpos(OfsX+Size.Left+Size.Width),
                               Ypos(OfsY+Size.Top+Size.Height));

           tmpRect:=tmpChart.GetRectangle;

           if Assigned(FOnPrint) then
              FOnPrint(Self,QuickRect,tmpRect);

           Case FTeePrintMethod of
           qtmMetafile: PrintGraphic(tmpChart.TeeCreateMetafile(True,tmpRect));
             qtmBitmap: PrintGraphic(tmpChart.TeeCreateBitmap(clWhite,tmpRect));
           end;
    end;
  end;

  inherited;
end;
For the QR6 and Delphi 10.1
QRChart QR6 D10_1.zip
(1.07 KiB) Downloaded 606 times
Ive changed the output dcu for the qrtee.dcu into the Compiled directory of Teechart so you dont have to copy it every time.
As usual Compile Tee9QR6D24.dpk then Install DclTee9QR6D24.dpk