Page 1 of 1

ChartPreview

Posted: Mon Sep 06, 2004 6:15 pm
by 8442744
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

Posted: Tue Sep 07, 2004 5:59 am
by Marjan
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.

Posted: Tue Sep 07, 2004 2:44 pm
by 8442744
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

Posted: Tue Sep 07, 2004 10:50 pm
by Pep
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;