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

Crystal Reports - adding Excel spreadsheet as second database

Status
Not open for further replies.

JanTokar

Technical User
Jun 13, 2017
3
0
0
SK
Hello guys.

I'm new here.

I was searching for solution online how to make copies directly inside Crystal Reports, and I've found the referenced thread (thread767-1734555) to be what I exactly need. So many thanks pmax9999.

But it works only inside Crystal Reports. When I set this report live for our users inside the software we use, I get the following error:
Logon Failed. Error number - 2147189176

Now I know there is also a thread on these forums regarding this same issue (thread767-1694752) but I have the template field blank.

So my question is, how do I need to add the Excel spreadsheet properly inside my report? The report already uses data from Oracle DB.
Do I have to use some form of logon credentials even for this single spreadsheet? It's not protected and everyone on domain has access to it, so the problem should not be there.

Thanks in advance
Jan
 
You could eliminate the Excel spreadsheet by creating a new report with a table that contains at least as many records as the maximum number of copies that you might want. Add a field to the report header and suppress the field. Then creat a formula {@cnt}:

Whilereadingrecords;
Numbervar cnt := cnt + 1;

Insert a group on this formula.

Create a number parameter called {?No of Copies} and then go to report->selection formula->record and enter:

{@cnt}<={?No of Copies}

Next insert your current report as an unlinked subreport in the group header or footer of the main report. Suppress unwanted sections in the main report and remove the group name {@cnt}.

-LB
 
Hi LB.

Thanks for quick response. However I'm really new to Crystal Reports itself and till now, for about half a year, was working on already created reports, making only small changes and adjustments.

So if you won't mind: by creating new report, you mean totally new and clean report? And after all is set, add my current report as subreport?
If yes then I think that will not be possible in my case, I should have probably mentioned this, but my report already uses quite a few subreports, too.

Is there any other way I could get this to work?

Thanks
Jan
 
Yes, you can't use a subreport if there are subs already your report.

I don't know if I can help with the issue with the Excel spreadsheet. When you make the report available for your users, you also need to do the same with the Excel spreadsheet, so you might want to check Database->"Set Location" and see where the Excel spreadsheet is being referenced and reset if necessary. In other words, the Excel spreadsheet has to be available to the report wherever it is located. Could be a permissions issue, too.

-LB
 
Hi LB.

The spreadsheet is located on shared network, accessible to everyone, without any special permissions (it's set for Everyone).

I guess this is not problem of the report but the software we use to pull these reports. Oh well, looks like there's no other way dealing with this.

Thank you anyway for help LB.

Regards
Jan
 
One of the big issues of using an Excel spreadsheet as a data source. If the spreadsheet is opened by anyone, then it 'locks' the spreadsheet and Crystal Reports will return an error. So in your case, you either need to make a copy of the spreadsheet (in a different location?) or import the data to a regular database (Oracle, MS-SQL, MySQL, Access, etc).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top