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

ppDBChart and Crosstab datasource?

edited January 2008 in General
Hi saw that one of the supported data sources for the ppDBChart (in the
dropdown list) is a Crosstab, but I found no way to use it.

Can someone explain me how does it works?

Carlos

Comments

  • edited January 2008
    Hi Carlos,

    This does not refer to a ReportBuilder CrossTab component. I believe when a
    DBTChart (in Delphi) has its datasource set to CrossTab, it is meant to be
    connected to the TDBCrossTabSource component available in the TeeChart
    section of the component palette.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2008
    Carlos,

    The TppDBTeeChart is only designed to use the DataPipeline datasource to
    retrieve data. If you would like to use TeeChart with other external
    datasources, you will need to create the TeeChart outside ReportBuilder on a
    form, then transfer the image of that chart to the report via a TppImage
    component.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2008
    I did some tests with TDBChart and when I choose the Crosstab as datasource,
    I'm able to select any TDataset descendent and create great "crosstab"
    charts.

    With TppDBTeeChart, when I choose the Crosstab type as datasource, it
    doesn't allow me to select anything, nor a TppDBPipeline, nor anything else.
    It seems that the TppDBTeeChart has some failure in its implementation that
    avoids the selection of a datasource for the serie when it is select as a
    "crosstab".

    Can some of the Digital Metaphors guys take a look on this and report if it
    would be possible to have this nice feature working in the TppDBTeeChart
    component?

    Carlos


  • edited January 2008
    Thanks for the feedback. We will consider this for a later release of
    ReportBuilder.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2008
    Thanks Nico, but what I was requesting is to DM adapt the TppDBTeeChart
    component in a way that it accepts a TppPipeline as the datasource for a
    Crosstab chart type.

    Do you think this can be done?

    Carlos

  • edited January 2008
    Try something like the following instead...

    var
    lMetaFile: TMetaFile;
    lRect: TRect;
    begin

    lRect.Left := 0;
    lRect.Top := 0;
    lRect.Right := ppImage1.spWidth;
    lRect.Bottom := ppImage1.spHeight;

    lMetaFile := Chart1.TeeCreateMetafile(True, lRect);
    ppImage1.Picture.Metafile.Assign(lMetaFile);

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2008
    Ok, so it seems that I will need to use the alternative way (canvas copying)
    at last for now.

    I tried it, and it worked, but the image in the report gets "blured". The
    code I used is:

    ppImage1.Picture.bitmap.Width:=DBChart1.Width;
    ppImage1.Picture.bitmap.Height:=DBChart1.Height;
    DBChart1.Draw (ppImage1.picture.Bitmap.Canvas,
    Rect(0,0,ppImage1.Picture.Width-1, ppImage1.Picture.Height- 1));

    Is there anything that can be done to get a better image in the report? The
    chart image on the form is very clear and sharp, but in the report, it
    appears blured.

    Carlos

  • edited January 2008
    Thanks, much better now!

    Carlos

This discussion has been closed.