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
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