I have a project to build a crystal report in asp.net environment pulling data out of an Oracle database, and encountered an issue. I have similar projects before with SQL Server, but this issue never happened on pulling data from SQL server. My issue is after the crystal report is generated on the asp.net web screen, everything looks good. But when the user click on the next page icon at the top function toolbar, it asks for further information for Oracle logon id (which is filled with preset value) and password (blank). The password has to be entered in order to get to the second page of the report if it has more than one page. I’ve also found out that if the report has only one page of data, when a user clicks the print icon at the top of the function toolbar, it won’t bring up the print menu at all. It just does nothing and nothing happens. However, after a page navigation click attempt, then the Oracle logon screen comes up, and after entering the password, the print menu continues to work for user to choose to print the report. Allow me to describe how I did and hope you could point out what I have missed or what I have done wrong.
I first created the crystal report inside the Visual Studio engine. The report already has a connection using OLEDB ADO, which is originated from ‘Oracle Provider for OLEDB driver’ downloaded from Oracle support and was installed previously, to connect to the Oracle database with properly credential already entered, so that I could build the report by dragging and dropping fields. I have used Add command with a working sql statement. The report will need two parameters which have been defined in the crystal report and in the Selection Expert-Record. And the following is a section of the code in asp.net(vb) in which to show how I bring up and pass the parameters to the crystal report:
Me.CrystalReportViewer2.Visible = True
Me.CrystalReportSource2.Report.FileName = Server.MapPath("~\ReportsPortal\Interpreter3_2.rpt")
Dim rptDoc As ReportDocument = New ReportDocument
rptDoc.Load(Server.MapPath("~\ReportsPortal\Interpreter3_2.rpt"))
rptDoc.SetDatabaseLogon("icmsuser", "xxxx")
rptDoc.SetParameterValue("DateInput2B", Me.TextBox5.Text)
rptDoc.SetParameterValue("DateInput2", Me.TextBox6.Text)
Me.CrystalReportViewer2.ReportSource = rptDoc
I use Visual Studio 2012, and have already patched the Crystal Report in it to the latest 12.
Thank you for your assistance.
Martin