on 08-12-2008 9:04 PM
Hi guys, was unable to google this, so Im urning to you guys:
I was wondering whether it was possible to do this:
I have a subreport taking data from a table. In the main report, in the suppres condition of details section containing this subreport, I need to have a variable containing the total count of rows in that table. I know there are shared variables for that, but the problem is, that the variable in the condition is processed sooner than the one in the subreport.
Any ideas on this?
Thanks a lot
Do you want to Suppress the details section if there are no records in subreport by passing the count from subreport to mainreport?
To get the count from subreport to main report try creating formula like this in subreport
shared numbervar i:=count(field);
in the main report create a formula like
shared numbervar i;
this sould be processed only after your subreport to work
Regards,
Raghavendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To Sharma:
Hi, unfortunately I can't. The subreport has its specific position in constallation with previous and following sections and must be right there.
To Raghavendra:
Hi, that was my first idea, but the problem is as I explained in my first message.
To both:
I have a table in subreport. This subreport is in main report positioned in details section "x". and I want to use that shared variable in the suppress condition of section "x". The problem is that the formula in suppress condition is processed sooner than the formula assigning a value to the shared numbervar inside the subreport.
and thats what im looking for - a workaround for that. btw im using CR 8.5
thanks again guys
If there are no links between main report and subreport I would suggest to add new command in main report like
select count(field) from subreport table
and don't link this field with main report tables.
Now you can use this field (count) any where in the report and suppress accordingly.
Regards,
Raghavendra
thats what I did first (using SQL query), but, this thread:
explains, why is it difficult to use SQL queries in CR 8.5 and anyways theres also another problem regarding changing ODBC source servers, which makes it even more complicated and sofar undoable. so sofar Im not able to use SQL queries. thats why i was wondering whether it could be done by shared variables.
If so I think we have to process the subreport once before printing the subreport on main report. Better to create a new subreport that doesn't contain any fields in design and create a formula as I told for shared variable and try to place this in header section (remember we are creating this report just to get the count from sub report to main report) and compress the subreport as small as possible and then use that shared variable in suppress condition.
There may be a better solution but I think this would help you.
Raghavendra
Can you not insert the sub-report in section other than main report details section such as report header, or page header and suppress it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.