add subreport(s) to main report 
Author Message
 add subreport(s) to main report

How can I add subreport(s) to a main report. I have a main report that could
contain a few subreports depending on what the user selects in the VB app. I
have looked at user forum and knowledgebase on Crystal's site, but no
helpful info. Should I add the subreports to the end of the detail section
or create a new section for each subreport? I have a field that links the
reports together so I also need to set the link up in code. Any code
examples or suggestions would be appreciated. I have done this manually, but
do not know how to do it in VB code.

Thanks,
Tom



Mon, 28 Feb 2005 23:14:48 GMT  
 add subreport(s) to main report
You can add subreport at runtime by calling AddSubreportObject method on a
section object. You would need to then add sections and fields within the
subreport, in effect, dynamically design a report. You could then specify
links between main report and subreport by calling Add method on the
SubreportLinks method.

Unless you are fairly familiar with adding/removing sections/fields/objects
on a report at run time, I wouldn't recommend you trying the above method.

Instead if you know the maximum number of places where you could have
subreport, you may wish to design the subreports in advance. Then use VB to
hide/unhide the subreports depending on user input.


Quote:
> How can I add subreport(s) to a main report. I have a main report that
could
> contain a few subreports depending on what the user selects in the VB app.
I
> have looked at user forum and knowledgebase on Crystal's site, but no
> helpful info. Should I add the subreports to the end of the detail section
> or create a new section for each subreport? I have a field that links the
> reports together so I also need to set the link up in code. Any code
> examples or suggestions would be appreciated. I have done this manually,
but
> do not know how to do it in VB code.

> Thanks,
> Tom



Tue, 01 Mar 2005 07:41:22 GMT  
 add subreport(s) to main report
I have done this manually in Crystal Reports where I have one main report
and several subreports that are in report footer sections such as RFa,
RFb,RFc, etc. The problem is that if I hide the subreport, the space
allocated for the subreport leaves a gap in the main report and if I have
adjacent reports then the empty space is larger and the report looks bad.
I was thinking that if I could add report footer sections in my code then I
could add the subreports to the sections. I have tried to to this in the
detail section, but when I add the next subreport it prints over top of the
previous subreport. I have not been able to find code that allows me to add
sections and insert the subreports. Thanks for your reply and let me know if
you hvae any to add to it.

Thanks,
Tom

Quote:
> You can add subreport at runtime by calling AddSubreportObject method on a
> section object. You would need to then add sections and fields within the
> subreport, in effect, dynamically design a report. You could then specify
> links between main report and subreport by calling Add method on the
> SubreportLinks method.

> Unless you are fairly familiar with adding/removing

sections/fields/objects
Quote:
> on a report at run time, I wouldn't recommend you trying the above method.

> Instead if you know the maximum number of places where you could have
> subreport, you may wish to design the subreports in advance. Then use VB
to
> hide/unhide the subreports depending on user input.



> > How can I add subreport(s) to a main report. I have a main report that
> could
> > contain a few subreports depending on what the user selects in the VB
app.
> I
> > have looked at user forum and knowledgebase on Crystal's site, but no
> > helpful info. Should I add the subreports to the end of the detail
section
> > or create a new section for each subreport? I have a field that links
the
> > reports together so I also need to set the link up in code. Any code
> > examples or suggestions would be appreciated. I have done this manually,
> but
> > do not know how to do it in VB code.

> > Thanks,
> > Tom



Tue, 01 Mar 2005 19:17:54 GMT  
 add subreport(s) to main report
Instead of hiding subreport, hide the section. i.e, hide RFa, RFb, etc, not
the subreport. That wouldn't leave any space behind at all.

Quote:
> I have done this manually in Crystal Reports where I have one main report
> and several subreports that are in report footer sections such as RFa,
> RFb,RFc, etc. The problem is that if I hide the subreport, the space
> allocated for the subreport leaves a gap in the main report and if I have
> adjacent reports then the empty space is larger and the report looks bad.
> I was thinking that if I could add report footer sections in my code then
I
> could add the subreports to the sections. I have tried to to this in the
> detail section, but when I add the next subreport it prints over top of
the
> previous subreport. I have not been able to find code that allows me to
add
> sections and insert the subreports. Thanks for your reply and let me know
if
> you hvae any to add to it.

> Thanks,
> Tom


> > You can add subreport at runtime by calling AddSubreportObject method on
a
> > section object. You would need to then add sections and fields within
the
> > subreport, in effect, dynamically design a report. You could then
specify
> > links between main report and subreport by calling Add method on the
> > SubreportLinks method.

> > Unless you are fairly familiar with adding/removing
> sections/fields/objects
> > on a report at run time, I wouldn't recommend you trying the above
method.

> > Instead if you know the maximum number of places where you could have
> > subreport, you may wish to design the subreports in advance. Then use VB
> to
> > hide/unhide the subreports depending on user input.



> > > How can I add subreport(s) to a main report. I have a main report that
> > could
> > > contain a few subreports depending on what the user selects in the VB
> app.
> > I
> > > have looked at user forum and knowledgebase on Crystal's site, but no
> > > helpful info. Should I add the subreports to the end of the detail
> section
> > > or create a new section for each subreport? I have a field that links
> the
> > > reports together so I also need to set the link up in code. Any code
> > > examples or suggestions would be appreciated. I have done this
manually,
> > but
> > > do not know how to do it in VB code.

> > > Thanks,
> > > Tom



Tue, 01 Mar 2005 21:13:46 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. filtering subreports based on main report fields

2. main report with subreport in columns

3. Accessing Subreport field from main report in Crystal

4. Summaries of SubReports in the main report

5. Get subreport's summary from main report

6. Subreport does not show when main report is blank

7. Subreport is not showing when main Report does not have records

8. problem linking a main report to a subreport

9. Displaying Subreport Totals Fields in Main Report

10. Linking subreport to main report using multiple-value or range parameters

11. How to pass value from the subreport to main report

12. How to pass the shared variables from subreport to main report (urgent)

 

 
Powered by phpBB® Forum Software