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

Question about subreport.

Status
Not open for further replies.

zhenyulu

Programmer
Jun 16, 2004
16
0
0
US
Hello, My CR task is like following:

GroupId

table_A (following two line is the content of TableA)
GroupID subgroup1 some attribulte of subgroup1
GroupId subgroup2 some attributes of subgroup2

subgroup1
detail of subgroup1
subgroup2
detail of subgroup2

I'd like to show the whole table_A which contains description for every subgroup, but when I do it in CR, it only shows descriptions for one subgroup. Could you please tell me why? and how to do it?

I have tried to use left, right, outer join to link the tableA and Group. But none works.

Thanks.
 
Hey, I'm kinda new too but maybe I can help. (Don't forget to give your CR version n stuff). Well, actually I'm not really sure what you're talking about. Do you mean that Table_A has 2 child tables in subgroup 1 and 2? If so, you'll need a subreport for at least one of these 2 tables, and though you're title is "question about subreport", I'm not sure if you're using one.

If these are not child Tables but instead just groupings of columns of the Table_A, what are you talking about linking for? Ok , so I guess they are child Tables. You've gotta insert subreports and there should be a linking option depending on your version of CR, mine is for VB.net and it works like this.
I select Insert subreport,
then create a new subreport,
I pick a Name for my subreport,
choose the child Table I need to report on and other stuff in the Report Expert,
click finish for my Report expert,
now I'm still in a window for the subReport and there is a tab called links,
in the first listBox type thing there are the fileds in my main report and from those I choose the key relating the Tables,
and and the bottom of this windows I can select the key form the child Table.


And then its all good! Good Luck
 
Your post doesn't make sense.

Try sharing technical information rather than text descriptions:

Crystal version
Database/connectivity used
Example data (not what's in your report, the actual data)
Expected output (what the report should produce from the data)

You also mention subgroups, which doesn't make sense either, and you mention a subreport, but not where it is in th main report nor how it's linked.

-k
 
Sorry for my confusing description.

I use CR9&Visual Studio c#.net. The database is MSSQL Server 2000. I am using OLEDB.

I have three tables like this:
talbe1:
College department address phone
c1 CS Arizona 11111111
c1 Math Arizona 22222222
c2 CS FL 43333333
c2 Math FL 44444444

table2:
college department employee_number
c1 CS 100
c1 Math 200
c1 Chemical 300
c2 CS 100
c2 Math 200
c2 Chemical 300


table3:
College department emplyee age
c1 CS mike 18
c1 Math tom 19
c2 CS john 20
c2 Math mike 21



The result report should be like this:


(group by college)
College c1
(Following are all records in table2 when college = c1)
[department] [employee_number]
CS 100 (******)
Math 200

(group by department)
department CS detail
[department] [employee] [age]
CS mike 18

department Math detail
[department] [employee] [age]
Math Tom 19


College c2 address phone
[department] [employee_number]
CS 100 (**********)
Math 200


department CS detail
[department] [employee] [age]
CS Jone 20
department math detail
[department] [employee] [age]
Math Mike 21


This is a subreport for a big report. The problem is that it only shows one record in table2 ( I marked using **). How to show all the records? I tried inner-join, left-join, right-join to do it. But it still show one record there.

Any ideas? Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top