Dear Respected,
I am facing maximum job limit error, while download a report from download link button in asp.net using vb.net (VS 2015). Every day need to restart the Web Server 2008 Services. Kindly advise i would be very thankful to you.
Regards,
Ali Rizvi
Dim cn As String = ConfigurationManager.ConnectionStrings("dbConnection").ToString
Dim rpt As New ReportDocument()
Dim rst As New ADODB.Recordset
Dim applicantname As TextObject
'Dim HealthID As TextObject
Dim passportno As TextObject
Dim genage As TextObject
Dim HealthAssessment As TextObject
Dim GST As TextObject
Dim formatType As ExportFormatType = ExportFormatType.NoFormat
Dim attachment As String
rpt.Load(Server.MapPath("~/InvoiceReport.rpt"))
applicantname = rpt.ReportDefinition.ReportObjects("txtname")
applicantname.Text = Trim(Session("FirstName") & " " & Session("LastName"))
'HealthID = rpt.ReportDefinition.ReportObjects("txthealthid")
'HealthID.Text = frmLabServices.lblHealthID.Text
passportno = rpt.ReportDefinition.ReportObjects("txtpassportno")
passportno.Text = passport
If gender = "M" Then
genage = rpt.ReportDefinition.ReportObjects("txtgenderage")
genage.Text = "Male" & "/" & age & " " & "year"
ElseIf gender = "F" Then
genage = rpt.ReportDefinition.ReportObjects("txtgenderage")
genage.Text = "Female" & "/" & age & " " & "year"
End If
HealthAssessment = rpt.ReportDefinition.ReportObjects("txtHA")
HealthAssessment.Text = project
Dim rs As New ADODB.Recordset
Dim sql As String
Dim MHACAddress As TextObject
With rs
.CursorLocation = ADODB.CursorLocationEnum.adUseClient
If .State = 1 Then .Close()
sql = "Select * from MedicalCenter where Location = '" & clinic & "'"
.Open(sql, cn, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic)
MHACAddress = rpt.ReportDefinition.ReportObjects("txtAddress")
MHACAddress.Text = "Migration Health Assessment Center," & " " & clinic & vbCrLf & Trim(.Fields("Address").Value) & "." & vbCrLf & Trim(.Fields("ContactNo").Value)
.Close()
End With
rpt.Refresh()
rst.Open("Select * from ReceiptInfo where receiptno = '" & lblReceiptNo.Text & "'order by ecode", cn, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic)
rpt.SetDataSource(rst)
'CrystalReportViewer1.ReportSource = rpt
attachment = Trim(lblReceiptNo.Text & "-" & Session("FirstName") & " " & Session("LastName"))
formatType = ExportFormatType.PortableDocFormat
rpt.ExportToHttpResponse(formatType, Response, False, attachment)
Response.[End]()
Response.Close()