Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

TeeChart

edited October 2005 in End User
?The TeeChart on the form work ok if i set the page i want to display
for instance, there are 7 pages in the dbchart1, now i got the same
storeproc and set everything so before it print i am setting to the
ppteechart1.chart.page := 4; that page. But it allways print the first
page.

How can i do this?



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited October 2005
    Hi,

    The TeeChart component in ReportBuilder is simply a wrapper around the
    TCustomChart component developed by Steema. In order to enable specific
    features dealing with these components you will need to include the proper
    TeeChart files in the uses clause. One way to do this is to create the
    chart first in Delphi and copy the uses clause created. In order to
    navigate the pages you will need to add TeePageNumTool to your uses clause.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2005
    I have delphi 2005 and TChart that comes with delphi, I added the units
    like you said to the uses section but I still have the same problem. I
    am using the dbchart, I tried casting, tried other methods but even
    dough i am assigning a new value to the dbchart.page := 2 for examples
    it never changes. dbchart.page = 1 when i debug. so the result of
    printing is the same. I just recently downloaded the trial version of
    the teechart pro and is the same behaviour. Any other Ideas.

    Frank

    specific
    proper
    clause.



    --- posted by geoForum on http://delphi.newswhat.com
  • edited October 2005
    Hi Frank,

    Sorry, I didn't realize you were using Delphi 2005. It seems the
    TeePageNumTool file was left out for that version. Which version of Delphi
    2005/ReportBuilder/TeeChart are you using? In my testing with Delphi 2005
    Update 3, ReportBuilder 9.03, and TeeChart 7.05, the following code worked
    correctly...

    ...
    ppTeeChart1.Chart.Page := 2;

    ppReport1.Print;
    ...

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2005
    Hi

    I am using Delphi 2005 update 3, and the TeeChart 4.04 the one that
    comes with delphi.

    ppTeeChart1.Chart.Page := 2;

    ppReport1.Print;

    This is the code I have but when ever I assigned the 2 in this case in
    the debugger ppTeeChart1.Chart.Page is 1.

    Frank


    Delphi
    2005
    worked
    the
    first



    --- posted by geoForum on http://delphi.newswhat.com
  • edited October 2005
    And I also have report builder 3.

    Frank

    Delphi
    2005
    worked
    the
    first



    --- posted by geoForum on http://delphi.newswhat.com
  • edited October 2005
    Hi Frank,

    For future reference, we prefer you use your real name as your user name in
    these newsgroups.

    I was able to recreate this issue and it seems that it only occurs with
    TeeChart 4.04. I will try to get into contact with the Steema people and
    see if they can shed some light on the problem.

    In the mean time you have two options to get this working the way you need.

    1. Manually draw the TeeChart as a TppImage to the report. This worked
    very well for me (see the example code at the bottom of this post).

    2. Upgrade to TeeChart 7.05. I was also able to get the
    TppChart.Chart.Page property to function correctly with this version of
    TeeChart installed.

    Example code for option 1... (This code assumes you have a DBChart
    somewhere on your form and a TppImage on your report.)

    TForm1.Button1Click(Sender: TObject);
    var
    lBitmap: TBitmap;
    begin

    lBitmap := TBitmap.Create;

    try
    DBChart1.Page := 3;

    lBitmap.Width := DBChart.Width;
    lBitmap.Height := DBChart.Height;

    DBChart1.Draw(lBitmap.Canvas, Rect(0,0,lBitmap.Width, lBitmap.Height));

    ppImage1.Picture.Bitmap.Assign(lBitmap);

    ppReport1.Print;

    finally
    lBitmap.Free;
    end;
    end;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.