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

Need Help with the Sub report

Status
Not open for further replies.

Hm786

Programmer
Apr 5, 2001
88
US
Hi All,

I have a report with a main report and two sub reports. I have a field name called revenue on the main report and want that field shown on one of my sub reports. I used shared variables for this, but I am having problem in getting all the revenue fields on my sub report. It shows only the last field on the entire sub report. I am able to get the sub total for the revenue field printed correctly in my sub report by using the shared variables but getting all the field values is not possible for me. I created a reset field and inserted in all possible areas of my main report to see whether the values are printing properly but I couldn’t get the result. This sub report is the second sub report, above that there is another sub report. Both the sub reports are in the group footer of my main report. Please help me if anybody has any solution for my above problem. If the revenue fields have values like ‘a, b ,c, d’ the value on my sub report is only ‘d’ not the other values.


Thanks in advance,
Hamida
 
What version of CR are you using?
Can you describe this in more detail.

Where do you want the A, B, C, D to print on the subreport. All in one spot? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Hi Kenhamandy,

I am using crystal 8.0. In my sub report I need the values print one below the other. Like a
b
c. in a row
But I always get the last value of the field that is c. I will email the print out of the report so that you can have better look.

Thanks,
Hamdia
 
In what section of the subreport do you want these values to print. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Ken,

I want to print the values in the detail section of my sub report. I am able to print the totals correctly for that field.



Thanks,
Hamida
 
It sounds like you are trying to pass a column to your subreport, so that it prints the appropriate value on each detail section.

This can't be done easily if at all with subreports. A variable can only pass a single value to the subreport, not a column. You would have to pass one variable for each value, and then try to get them to print on the appropriate details section.

Describe what you want to accomplish because there may be a better approach. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Ken,

You are right I am trying to pass a column to my subreport so that I can see all my field values on my detail section of the subreport. Is there a way to do this.

Thanks,
Hamida
 
No easy way.
Describe the type of info your report is working with. Also, how would the detail in the main report, know which record to match up with in the subreport? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Ken,

It is a monthly billing report for different credit unions. The main report is grouped on the credit union level and I suppress the detail band and all my info is on the group footer. Both the sub reports are on the group footer of my main report. The subreports has detail bands.


Thanks,
Hamida
 
Is there a relationship between the details of the main and sub? Is there a reason why you are using subreports instead of linking tables in the main report? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Ken,

Actually I am rewriting all the Delphi quick reports to Crystal. This is the only report I have problem. The reason is, this report is developed programmatically by writing lot of Delphi code. In Delphi they are able to get the Revenue field which comes from a different table. If I make a join to that table in order to get this field all my values will be different, that's why I can't join to that table. So if there is no other way to get that field I will leave this report like this, until we get any new solution.
Thanks for your help.

Thanks,
Hamida
 
There may be another way. I don't have enough info to determine, yet.
What is the relationship between main details and sub details?
What do you mean by "all of your values will be different"? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Ken,

The relationship between the main report and sub report is master detail relationship(one to many).If I connect another table I am not able to get the exact match of rows as the original report gives. If I am not using the new table I am able to get correct records returned. The subreprot is created by joing 3 tables and linked to the main report by a common field.

Thanks,
Hamida
 
Let me clarify my question.
You will have to store each subtotal as a separate shared variable.
How will the subreport know which subtotal goes wtih which detail? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Ken,

Sorry I miss understood your previous question. In the detail band there is one field called sys/prin and the revenue field is associated to it. On each detail band I have sys/prin,amount, revenue fields. Is there a way to create varibles based on the the sys/prin numbers to store the revenue field values.


Thanks,
Hamida
 
You would have to create one variable for every potential Sys/Prin value, and then you could print the appropriate value on the appropriate detail.

Can you make the Subreport into the container? That way you could launch a linked subreport for each detail that calculated the revenue for just that Sys/Prin. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Ken,

I have no idea about the subreport making a container report. Also there are so many different sys/prin numbers for this report and I think it will be very difficult to create that many variables.


Thanks,
Hamida
 
I agree. I think you are going to have to reverse the structure and make the subreport into the main report.

This may require more assistance than we can do for you here in TT. You may need to hire an expert to help you. While many of use here in TT are also available as hired guns, we avoid discussing it here and try to take those discussions off-line. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top