Hi, am getting this error : "A Crystal Reports job failed because a free license could not be obtained in the time allocated. More licenses can be purchased direct from Crystal Decisions or through the Crystal Decisions Online "..
The application was working fine all day but suddenly started throwing above error.. I think this error started when i tried to debug one particluar crystal report which was taking a lot of time to load and throwing error "Login Failed"..
I tried to google and found below (at this site : http://www.experts-exchange.com/Database/Reporting_/Crystal_Reports/Q_21434358.html - http://www.experts-exchange.com/Database/Reporting_/Crystal_Reports/Q_21434358.html )
"How are you closing the reports? Crystal has a habit of keeping the license and database connection open until explicitly closed or the app is terminated. " Can anyone pls tell me how to close reports?
below is my code:
Private Sub GetReportData() Try Dim crReportDocument As New ReportDocument Dim ConnInfo As New ConnectionInfo With ConnInfo .ServerName = gbVariables.StrReportServer .DatabaseName = gbVariables.strReportDBName .UserID = gbVariables.strUsrName .Password = gbVariables.strUsrPwd End With crReportDocument.Load(gbVariables.strDocPathFolder + "\" + "TOP50CUSTOMERS.rpt") Me.CrystalReportViewer1.ParameterFieldInfo.Clear() Dim ParamFields As ParameterFields = Me.CrystalReportViewer1.ParameterFieldInfo
'Set Month Paramter Dim GetMonthValues As Int16 GetMonthValues = Session("Month") Dim Per As New ParameterField Per.ParameterFieldName = "@Month" Dim Month_Value As New ParameterDiscreteValue Month_Value.Value = GetMonthValues Per.CurrentValues.Add(Month_Value) ParamFields.Add(Per)
Me.CrystalReportViewer1.ReportSource = crReportDocument crReportDocument.SetDatabaseLogon(gbVariables.strUsrName, gbVariables.strUsrPwd, gbVariables.StrReportServer, gbVariables.strReportDBName) Me.CrystalReportViewer1.RefreshReport() CrystalReportViewer1.Visible = True Catch ex As Exception lblError.Text = ex.Message.ToString End Try End Sub
Thanks to help...
------------- Thanks,
Yasin.
|