Link to home
Start Free TrialLog in
Avatar of mgmhicks
mgmhicks

asked on

Thread is being aborted

I have a web grid view with a couple of command objects.  ONe is Print, the other is Edit and the other is close.  I can click edit and it goes to the next page, and I can edit the form.  I click print and I get "Thread is being aborted."  Both the print and edit pages are in the same folder and as you can see I am using server.transfer to get to the page.  I used server.transfer to try and get to the print page, but I get the error.  I have attached the main form with the code.  As well as the page I am going to.  I think it is having a problem loading the report.  I works fine on the developement comnputer

thanks
 
Private Sub gvInspections_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gvInspections.RowCommand

        Dim i As Integer = CInt(e.CommandArgument)
        Dim mWO As String = sender.rows(i).cells(0).text
        Dim mPropertyID As String = ddProperties.Text
        Try

            Select Case e.CommandName
                Case Is = "Print"
                    Server.Transfer("InspectionReportsForm.aspx?WO=" + mWO + "&Type=1&PropName=" + mPropertyID)
                Case Is = "Edit"
                    Response.Redirect("MOInspectionsEdit.aspx?WO=" + mWO + "&Type=1&PropName=" + mPropertyID, False)
                    'Server.Transfer("MOInspectionsEdit.aspx?WO=" + mWO + "&PropName=" + mPropertyID)
                Case Is = "Close"
                    Dim test2 As String = ""
            End Select
        Catch ex As Exception
            Session.Add("oError", ex.Message)
            Server.Transfer("..\Errors.aspx")
        End Try

        
    End Sub

Open in new window

Protected Function PrintCharges() As Boolean
        Dim rd As New ReportDocument
        Dim rptDS As New DataSet
        Dim rptDS2 As New DataSet
        Dim myCmd As New SqlCommand
        Dim da As New SqlDataAdapter
        ' Dim myConn As String = "SERVER=10.10.10.44,8433;Database=AptGalleryInspections;uid=sa;pwd=sh4207"
        'Dim cn As New SqlConnection(myconn)

        Dim myfilelocation As String = Server.MapPath("\Reports\MOInspectionsReport_Resident_web.rpt")
        
        Try
            rd.Load(myfilelocation)
            ' SetCurrentValuesForParameterField(rd, "mWO_number", "mPropertyName")
            rd.SetParameterValue(0, mWO_Number)
            rd.SetParameterValue(1, mPropertyName)

           
            rd.SetDatabaseLogon("sa", "sh4207", "10.10.10.44,8433", "AptGalleryInspections")
            Dim logon As New TableLogOnInfo
            Dim tbl As Table
            Dim subReport As ReportDocument
            For Each subReport In rd.Subreports
                For Each tbl In subReport.Database.Tables
                    logon = tbl.LogOnInfo
                    logon.ConnectionInfo.ServerName = "10.10.10.44,8433"
                    logon.ConnectionInfo.DatabaseName = "AptGalleryInspections"
                    logon.ConnectionInfo.UserID = "sa"
                    logon.ConnectionInfo.Password = "sh4207"
                    tbl.ApplyLogOnInfo(logon)
                Next
            Next
            CR1.ReportSource = rd
        
        Catch ex As Exception
            Session.Add("oError", ex.Message)
            Server.Transfer("..\Errors.aspx")
        End Try

        
    End Function

Open in new window

Avatar of Easwaran Paramasivam
Easwaran Paramasivam
Flag of India image

In print case, instead of
  Server.Transfer("InspectionReportsForm.aspx?WO=" + mWO + "&Type=1&PropName=" + mPropertyID)
try

   Response.Redirect("InspectionReportsForm.aspx?WO=" + mWO + "&Type=1&PropName=" + mPropertyID, False)
Avatar of mgmhicks
mgmhicks

ASKER

I tried that with same result.  I have a feeling it's not able to find report.
Try to find error by debugging the application (on clicking the print button) and let me know the error.
Did you step through the code to find out what line of code is throwing the error?

By the way, this

Server.MapPath("\Reports\MOInspectionsReport_Resident_web.rpt")

should be

Server.MapPath("/Reports/MOInspectionsReport_Resident_web.rpt")
Why does it work on developement and not on production machine?  Thats whats really making me confused.  I cant step through cause it works on developement, and errors on production.

I think the error is being thrown by Crystal due to some configuration issue. Have you granted iusr full access to temp files?
Man codeCruiser I would agree with you. What folder is the temp files going to be in?
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hate to be a pain but should I filter on.  Ran the website called esitecompanion and did a search on it and it found nothing.  So what should I filter on?  Thanks again for helping
think I may have found something.  this is between a success read of report file, and a line that goes to the error page.  Now what does it mean?

Date & Time:      10/12/2011 7:45:58 PM
Event Class:      Registry
Operation:      RegOpenKey
Result:      NAME NOT FOUND
Path:      HKU\.DEFAULT\Software\Business Objects\Suite 12.0\Crystal Reports\Locale
TID:      8564
Duration:      0.0000176
Desired Access:      Read
CodeCruiser this looks like the problem maybe.  I did give rights to iuser to the windows\temp folder, but it creates the temp file, but ten it cant

Date & Time:      10/12/2011 8:57:32 PM
Event Class:      File System
Operation:      CreateFile
Result:      ACCESS DENIED
Path:      C:\Windows\Temp\MOInspectionsResidentWeb {ABD569B1-2235-49B8-9B8A-2661168CC052}.rpt
TID:      5244
Duration:      0.0000299
Desired Access:      Generic Read
Disposition:      Open
Options:      Synchronous IO Non-Alert, Non-Directory File
Attributes:      N
ShareMode:      Read, Write, Delete
AllocationSize:      n/a
Yeah that's the problem most likely. Did you give it full control? Also see if there is a ASPNET user and give it full access as well.