Page 1 of 1

Problem with Printout (Fastreport) and Method TeeCreateMetaf

Posted: Mon Mar 17, 2014 9:57 am
by 16555944
Hello

Since i have updated to the Version 2014 last week, i have the problem with my printouts of my Charts.

I useing Fastreport for my Reportgenerator:

Follow is the line where i print it out:

Code: Select all

  PROCEDURE TfrmVis_Grafik.frxReportChartBeforePrint(Sender: TfrxReportComponent);
  BEGIN
    IF Sender.Name = 'Picture1' THEN BEGIN
      TfrxPictureView(Sender).Picture.Assign(Chart.TeeCreateMetafile(False, Rect(0, 0, Round(Sender.Width), Round(Sender.Height))));
    END;
  END;
See attached Files what is printed:
"Aufnahme6.jpg" ist the Preview of the Chart in my Form
"Aufnahme7.jpg" is the Preview in Fastreport (Take a look to the legend)
"gktext.wmf" is the filesave of the Method TeeCreateMetafile, is also wrong!!

I think, there is a bug in the Method TeeCreateMetafile!!

Kind Regards
Gregor

Re: Problem with Printout (Fastreport) and Method TeeCreateMetaf

Posted: Tue Mar 18, 2014 11:17 am
by yeray
Hi Gregor,

I could reproduce it so I've added a new ticket to the bug tracker:
http://bugs.teechart.net/show_bug.cgi?id=643
Feel free to add your mail account to the CC list so you can be automatically notified when an update arrives.

Thanks for reporting it.

Re: Problem with Printout (Fastreport) and Method TeeCreateMetaf

Posted: Tue Mar 18, 2014 12:44 pm
by 16555944
Hello Yeray

Thanks for the answer, but i found an other issue!

It's not only the checkboxes, it's also the legend itself, because it's overlaped at the left and right border see attachmend.

Kind Regards
Gregor

Re: Problem with Printout (Fastreport) and Method TeeCreateMetaf

Posted: Tue Mar 18, 2014 1:09 pm
by 16555944
Hello Yeray

I found some funny things. When i restore the form where are the TChart are, to a smaller size, and the i print it out. The Legend are draw correct. When i maximize my form, an the print it out, the legend overlaped left and right!

See the differences at the attached files.

Kind Regards
Gregor

Re: Problem with Printout (Fastreport) and Method TeeCreateMetaf

Posted: Tue Mar 18, 2014 1:10 pm
by 16555944
follow the last attachmend

Re: Problem with Printout (Fastreport) and Method TeeCreateMetaf

Posted: Wed Mar 19, 2014 12:54 pm
by yeray
Hi Gregor,
viper wrote:It's not only the checkboxes, it's also the legend itself, because it's overlaped at the left and right border see attachmend.
Do you agree it sounds similar to this?
http://bugs.teechart.net/show_bug.cgi?id=634
Since you are a source code customer, I'll send you a beta version to check if it works as you expected.

Please, tell us if any issue mentioned above are still reproducible for you with that beta.
If so, please try to arrange a simple example project we can run as-is to reproduce the problem here.

Re: Problem with Printout (Fastreport) and Method TeeCreateMetaf

Posted: Wed Mar 19, 2014 2:10 pm
by 16555944
Hello Yeray

The Problem that i described, are exacly that what is described at the forum ID=634

I have now installed the betaversion Build 140319.

And i have also to add the follow line to my project (because of the checkboxes)

Code: Select all

USES
  VclTee.TeCanvas,
....

PROCEDURE TfrmVis_Grafik.FormCreate(Sender : TObject);
  BEGIN
    Chart.Canvas:=TTeeCanvas3D.Create;
    Chart.View3D:=false;
Whith this new version, and the additional lines, my problem are solved. Thanks.

Kind Regards
Gregor

Re: Problem with Printout (Fastreport) and Method TeeCreateMetaf

Posted: Wed Mar 19, 2014 4:54 pm
by yeray
Hi Gregor,

Thanks for the feedback. I'm glad to hear it works now as you wish.

Re: Problem with Printout (Fastreport) and Method TeeCreateMetaf

Posted: Wed Jun 14, 2017 2:06 pm
by 16580677
Hello

I just have excactly the same problem now with the newest verison TeeChartVCLFMX-2017.21 on 10.2 Tokyo!

Best Regards
Gregor

Re: Problem with Printout (Fastreport) and Method TeeCreateMetaf

Posted: Thu Jun 15, 2017 7:14 am
by yeray
Hello Gregor,
viper wrote:I just have excactly the same problem now with the newest verison TeeChartVCLFMX-2017.21 on 10.2 Tokyo!
Do you mean #643 or #634?

Re: Problem with Printout (Fastreport) and Method TeeCreateMetaf

Posted: Thu Jun 15, 2017 8:33 am
by 16580677
I mean #643
see attached Printout

Best Regards
Gregor

Re: Problem with Printout (Fastreport) and Method TeeCreateMetaf

Posted: Fri Jun 16, 2017 2:39 pm
by yeray
Hello,

I've just revised it for the next maintenance release.
Since you have the sources, you can remove these lines in DrawBox method in Chart.pas:

Code: Select all

      {$IFNDEF FMX}
      {$IFNDEF LCL}
      // Fix for a strange problem that worked fine in previous versions.
      // GDI+ canvas displaces the checkbox vertically up, when drawing onto a Metafile canvas.

      if (ParentChart.Canvas.ReferenceCanvas is TMetafileCanvas) and ParentChart.Canvas.SupportsAlpha then
         Inc(tmpY,13);
      {$ENDIF}
      {$ENDIF}
Don't forget to run TeeRecompile after modifying the sources to compile and install the packages in your IDE.