Calculate number of rows in report (1 Viewer)

theDBguy

I’m here to help
Joined
Oct 29, 2018
Messages
7,619
theDBguy and isladogs,
Thank you very much,

It works and I can use this field for further calculations of Ratio what I wanted.

But, culd you explain it to me where =[number_rows] came from?
Hi. Glad we could assist. As I hinted earlier, you sometimes have to add "hidden" controls to do intermediate calculations for used in your final calculations. The reason why my first image didn't work was because when the report is rendered, the group header control can only grab the first row of the detail section. If you'll notice in my second image, when I placed that control in the group footer section, it was able to wait until all the rows in the detail section were processed before it displays the last value. Since you wanted to display this information in the group header, though, I had to hide the one in the footer and add a new one in the group header pointing to the one in the group footer. This is what you have to do sometimes with reports. Hope that makes sense...
 

lbs

Registered User
Joined
Dec 22, 2019
Messages
67
theDBguy,
I can't find it in the group footer. How did you hide it? I just wanted to remember how it looks like for use in the future.
 

lbs

Registered User
Joined
Dec 22, 2019
Messages
67
Sorry theDBguy I found it, You've just collapsed it completely

Now I see what is the trick

Many thanks for your help

lbs
 

theDBguy

I’m here to help
Joined
Oct 29, 2018
Messages
7,619
Sorry theDBguy I found it, You've just collapsed it completely

Now I see what is the trick

Many thanks for your help

lbs
Oh yeah, sorry about that. I did forget to mention how to find it. Glad to hear you managed though. Cheers!
 

lbs

Registered User
Joined
Dec 22, 2019
Messages
67
Hope that makes sense...
I am very sorry to be such a pain tonight. But there is another problem.
When I open report, my calculated field Ratio displays correctly. But when I open Report Preview, the calculations go wrong and the field is showing incorrect values. What's going on?
I attached db . r_10_mdt_cons_01
 

Attachments

theDBguy

I’m here to help
Joined
Oct 29, 2018
Messages
7,619
I am very sorry to be such a pain tonight. But there is another problem.
When I open report, my calculated field Ratio displays correctly. But when I open Report Preview, the calculations go wrong and the field is showing incorrect values. What's going on?
I attached db . r_10_mdt_cons_01
Hi. I just left my computer, so I'll take a look later, okay?

Sent from phone...
 
Last edited:

Gasman

Enthusiastic Amateur
Joined
Sep 21, 2011
Messages
5,015
I am very sorry to be such a pain tonight. But there is another problem.
When I open report, my calculated field Ratio displays correctly. But when I open Report Preview, the calculations go wrong and the field is showing incorrect values. What's going on?
I attached db . r_10_mdt_cons_01
PMJI, and I might have got the wrong end of the stick, but the preview looks correct to me (*as I understood) it and the report view which is awry.?

View


Preview
 

Attachments

lbs

Registered User
Joined
Dec 22, 2019
Messages
67
PMJI, and I might have got the wrong end of the stick, but the preview looks correct to me (*as I understood) it and the report view which is awry.?

No Gasman, the report view is correct and print preview is incorrect. I want to calculate a so called ratio. That is when all consultants do equal number of MDTs then their ratio is 1. If someone does more then the ratio is up. But it is not the proportion of MDTs. Some of our consultants work part time and I need to monitor that their ratio should be for example 0.7.
 

Gasman

Enthusiastic Amateur
Joined
Sep 21, 2011
Messages
5,015
Ok,
I've discovered that in print preview mode the num_rows is always 1 ?
You can see that as the report appears immediately, no delay with a calculation.
If you use layout view that does give you the same as Report view.

I have no idea as to why this happens in print preview, but I need to remember this in case I need to do likelwise calcs.

Reveal the group footer and the num_rows control and you will see what I mean.

HTH
 

lbs

Registered User
Joined
Dec 22, 2019
Messages
67
Ok,
I've discovered that in print preview mode the num_rows is always 1 ?
You can see that as the report appears immediately, no delay with a calculation.
If you use layout view that does give you the same as Report view.

I have no idea as to why this happens in print preview, but I need to remember this in case I need to do likelwise calcs.

Reveal the group footer and the num_rows control and you will see what I mean.

HTH
I've done something now. I created another query as a data source of report where some calculations are already done. Now the new report looks fin in both modes.

Thanks for looking into it
 

theDBguy

I’m here to help
Joined
Oct 29, 2018
Messages
7,619
I've done something now. I created another query as a data source of report where some calculations are already done. Now the new report looks fin in both modes.

Thanks for looking into it
Hi. Congratulations! Glad to hear you got it sorted out. Good luck with your project.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom