Subreports in crystal reports

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm having two tables with no relation and I want to list them both in one
report. How can I do this. I have tried to use sub report, but cant get it to
work? can someone please help me.
If I just create an subreport with one static text object it will not even
then show at runetime.
 
Man oh man, when you have it working, Crystal is great. Geting there
however sometimes feels like a monumental feat.

First I recommend that you draw out on paper what you envision the report to
look like. Plan it all out, because some changes will require you to start
all over, at least it feels like it.

Second, you should have a master report and two sub reports. Each sub
report will contain the data that you are seeking and the master report just
houses the reports.

From memory, I would do this.

1. Create a blank report
2. Define your data connection
3. Right Click on the detail section band, select insert section below
4. In detail 'A' insert an embedded subreport, it should be aware of your
data connection and allow you to make the appropriate selections
5. In detail 'B' repeat

6. Save and incorporate into your application

HTH
 
Thanks for your response, but this is exactly what I have tried to do several
times. And I know I have the data for both tables also. Because if I try to
use a cross-tab, data from both tables are showing. If I just create one
subreport with one text object and write hello World:-) in it. Even this
doesn't show up at runtime. I'm really desperate now.
 
Are you getting any errors or exceptions. How are you attempting to display
the report, winform and report viewer, or via asp.net?

How are you associating the data? Dataset, Connection Properties? Are you
attempting to change the location of the server before opening the report?

Where are you placing this text object? If you are placing it in the detail
section, it should be empty if there is no corresponding data. Place the
text object in the report header or report footer.

Do you have the section that the subreport is in set to suppress? Do you
have the subreport set to suppress.


I realize that most of these are trivial questions, but as I cannot see what
is occurring, I have to start from the beginning.

I you wish, send me screenshots to my email account and I will try to help
you out.
 
Hi,

I have a similar question as I am trying to put 2 subreports together. I
would like to put in a crosstab report, and at the bottom add a few more rows
from another data source.

My question is: How can I set multiple data sources? Below is how I have
set the datasource for my Crystal Report into PDF:

rpt_ActiveCaseLoad.SetDataSource(ReportDataSet.Tables(0))
Report_ExportFile = "BRS_Report.pdf"
Report_DiskFileOptions.DiskFileName = Server.MapPath(".") & "/Reports/" &
Report_ExportFile
Report_ExportOptions = rpt_ActiveCaseLoad.ExportOptions
Report_ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile
Report_ExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat
Report_ExportOptions.DestinationOptions = Report_DiskFileOptions
rpt_ActiveCaseLoad.Export()
rpt_ActiveCaseLoad.Close()

I have set the datasource to be ReportDataSet.Tables(0) from code above.
How can I add another data source into my Crystal Report?

Any help will be appreciated, thank you!
 
Back
Top