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!

Crystal Reports not refreshing parameters sent from ASP.NET

Status
Not open for further replies.

mohaimen

Programmer
Dec 24, 2001
25
0
0
BD
Hi,

I am developing an ASP.NET web application that uses CR 10 for reporting. I developed an ASP.NET page that calls rpt files developed outside the project. The page sends server names and other parameters to the rpt file. However, while trying to display reports, CR is looking for the server that was originally used to develop reports. The code looks like the following:

Private Sub ShowReport()
Try
Dim reportObj As ReportDocument = New ReportDocument
Dim reportFileName As String

If ReportParams.Language = "ENGLISH" Then
reportFileName = ReportParams.ReportFile + "_E.rpt"
Else
reportFileName = ReportParams.ReportFile + "_B.rpt"
End If

reportFileName = Server.MapPath(reportFileName)

If Not File.Exists(reportFileName) Then
Throw New ApplicationException("Report file not found at: " + reportFileName + ".")
End If


reportObj.Load(reportFileName)

If ReportParams.ShowFiscalYear Then
reportObj.SetParameterValue("@FiscalYear", ReportParams.FiscalYear)
End If

If ReportParams.ShowLegal Then
reportObj.SetParameterValue("@LegalID", ReportParams.LegalCode)
End If

reportObj.SetParameterValue("@MinistryID", ReportParams.MinistryID)
If ReportParams.ShowFuncUnit Then
reportObj.SetParameterValue("@FunctionID", ReportParams.FuncID)
End If
If ReportParams.ShowOperUnit Then
reportObj.SetParameterValue("@OpunitID", ReportParams.OperID)
End If
reportObj.SetParameterValue("@StartingPage", ReportParams.StratingPage)


reportObj.SetDatabaseLogon(DBConnection.GetIBudgetUserID, DBConnection.GetIBudgetPassword, _
DBConnection.GetIBudgetDataSource, DBConnection.GetIBudgetInitialCatalog, True)
CrystalReportViewer1.ReportSource = reportObj
Catch appEx As ApplicationException
Throw appEx
Catch ex As Exception
Throw New Exception("Problem has occured while generating report.")
End Try

End Sub

Can anyone help?

Regards.

Mohaimen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top