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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Urgent help with subreport and passing data

Status
Not open for further replies.

MrHelpMe

Technical User
May 1, 2001
203
CA
Hello,

I need help ASAP for accounting report.
Using Crystal 8, I have main report and subreport. Subreport is located in Group Header 1 of main report. Using shared variables I am trying to print out the value of a field when certain conditions are met. Here is my formula. I cannot figure out why it is not working.

whileprintingrecords;
shared stringvar portfolio;
shared numbervar order;
shared numbervar taxgl;
if {SSL.PORTFOLIO}=portfolio and {SSL.ORDER_NO} = order then taxgl

I get the taxgl value only for 1 record. I've noticed that if the group(Security id) has more then 1 record, the value only comes back once and the rest are zeros. However, the groups that only have one value are working perfectly. Not sure what is happening. Your urgent help is appreciated. Thanks.
 
Try placing your subreport in the group footer instead of the group header.
 
Thanks for your reply midearth but when I place my sub in the group footer now all I get are 0(zeros) for the values. Anyother ideas.
 
Hmm. Sounds like this is going to do with either the linking in the subreport or with the placement of the subreport in the main report. Is the subreport necessary? You may be able to accomplish this by using a running total formula within the details section of your report and using the condition as the evaluation for the RT. If that's not an option, you might try inserting another details section in the main report and inserting the subreport in the second details section. This will hinder overall performance, however. This is also slightly outside my limited expertise, so if either of those don't work, I'll bow out of this discussion and leave it up to the others to answer.
 
Hi Midearth,

Thanks again. I have tried what you said but with little success. The positioning of the subreport doesn't make a difference in this report. I am trying to find out whether I can do without a sub but the person who created this is saying we need one. I just want to know for myself what the problem is. I basically have exhausted all options. For those tough situations I usually get sent the report but for some reason cannot figure this one out. Sometimes I need another set of eyes or someone to point me in a direction. Thanks for all your help.
 
How is the subreport linked to the Main report...?

Where is the formula that you show exist relative to the Subreport (Group 1 header)?

Is there any reset of variables happening? if so how and where are the formulas located?

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Thanks for the reply Ngolem and hopefully you can help me. The subreport is linked to the main report by the following:
1)Linked by a parameter called End date to a field in the database called ssl.ent_date
2)By a parameter in the sub called Pm-SSL.SECURITY to a field in the main report(database) called SSL.SECURITY

The formula is on the main report in the details section. That is the forumla(shared variable call formula). It does return one value correctly but zeros for the rest

Actually yes there are resets happening in the group header 1 of the subreport. I actually just tried to remove all resets and same thing. Just to see if any change happened. I have running totals in the details of the sub.

Hope this is enough info an hopefully you can help me out.
 
describe how you are doing the resets...what formulas are used

You should give all these details....they are important.

Sounds to me like the variables are not being updated on the next pass for some reason....the resets are working since you are getting zeros but are they working properly???

My "crystal" ball is weak at this end :)

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top