| Author |
Message |
Crystal_forum
Newbie
Joined: 16 Mar 2009
Location: United States
Online Status: Offline
Posts: 16
|

Topic: Question about Sub-reports Posted: 16 Mar 2009 at 8:30am |
Hi All,
Please help me to design a sub-report for the below requirement.
Total number of table to query for is around 50 tables.
Query each table to find if number of records > 0 then print the result in the report. If Records < 0 then skip that table or say 0 records.
Each table output should start in a new page and the complete set to happen in just one report.
Thanks in advance.
|
|
Cheers
Raj
|
IP Logged |
|
|
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|

Posted: 16 Mar 2009 at 12:31pm |
If there are records in a table, do you need to show any data?
-Dell
|
|
|
IP Logged |
|
Crystal_forum
Newbie
Joined: 16 Mar 2009
Location: United States
Online Status: Offline
Posts: 16
|

Posted: 16 Mar 2009 at 12:33pm |
|
Yes I need to if record count > 0
|
|
Cheers
Raj
|
IP Logged |
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|

Posted: 16 Mar 2009 at 1:26pm |
So, you need the record count and if the count > 0 then you need data, correct? Do you also need the record count? What if there's too much data to fit on one page?
Are the tables linked in any way? Do you need the same set of data fields from each table or is the data different?
-Dell
|
|
|
IP Logged |
|
Crystal_forum
Newbie
Joined: 16 Mar 2009
Location: United States
Online Status: Offline
Posts: 16
|

Posted: 16 Mar 2009 at 2:01pm |
Hi,
Here are the details,
1) No need to show the record count. Only data for which I have the sql.
2) All the tables are different. So if I have 10 table then its 10 sub report kind of.
3) If the data from one table exceeds more than 1 page then it runs to multiple pages and the next table will start from new page.
Lets say for example,
My first page will contain heading and all other information about the report. and from next page onwards table data will start. Lets assume if all table have less number of records(less than 10) then first table will complete in 2nd page and 2nd table will start and complete in 3rd page.......it continues like this.
Hope this explains what I am looking at.
Thanks
|
|
Cheers
Raj
|
IP Logged |
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|

Posted: 17 Mar 2009 at 8:15am |
Great explanation. Here's what I recommend:
1. In the main report, make a separate section for each subreport. You don't mention whether the main report will have data or grouping. If it does, the sections will probably be footers of your top level group. If you don't have data in the main report, the sections will all be report footers.
2. In the Section Expert, turn on "New Page After" for each of these sections except the last one. Also turn on "Suppress if Blank" for all sections.
3. For each of your subreports go to the Section Expert and for each section click on the formula button to the right of "Suppress". In the formula put "IsNull({table.key_field})" using some key field from the table for the subreport. This will suppress all of the sections if there is no data. So, you'll have a blank subreport and the section on the main report will also suppress.
-Dell
|
|
|
IP Logged |
|
Crystal_forum
Newbie
Joined: 16 Mar 2009
Location: United States
Online Status: Offline
Posts: 16
|

Posted: 18 Mar 2009 at 12:25pm |
Thx a lot for your information.
Is it adviced to have 60 subreports in one report??
Because I have 60 tables which I have to bring it as sub-reports.
Advice me.
Thanks in advance.
|
|
Cheers
Raj
|
IP Logged |
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|

Posted: 18 Mar 2009 at 1:01pm |
It can be done. Subreports tend to make reports process more slowly so it's good to avoid them when you can. However, for you situation I don't think there's any way to get what you need without using them.
-Dell
|
|
|
IP Logged |
|
Crystal_forum
Newbie
Joined: 16 Mar 2009
Location: United States
Online Status: Offline
Posts: 16
|

Posted: 19 Mar 2009 at 11:51am |
Hi Dell,
I have an another question regarding stored procedure and crystal reports.
I use stored procedures to map my reports for in and out parameters.
In this way I have designed one report to get the desired output.
Now my question is, if I go for subreports then how do I approach the same.
i.e the design I look at is, each subreport will have its own stored procedure to provide the output and the application will always call my main report.
Please advice on this.
thanka...
|
|
Cheers
Raj
|
IP Logged |
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|

Posted: 19 Mar 2009 at 12:31pm |
I haven't used a lot of stored procedures, but that should work. However, if you're only going to be looking at one table per subreport, it might be easier to do it with just the table instead.
-Dell
|
|
|
IP Logged |
|
|
|