Home General

Reprint a chart with different data on more pages

edited April 2018 in General
I am working on a report (in an end user reporting application) that dispplays on a TeeChart Gantt Series some data.

There is simply one d ataview (with SQLSQuery on it) and a TppDBchart.

If the query returns not m any records it looks ok:

image

but if the query returns too many records it is not ok:
image

Somehow i would l ike that after a certain number of records "the chart goes to the next page" as it works for a normal report with a detail section.

The workaround i foudn is:
1) agree with customer that 5 pages are enough and N is the max number of items per pagee
2) create 5 dataviews that return records: 0->N, (N+1)->2*N, ..., (4*N+1)-->5*N
3) create 5 subreports, each one containing a chart and displaying it only if "the number of records is enough" (i have also a 6th dataview just for counting the records so that i decide which subreports to show)

This works but it is a limitation, i would like to handle this programmatically, is there a way to achieve this? MAy be a feature i do not know.

I hope i expressed myself.

Thanks

Comments

  • edited April 2018
    Hi Francesco,

    This is a tricky one :smile: . TeeChart does not have any built-in features to limit the number of records it accesses, it will simply access the data it is given.

    One option may be to create a master-detail data relationship with the master containing a record for each chart and the range of rows to be used. This would then be linked to your main dataset with parameterized criteria limiting the number of rows returned. The master would need to be dynamically created by a stored procedure perhaps using the total row count of the detail and the max number of records allowed in a chart.

    For instance for a case where you had 100 records and the max chart size would hold 20 data points, the master table could look like the following:

    ID StartRow EndRow
    0 0 19
    1 20 39
    2 40 59
    3 60 79
    4 80 99
    Then depending on your DB, you would create a row range in the detail based on linked parameters of the master.

    SELECT * FROM table limit :StartRow, :EndRow

    Note that this has not been tested including the above SQL.


    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • Thanks Nico. i do not get how I can use your solution in an end user reporting application where my tools are limited to DADE + RAP. Thanks.
  • Hello francecsof,

    Did you ever find a solution to this in DADE + RAP? I am facing a similar problem where I want to limit the rows from a dataset used in a graph?

    J
  • Hello Joe_A.

    I did not find any solution in DAD + RAP so i made it by creating a report with 5 pages with a chart on each page, 5 dataviews: one per page and by showing only the pages that makes sense (i.e.: if there are only 25 records and i show 20 records per page i make visible only pages 1 and 2.
  • Thank you for your quick reply
Sign In or Register to comment.