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

How can I export a Report with Subreport in VB?

Status
Not open for further replies.

chenkang

Programmer
Jan 22, 2002
20
0
0
US
Hello,

I have a VB application to export crystal report to a RPT file. It works fine. However, if that report contain a subreport, the subreport can't be exported. When I open the exported RPT file, a login box will pop-up ask me to input database username and password for subreport.

In my VB code, I do set logon info for subreport,

Set cryReport = cryApp.OpenReport("MainReport.rpt")
Set subRpt1 = cryReport.OpenSubreport("Sub_PLTotal.rpt")
Set crtable = cryReport.Database.Tables.Item(1)
Set crtable1 = subRpt1.Database.Tables.Item(1)
crtable.SetLogOnInfo mvarDSN_Name, mvarTNS_Name, mvarDB_UserName, mvarDB_Password
crtable1.SetLogOnInfo mvarDSN_Name, mvarTNS_Name, mvarDB_UserName, mvarDB_Password

There is no error when I run that VB App, and the main report would be exported. However, a login box will pop-up ask me to input database username and password for subreport.

Got any idea?

Thanks a lot.

Kang Chen
 
Have you run any of the CD updates for CR recently?

Recently ran into this myself and it was a tracked and fixed issue with CD.. You may want to have a look at this CD KBase article -- c2012004



Cheers,

SurfingGecko
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top