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!

Crystal Reports 8.5 - Inserting subreports from file 1

Status
Not open for further replies.

SteveChamberlain

Programmer
Sep 14, 2006
12
NL
Hi,

I am using Crystal Reports 8.5. I am creating a report based on report files that already exist. I am using data from two databases, one Oracle and one Access (through OLEDB). When I insert a subreport from a file, I find that all the fields from Access are missing from the subreport, but not the Oracle fields. What am I doing wrong? I cannot find any documentation on this, I followed the instructions in CR help but it does not mention the removal of fields from the subreport.

I have tried to add both Oracle and Access databases to my main report but this doesn't help. Do I need to setup a connection before doing the insert subreport?

If I open the (subreport) report file directly in Crystal Reports all the fields are there. Just when I insert it into another report are the fields missing.

Any help appreciated!
 
Is the data in the sub report linked or unlinked.

If its unlinked then provided the subreport can follow the same source of data as when you run it as a standalone report then there should not be a problem.

If its a linked report make sure that link is OK, ie data format is the same in both oracle and access field. Also make sure one does not have any spurious spaces or case changes which prevent linking.

Ian
 
It may be that you're trying to insert a subreport in another subreport, which is not supported.

I would sugest that you LINK (not import) the Oracle tables into the Access database and build out a single query in Access to supply the required data to Crystal, it will prove faster and more flexible.

Otherwise you can place numerous subreports into a main report, irrespective of the data source, so I'm not sure why you're having difficulties. Perhaps you need to apply service packs.

Also I would avoid using OLE DB, it's slower and more problematic in CR 8.5.

Use Native connectivity listed as Oracle Server for Oracle, or use the Crystal supplied Oracle ODBC driver, which is slower than native (don't use Oracle's ODBC driver), and ODBC or FILE Type for Access.

-k
 
Hi Ian,

Thanks for your comments. The reports are unlinked, we have about 20 reports for our application. What we want to do is combine them all into one report so that they can be printed as one document/print job. Therefore, each report is unrelated to one another, be want to able to combine them in a "master" report.

Each report works fine as a stand alone report. Only I seem to loose my Access fields when I insert them as a subreport in my master report.

Thanks for your comments.
 
You may be having problems with memory with so many subreports, or the main report has no dtaa, so the subreports aren't executing, otherwise it's possible.

Open the Access report as a main report, then insert it as a subreport into itself, does it show data?

-k
 
Hi synapsevampire,

Just to clarify, I have 20 subreports, each of which use data from two databases (Oracle, Access) so each one has the necessary links to these databases.

I tried what you suggested, insert the main report as a subreport in itself. I observed the same problem.

Can subreports only be a certain number of levels deep? In each report, the link to Oracle is made in the main report and then Acces is linked in subreports. So eventually, the master report will look like this:

Master
|
--- (subreport) Main report (Oracle)
|
--- Subreport (Access)

Is this sort of hierachy not permitted?

 
My first statement covered this "It may be that you're trying to insert a subreport in another subreport, which is not supported."

Even though you prefer to call a Main report being inserted into another report a main report, it no longer is, it's a subreport.

And what a punishingly slow report that would end up being...

Consider my suggestion of building all of his advanced nesting in queries within Access, it's possible, faster and easier to maintain.

-k
 
synapsevampire,

Thanks for your suggestions, I understand what you said before now. I do have a bit of a time problem though, I need to get something produced pretty quickly and I am no expert with DB's or Crystal Reports.

Perhaps a different approach then.

We are also using the CRPE API within our application. What I would really have prefered would be to simply add reports to a print job, but it seems that one report = one print job. Is there anyway to accomplish this?
 
I'm not sure what you mean by that.

Do you mean combine disparate reports into one report?

That's the same as a subreport within crystal.

There are 3rd party tools for combining PDFs and that sort of thing if you just need a one off solution, but building out the queries in Access isn't so bad.

-k
 
Do you mean combine disparate reports into one report?

That's the same as a subreport within crystal."

I do want to combine many reports into one print job. Currently the user can select which reports they want to print through a print dialog and this leads to anywhere between 1 and 18 print jobs. This is not very efficient as the client is using a distributed print system of some kind which means the reports come out on separate printers. This is why we want to combine the reports into one print job (which in turn can be sent to one printer or turned into PDF). I hope this makes the situation a bit clearer. The application is now 5 years old and was developed by previous developers, so I know very little about Crystal Reports and I am looking for the easiest way to accomplish this goal.

Many thanks for your continued suggestions, synapsevampire!
 
You can have multiple subreports within a single master report, just not embed them more than 1 deep.

So right click the report header or report footer section and select insert section below as many times as you have subreports and place each subreport in it's own section (this also applies to grouplevels if you're linking by a group field).

-k
 
That's the way I created my master report and how I got the results mentioned above.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top