Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shared Variables and Subreports again

Status
Not open for further replies.

BizzyLizzy

Technical User
Nov 3, 2003
77
AU
Hi People.

Yet again I am having trouble pulling shared variables from a subreport into a main report.

I am using CR8.5 with an ODBC connection to a SQL2000 database.

The main report has a group h1a {created date}. In GH1b there are various headings, No of calls; No of Abandoned Calls etc etc.

The subreport is also grouped by created date and lists and sums the number of SMS's sent. I have created a shared variable @daily sms sent which contains the following:-

whileprintingrecords;

shared numbervar dailysms:=Sum ({@sms sent}, {CC_OPTUS.CREATED}, "daily")

I have put the subreport in the GH1a and linked it to the main report using a ?start and ?end parameter (to get a set date range) and then tried to put the variable using a new formulae in the main report which contains the following

whileprintingrecords;

shared numbervar dailysms


This is located in the GH1b section of the main report. Unfortunately I am only getting the last figure for the date range that I have entered.

Do I have to do a reset somewhere or is this a linking/grouping issue!

I just cant seem to get my head around this at all.

Here's hoping I have explained everything ok.

Cheers

Liz :)
 
How have you linked the ?Start AND ?End Parameters to the subreport. (Send the select statement from the subreport)
Are there equivalent Parameters in your subreport?
Ideally filter the subreport using parameters with same name and then link these to same parameters in main report.

If subreport is in a group header it should also be linked by the field which is creating your group.

Is the subreport showing the correct data.

Hope this helps

Ian Waterman
UK Crystal Reports Consultant
 
Open the subreport Report->Edit Selection Formula-Record and check what's in there, it probably says something like:

{table.field}= {?pm start}
and
{table.field} = {?pm end}

Change it to:

{table.field}>= {?pm start}
and
{table.field} <= {?pm end}

-k
 
Thanks for the reply guys. Ian linking by the group field did the trick.

Synapsevampire - the selection formula was the first thing I checked as I have been caught out by that one before :)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top