Sub-Report requires re-logon to the database when spool to printer
Hi,
I got a problem in Crystal XI.
When I export a report with one sub-report in VB.Net by using ReportDocument.Export(), no error found.
However, when I use another procedure to spool the report to the printer:
VB Code:
Private Sub SpoolToPrinter()
Dim rpt as New ReportDoucment
rpt.Load("c:\abc.rpt") 'abc.rpt is the report result with data
rpt.PrintOptions.PrinterName = "Epson DFX-8000"
rpt.PrintToPrinter(1, false, 0, 0)
rpt.Close()
End Sub
An exception throws and says "Unable to connect: incorrect log on parameters"
It seems that the sub-report need to get the username and password again when spooling to the printer.
I try to open the report result file in Crystal XI. The logon prompts will show up when loading the sub-report data. However, after I logon and get the data displayed in the sub-report and save the data with report. I do not need to re-logon again when I re-open the report result in Crystal XI or using .Net code to spool this modified report result to the printer.
Please help!
Thanks!