DBTeeChart components vs. Grouping report data
Hi,
I have a weird issue when using DBTeeChart components in my reports while
the report contains a group, and I place the TeeChart into the detailband.
I need to display all the invoice amounts that belong to each of the
accountants in a company, so the grouping is on accountant ID.
In the detailband I placed a DBTeeChart comp. that has MaxPointPerPage := 5.
Say we have accountant A with 9 records and accountant B with 16 records.
1) ReportBuilder will generate 25 pages because it's not linked to the
DBTeeChart's MaxPointsPerPage property so it only sees that there's 1 comp.
in detailband linked to the DBPipeLine. In my case it should only display 2
pages for accountant A and 4 pages for accountant B.Say I limit the
pagenumbers that RB is displaying. Then it pops up another data display
missmatch.
Now the report will show in the group header of the first 9 pages the name
of accountant A, and since I limited the page number to only 6..this will be
the only accountant I can print on the report, thought it travels through
all the records, including those belonging to accountant B.
2) This issue will be more "delicated" when I have the same total of 25
records but the first 13 for acc. A and the remaining 12 to acc.B. In this
case in the groupheader of the first 3 pages it should show acc.A
I'm using ReportBuilder ver. 10.06 with TeeChart 7.09 standard, under
CodeGear BDS 2007
Note that I had to do a work-around when using DBTeeChart in RB (not
including groupped data) on the DBPipeLine.OnNext, OnPrior, OnFirst, OnLast
events to synchronize the data travel within the DBTeeChart with the
Next,Prior,First,Last button pressed in RB.
This logic will not work on reports displaying groupped data.
If anybody has any idea I would appreciate it.
Thanks,
Sandor
I have a weird issue when using DBTeeChart components in my reports while
the report contains a group, and I place the TeeChart into the detailband.
I need to display all the invoice amounts that belong to each of the
accountants in a company, so the grouping is on accountant ID.
In the detailband I placed a DBTeeChart comp. that has MaxPointPerPage := 5.
Say we have accountant A with 9 records and accountant B with 16 records.
1) ReportBuilder will generate 25 pages because it's not linked to the
DBTeeChart's MaxPointsPerPage property so it only sees that there's 1 comp.
in detailband linked to the DBPipeLine. In my case it should only display 2
pages for accountant A and 4 pages for accountant B.Say I limit the
pagenumbers that RB is displaying. Then it pops up another data display
missmatch.
Now the report will show in the group header of the first 9 pages the name
of accountant A, and since I limited the page number to only 6..this will be
the only accountant I can print on the report, thought it travels through
all the records, including those belonging to accountant B.
2) This issue will be more "delicated" when I have the same total of 25
records but the first 13 for acc. A and the remaining 12 to acc.B. In this
case in the groupheader of the first 3 pages it should show acc.A
I'm using ReportBuilder ver. 10.06 with TeeChart 7.09 standard, under
CodeGear BDS 2007
Note that I had to do a work-around when using DBTeeChart in RB (not
including groupped data) on the DBPipeLine.OnNext, OnPrior, OnFirst, OnLast
events to synchronize the data travel within the DBTeeChart with the
Next,Prior,First,Last button pressed in RB.
This logic will not work on reports displaying groupped data.
If anybody has any idea I would appreciate it.
Thanks,
Sandor
This discussion has been closed.
Comments
Please forgive me, I'm a bit confused about what exactly you would like your
report to look like.
Note that if you place a DBChart inside the detail band, it will print for
each record in your dataset. Also a DBChart will traverse the entire
dataset given to it when it is generated. This means that if you would like
to print a separate chart for each accountant, you will need to separate
your data into a master-detail relationship and place the chart inside a
subreport connected to the chart data.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thank you for the reply, and I'm sorry I wasn't able to make myself clear.
Here is the data that I want to display (hopefully this will explain in more
detail what I'd like to have in the report):
Record structure(fields) : amount($),
nr.of pieces(int),
net income(% of the invoice value)
Accountant A: 4 records
Accountant B: 11 records.
Accountant C: 23 records.
Report has to have the following structure:
Header : Accountant Name
DetailBand:
Chart1 - amount (3 points per page)
Chart2 - nr. of pieces (3 points per page)
Chart3 - net income (3 points per page) (MaxPointsPerPage =3)
Footer: Page No
What I need the data on my pages to look like :
Page1:
Header: Accountant A
DetailBand:
Chart1 - first 3 records
Chart2 - first 3 records
Chart3 - first 3 records
Footer: Page 1
Page2:
Header: Accountant A
DetailBand:
Chart1 - last 1 record
Chart2 - last 1 record
Chart3 - last 1 record
Footer: Page 2
Page3:
Header: Accountant B
DetailBand:
Chart1 - first 3 records
Chart2 - first 3 records
Chart3 - first 3 records
Footer: Page 3
Page4:
Header: Accountant B
DetailBand:
Chart1 - next 3 records
Chart2 - next 3 records
Chart3 - next 3 records
Footer: Page 4
... (3 pages with 3 points per chart plus 1 page with 2 points per chart)
Page7:
Header: Accountant B
DetailBand:
Chart1 - last 2 records
Chart2 - last 2 records
Chart3 - last 2 records
Footer: Page 7
As you can see from this example, the issue is with grouping the data while
keeping the chart displaying the correct number of points per page aswell as
the data belonging to the same accountant.
If I'd use a master-detail database structure, even with subreports, and I
assign the master dataset to the report, then the report will not know
howmany pages containing detail data will belong to each master record(of
course with the correct no. of points per chart) . If I assign the detail
dataset to the report...then I get back to my case...won't work correctly.
I'd appreciate any suggestion or a different approach of this problem I
have.
Best,
Sandor
The DBChart will simply traverse the data it is connected to and generate a
chart based on that data. It is up to you to filter or provide a search
condition to the data in order to only show the points on the chart that you
are interested. Note that this is completely separate from how groups work
in ReportBuilder. The DBChart has no concept of Report groups.
One option may be to create these charts outside ReportBuilder using the
TDBChart on a form, then displaying them as a TppImage component in your
report(s).
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com