Count datarows in subreport
-
- Posts: 43
- Joined: Fri May 25, 2007 2:54 am
- Location: Austria
Count datarows in subreport
I have a report with two subreports included.
Top position of the lower subreport2 should depend on the heigt of the upper subreport 1.
I can´t achive this by using dock property because there are texts between the subreports and this results in wrong dock order.
Counting the datarows of subreport1 (with count()) would also be a solution but how can I get datarows of subreport2 from mainreport ?
Top position of the lower subreport2 should depend on the heigt of the upper subreport 1.
I can´t achive this by using dock property because there are texts between the subreports and this results in wrong dock order.
Counting the datarows of subreport1 (with count()) would also be a solution but how can I get datarows of subreport2 from mainreport ?
Count datarows in subreport
For getting amount datarows of second subreport you can use a variable. Create a new variable: CountRows(type: int, default value: 0), write in the RenderingEvent of data band in the second subreport: and set property "Number of Pass" of the report to "Double Pass", then you will get the number of datarows in the second subreport.
Thank you.
Code: Select all
CountRows++
Thank you.
-
- Posts: 43
- Joined: Fri May 25, 2007 2:54 am
- Location: Austria
Count datarows in subreport
Thanks for the hint.
I´ve tried your solution but now there occurs another problem:
My subreport works with a hierachical band and the output now looks like this:
. parent
. parent
. parent
instead of
. parent
. child
. child
Maybe this is a result of the double pass ?
I´ve tried your solution but now there occurs another problem:
My subreport works with a hierachical band and the output now looks like this:
. parent
. parent
. parent
instead of
. parent
. child
. child
Maybe this is a result of the double pass ?
Count datarows in subreport
We have tested some reports with hierachical bands concerning your problem, and couldn't reproduce behaviour:
.parent
.parent
.parent
instead of
.parent
.child
.child
Send to support@stimulsoft.com your report with few sample data. We will checkup it.
Thank you.
.parent
.parent
.parent
instead of
.parent
.child
.child
Send to support@stimulsoft.com your report with few sample data. We will checkup it.
Thank you.
-
- Posts: 43
- Joined: Fri May 25, 2007 2:54 am
- Location: Austria
Count datarows in subreport
Your right, your solution is working. I ´ve made some mistakes... :brick:
Thanks.
Thanks.
-
- Posts: 43
- Joined: Fri May 25, 2007 2:54 am
- Location: Austria
Count datarows in subreport
Unfortunately there is another problem with this solution:
When I start the report the first time the rows count in subreports returns 0.
After a refresh or showing second time the result is ok.
When I start the report the first time the rows count in subreports returns 0.
After a refresh or showing second time the result is ok.
Count datarows in subreport
We have tested this issue and we have always a nice result. May be, you use a report with some specific conditions?
Thank you.
Thank you.
-
- Posts: 43
- Joined: Fri May 25, 2007 2:54 am
- Location: Austria
Count datarows in subreport
You are right !
It was again a data failure from my side as I ran the report first time with missing data..
Can you please give me an overview of the correct order of steps when processing a report ?
(1. report.load, 2. regdata, 3. synchronize ...)
It was again a data failure from my side as I ran the report first time with missing data..
Can you please give me an overview of the correct order of steps when processing a report ?
(1. report.load, 2. regdata, 3. synchronize ...)
Count datarows in subreport
You must use first then or use this methods in reverse order, but then you must use after first two methods.
Thank you.
Code: Select all
report.Load()
Code: Select all
report.RegData()
Code: Select all
report.Dictionary.Synhronize()
Thank you.
-
- Posts: 43
- Joined: Fri May 25, 2007 2:54 am
- Location: Austria
Count datarows in subreport
Regarding my original problem with counting datarows: I now have a new report structure:
I´ve got a mainpage where I a place a subreport (subreport1) ten times on one page (two columns, five rows)
Into subreport1 I´d like to place another subreport (subreport2) with the hierarchical band where I have to count datarows.
The number of datarows in subreport2 again determines the height of subreport2 in subreport1.
The problem now is, that subreport2 is called ten times (plus some more counts !?) and so the number of rows is counting up wrong.
Isn´t there an easier way to get the number of rows of the hierarchical band?
I would be happy if I just could get the number of datarows in one of my datatables.
I´ve got a mainpage where I a place a subreport (subreport1) ten times on one page (two columns, five rows)
Into subreport1 I´d like to place another subreport (subreport2) with the hierarchical band where I have to count datarows.
The number of datarows in subreport2 again determines the height of subreport2 in subreport1.
The problem now is, that subreport2 is called ten times (plus some more counts !?) and so the number of rows is counting up wrong.
Isn´t there an easier way to get the number of rows of the hierarchical band?
I would be happy if I just could get the number of datarows in one of my datatables.