TeeChart 2011 with D2007 - printing not working?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Jamie
Newbie
Newbie
Posts: 20
Joined: Tue Jun 21, 2011 12:00 am

Re: TeeChart 2011 with D2007 - printing not working?

Post by Jamie » Mon Oct 31, 2011 4:55 pm

Hi Yeray

I see a new release became available today. I looked in all the places you listed, but could not find a complete version history saying what had been fixed in this release. If I am missing something please can you give me a link to where the bug fix list is found?

Please can you tell me if this release fixes the major printing bug I reported 4 months ago?

Best regards,
Jamie

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TeeChart 2011 with D2007 - printing not working?

Post by Yeray » Wed Nov 02, 2011 12:34 pm

Hello Jaimie,

There is a Release.txt file included in all the installations listing the fixes and new features.
There is also a public releases.txt I've just updated here:
http://www.steema.com/versioninfo/vcl

I'm afraid the TV52013347 hasn't been fixed yet.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TeeChart 2011 with D2007 - printing not working?

Post by Yeray » Thu Nov 03, 2011 11:32 am

Hello Jaimie,

Currently there are some incompatibilities between GDIplus and the canvas used to output printpartial metafile (vectorial) output. We have been testing the solution described in this code routine but have yet to decide whether to commit it to the product. The modification does offer a working solution but requires a reference to GDIPlus at the teeprocs level, something that we have yet to agree on.
In TeeProcs.pas:

Code: Select all

implementation

Uses
      TeeGDIPlus,

//.....

Procedure TCustomTeePanel.PrintPartial(Const PrinterRect:TRect);
Var tmpWasGDIPlus : Boolean;
Begin
  tmpWasGDIPlus := False;

  if (Canvas is TGDIPlusCanvas) then
  Begin
    Canvas := TTeeCanvas3D.Create;
    tmpWasGDIPlus := True;
  End;

  PrintPartialCanvas(Printer.Canvas,PrinterRect);

  if (tmpWasGDIPlus) then
    Canvas := TGDIPlusCanvas.Create;
End;
The approach described here could also be used in the client program but we understand that you wish to avoid that.

Code: Select all

procedure TForm3.PrintChart(Sender: TObject);
var tmpWasGDIPlus: Boolean;
begin
 tmpWasGDIPlus:=False;

 With Printer do
 begin
   BeginDoc;
   try

     if (Chart1.Canvas is TGDIPlusCanvas) then
     Begin
      Chart1.Canvas := TTeeCanvas3D.Create;
      tmpWasGDIPlus := True;
     End;

     Chart1.PrintPartial(Chart1.ChartPrintRect);

     if (tmpWasGDIPlus) then
     Chart1.Canvas := TGDIPlusCanvas.Create;

   finally
     EndDoc;
   end;
 end;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Jamie
Newbie
Newbie
Posts: 20
Joined: Tue Jun 21, 2011 12:00 am

Re: TeeChart 2011 with D2007 - printing not working?

Post by Jamie » Thu Nov 03, 2011 5:20 pm

Hi Yeray

Thanks for the reply, the link and the suggested fix. I have tried making the suggested change to TeeProcs.pas, but the ClassName of the canvas being supplied is already "TTeeCanvas3D" so the change has no effect.

I wonder if this relates to my earlier experience with Tee9New? :-
"It does seem to be partially to do with the GDI+, except that turning off GDI+ in Tee9New allows printing of some charts (eg "Rounded Bars" - which won't print when GDI+ is ticked), but the kind of simple bar chart I'm trying to print (eg "Negative Stacked") still won't print, whether GDI+ is ticked or not - I just see the axes ..."

Best regards,
Jamie

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TeeChart 2011 with D2007 - printing not working?

Post by Yeray » Fri Nov 04, 2011 9:54 am

Hello Jamie (I'm not sure why I called you Jaimie in the two last posts, sorry),

We've arrived to another fix for the GDI+ printing, better than the just suggested one. As you are source code customer, we can send you the modified unit.
As you've remarked, this fixes the problem with GDI+ printing, that is slightly different from the problem with GDI printing. However, the problem with GDI printing is already fixed with the v2011.04 PreRelease SourceCode version.
So I'd suggest you to check both problems with the v2011.04 PreRelease SourceCode version and the modified TeeGDIPlus.pas unit I'll send to the mail account you have registered in this forum.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Jamie
Newbie
Newbie
Posts: 20
Joined: Tue Jun 21, 2011 12:00 am

Re: TeeChart 2011 with D2007 - printing not working?

Post by Jamie » Mon Nov 07, 2011 2:23 pm

Hi Yeray

Jamie/Jaime is no problem, I've been called worse names! ;-)

Thanks very much for the file you emailed. I have downloaded the 2011.04 prerelease and can confirm that the GDI charts are now drawn when printing - although with a blue background instead of the previous white one? Is that just a new default?

I have tried replacing the TeeGDIPlus.pas with the new version, but it fails to compile with error "Undeclared identifier: 'FPenFill'" on line 1505. I cannot see a property similar to PenFill/FPenFill or another property of type TChartBrush?

Best regards,
Jamie

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TeeChart 2011 with D2007 - printing not working?

Post by Yeray » Tue Nov 08, 2011 3:55 pm

Hello Jamie,
Jamie wrote:I've been called worse names! ;-)
Yeray isn't a very common name where I live so... :P
Jamie wrote:Thanks very much for the file you emailed. I have downloaded the 2011.04 prerelease and can confirm that the GDI charts are now drawn when printing - although with a blue background instead of the previous white one? Is that just a new default?
Is this happening for you with a new simple example with just some bars in the chart? I can't reproduce this with the following example (neither with GDI nor GDI+):

Code: Select all

uses Series, TeeGDIPlus;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  //Chart1.Canvas:=TGDIPlusCanvas.Create;

  for i:=0 to 2 do
  begin
    with Chart1.AddSeries(TBarSeries) as TBarSeries do
    begin
      FillSampleValues();
      MultiBar:=mbStacked;
      Marks.Visible:=false;
    end;
  end;
end;
Creating the chart the code above (just a chart and a commander placed at designtime) I get this charts printed with PDFCreator:
GDI&GDI+BarsPrinted.zip
(22.15 KiB) Downloaded 474 times
Jamie wrote:I have tried replacing the TeeGDIPlus.pas with the new version, but it fails to compile with error "Undeclared identifier: 'FPenFill'" on line 1505. I cannot see a property similar to PenFill/FPenFill or another property of type TChartBrush?
Sorry, some changes in TeCanvas.pas are also needed. I'll send you this unit too. I've tested it compiles and runs fine with these two new files and the rest of sources from v2011.04 PreRelease.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Jamie
Newbie
Newbie
Posts: 20
Joined: Tue Jun 21, 2011 12:00 am

Re: TeeChart 2011 with D2007 - printing not working?

Post by Jamie » Wed Nov 09, 2011 4:23 pm

Hi Yeray

Thanks again for your help. With the new TeCanvas everything compiles fine.

I must apologise for reporting the colour change as being due to TeeChart - that turns out to be due to a change in my code since I last tested the option to "Print without background". I give users a configuration option to show/hide the graduated chart backgrounds. It seems that the chart was just picking up a change to its parent - ooops!

We are doing some testing on the many different charts and so far things are looking good!

Best regards,
Jamie

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TeeChart 2011 with D2007 - printing not working?

Post by Yeray » Wed Nov 09, 2011 4:32 pm

Hi Jamie,

I'm glad to hear you're satisfied with it!
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply