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

How to log into subreports using Crystal API

Status
Not open for further replies.

schmoli

Programmer
Jul 24, 2001
4
US
Crystal Version: 8.0 Developer
Problem: I have reports that have several sub-reports embedded into them. These subreports lie primarily in detail sections, so that for each row returned for the main report, a sub-report will be executed (it's parameters are entirely derived from the table fields of the first report, and are linked and working correctly through the Crystal Designer).
Due to a limitation of Crystal and SQL 2000, I need to be able to overwrite the database Server, database Name, and database Login Info for each subreport in addition to the main report. I have always just logged into the main report and let it pass my info to the subreports, the code for this is (in C++):
Code:
PELogOnInfo peLogOnInfo;
... setting of login info removed...
e = ::PESetNthTableLogOnInfo( hJob, 0, &peLogOnInfo, TRUE );
[code]
I need to figure out how to set the correct login for the dynamic number of subreports contained in the report (my reports contain between 0 and 10 subreports each), and I'm quite confused.

FYI, The reason I have to do this is because after talking with Crystal Support yesterday, it turns out that they have never dealt with SQL 2000 'Named Instances', wherin your database servers name is not just 'MACHINENAME', but 'MACHINENAME\INSTANCENAME', and when my main report propogates login info to the subreports, the '\' is incorrectly interpretted as a special character, and my subreports are unable to login.  I NEED a way out of this, as unfortunately I don't have the ability to move my server
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top