ChartPreview

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Gerben
Newbie
Newbie
Posts: 3
Joined: Tue Feb 03, 2004 5:00 am
Location: Nieuwegein HOL

ChartPreview

Post by Gerben » Mon Sep 06, 2004 6:15 pm

Hi,

I upgraded from TeeChartProv5 to v6. The only compile error in my old v5 code so far is with ChartPreview.

I like to run the following code:

uses TeeEdiGene;

With Chart1 do
begin
PrintProportional:=False;
PrintMargins:=Rect(5,5,5,5);
PrintResolution:=-50;
PrintOrientation(poLandscape);
end;
ChartPreview(Main_form,Chart1);

My questions:
1) The uses clause was TeePrevi, and still is according to the tutorial. But then ChartPreview is unknown.
2) PrintOrientation(poLandscape); is also copy/pasted from the tutorial, but poLandscape is unknown. I actually want to use poPortrait. TeeProcs is in my uses list. How to solve this ?

Thanks for your help !

Gerben

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Tue Sep 07, 2004 5:59 am

Hi.
The uses clause was TeePrevi
ChartPreview routine is declared and implemented in TeeEdiGene unit. The following code, tested with Delphi 6 and TeeChart 6.01, works just fine:

Code: Select all

Uses TeeEdiGene, Printers;

procedure TForm1.Button1Click(Sender: TObject);
begin
  With Chart1 do
  begin
    PrintProportional:=False;
    PrintMargins:=Rect(5,5,5,5);
    PrintResolution:=-50;
    PrintOrientation(poLandscape);
  end;
  ChartPreview(self,Chart1);
end;
2) PrintOrientation(poLandscape);
To solve this problem, add the Printers unit to the Uses section.
Marjan Slatinek,
http://www.steema.com

Gerben
Newbie
Newbie
Posts: 3
Joined: Tue Feb 03, 2004 5:00 am
Location: Nieuwegein HOL

Post by Gerben » Tue Sep 07, 2004 2:44 pm

Hi Marjan,

Thanks for the answer, I checked it in Delphi-5 and it worked fine. However it did not completely satisfie my wish.

I have created a chart that definitely has to be printed in portrait mode. Is it possible to bring up ChartPreview with the portrait checkbox checked. Until now landscape is always checked.

I am using Delphi-5 with TeeChart Pro v6.01.

Regards, Gerben

Pep
Site Admin
Site Admin
Posts: 3273
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Sep 07, 2004 10:50 pm

Hi Gerbern,
I have created a chart that definitely has to be printed in portrait mode. Is it possible to bring up ChartPreview with the portrait checkbox checked. Until now landscape is always checked.
yes, you can use :

Printer.Orientation := poPortrait;

Post Reply