1. Este site usa cookies. Ao continuar a usar este site está a concordar com o nosso uso de cookies. Saber Mais.

catch "thread was being aborted"

Discussão em 'Web Development' iniciada por alfinete, 5 de Maio de 2009. (Respostas: 0; Visualizações: 845)

  1. alfinete

    alfinete Power Member

    estou em asp.net c#

    Código:
     #region objectos
    
    
            private SIGASecretariaRpt.RptSIGASecretaria crReportDocument = null;
            private DataSet dsreport = null;
            CrystalDecisions.Shared.ParameterField paramnumregistos;
    
            #endregion
    
            #region Web Form Designer generated code
    
            override protected void OnInit(EventArgs e)
            {
                base.OnInit(e);
            }
    
            #endregion
    
            #region eventos
    
           
           
            protected void Page_Load(object sender, EventArgs e)
            {
    
               
          [B][COLOR=Navy] [COLOR=Blue]Page.Title ="teste";[/COLOR][/COLOR][/B]
    
                if (!Page.IsPostBack)
                {
    
                    DataTable dtreport = new DataTable();
                    dsreport = new DataSet(); 
                                                     
    
                    RptSrcSecretaria.ReportDocument.FileName = MapPath("~/SIGASecretaria/SIGASecretariaRpt/RptSIGASecretaria.rpt");
    
                 
                    dtreport =  Search();
                    dsreport.Tables.Add(dtreport.Copy());  
                    if (dsreport != null)
                    {
                        mostra_dados( dsreport, crReportDocument);
                    }
    
                }
    
            }
    
            #endregion
    
            #region metodos
    
    
            private void mostra_dados(DataSet ds, SIGASecretariaRpt.RptSIGASecretaria crReportDocument)
            {
                try
                {
    
                    crReportDocument = new SIGASecretariaRpt.RptSIGASecretaria();
                    ds.Tables[0].TableName = "dtsecretaria";
                    ds.DataSetName = "XsdSIGASecretaria";
                    crReportDocument.SetDataSource(ds);
                    RptVwrSecretaria.ReportSource = crReportDocument;
                    datafilters(crReportDocument, ds.Tables[0].Rows.Count);
    
                    [COLOR=Red]crReportDocument.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, false, "ExportedReport");[/COLOR]
                  
                }
                catch (Exception exp)
                {
                    string er = exp.Message;
                }
                finally
                {
                    //dsrequisitos = null;
                }
            }
    
            private string Filter()
            {
                string result = string.Empty;
                string R_numcand = string.Empty  ;
                string R_assunto = string.Empty;
                string R_DataDe = string.Empty;
                string R_DataA = string.Empty;
                string R_requerido = string.Empty;
                string R_requerente = string.Empty;
                string R_EspecieProcesso = string.Empty;
    
                if (Request.QueryString["NumCand"] != null)
                    R_numcand = Request.QueryString["numcand"].ToString();
    
                if (Request.QueryString["Assunto"] != null)
                    R_assunto = Request.QueryString["Assunto"].ToString();
    
                if (Request.QueryString["DataDe"] != null)
                    R_DataDe = Request.QueryString["DataDe"].ToString();
    
                if (Request.QueryString["DataA"] != null)
                    R_DataA = Request.QueryString["DataA"].ToString();
    
                if (Request.QueryString["Requerido"] != null)
                {
                    if (Request.QueryString["Requerido"].ToString() != "Seleccione uma opção")
                        R_requerido = Request.QueryString["Requerido"].ToString();
                }
    
                if (Request.QueryString["Requerente"] != null)
                {
                    if (Request.QueryString["Requerente"].ToString() != "Seleccione uma opção")
                        R_requerente = Request.QueryString["Requerente"].ToString();
                }
    
                if (Request.QueryString["EspecieProcesso"] != null)
                {
                    if (Request.QueryString["EspecieProcesso"].ToString() != "Seleccione uma opção")
                    {
                        R_EspecieProcesso = Request.QueryString["EspecieProcesso"].ToString();
                    }
                }
                if (R_numcand != string.Empty)
                {
                    if (result != string.Empty)
                    {
                        result = result + " AND ";
                    }
                    result = result + " N_Processo Like '%" + R_numcand + "%'";
                }
    
                if (R_assunto != string.Empty)
                {
                    if (result != string.Empty)
                    {
                        result = result + " AND ";
                    }
                    result = result + " Assunto Like '%" + R_assunto + "%'";
                }
    
    
                if (R_DataDe != string.Empty)
                {
                    if (result != string.Empty)
                    {
                        result = result + " AND ";
                    }
                    result = result + " [Data_Inserção] >= '" + Generic.SetDtYMDHMS(DateTime.Parse(R_DataDe + " 00:00:00")) + "' ";
                }
    
                if (R_DataA != string.Empty)
                {
                    if (result != string.Empty)
                    {
                        result = result + " AND ";
                    }
    
                    result = result + " [Data_Inserção] <= '" + Generic.SetDtYMDHMS(DateTime.Parse(R_DataA + " 23:59:59")) + "' ";
                }
    
                if (R_requerido != string.Empty  )
                {
                    if (result != string.Empty)
                    {
                        result = result + " AND ";
                    }
                    result = result + " Requerido Like '%" + R_requerido + "%'";
                }
    
                if (R_requerente != string.Empty  )
                {
                    if (result != string.Empty)
                    {
                        result = result + " AND ";
                    }
                    result = result + " Requerente Like '%" + R_requerente + "%'";
                }
    
                if (R_EspecieProcesso != string.Empty  )
                {
                    if (result != string.Empty)
                    {
                        result = result + " AND ";
                    }
                    result = result + " Espécie_Processo Like '%" + R_EspecieProcesso + "%'";
                }
    
                if (result != string.Empty)
                {
                    result = " AND " + result;
                }
    
                return result;
            }
    
            private DataTable Search()
            {
                // string teste =  System.Configuration.ConfigurationSettings.AppSettings["FortisQueryAnalisar"].ToString();   
                ViewState["Invisible_ColumsnID"] = string.Empty;
                StepAhead.DataAccessLayer.SACFortisDBAccess oDocTypes = new StepAhead.DataAccessLayer.SACFortisDBAccess();
                oDocTypes.Query = int.Parse(System.Configuration.ConfigurationSettings.AppSettings["FortisQueryReport"].ToString());
                oDocTypes.Where = Generic.StateField + " <> '" + Generic.EstadoEliminar + "' AND " +
                                  Generic.StateField + " = '" + Generic.EstadoNovo + "'" + Filter();
    
                oDocTypes.ExtraFields = "F_DocumentID";
    
                DataTable dtDoctypes = oDocTypes.StepFortisGetQueryResult();
    
                return dtDoctypes; 
              //  dtDoctypes = null;
            }
    
            private void datafilters(SIGASecretariaRpt.RptSIGASecretaria crReportDocument, int numregistos)
            {
                paramnumregistos = crReportDocument.ParameterFields["numregistos"];
                paramnumregistos.CurrentValues.AddValue(Convert.ToString(numregistos));
            
            }
    
            protected void Page_Unload(object sender, EventArgs e)
            {
                dsreport = null;
    
    
            }
    
    
    
    
    
    
            #endregion
    
    da-me o erro thread was being aborted na linha a vermelho

    e na linha a azul não me muda o titulo da pagina


    agradecia uma ajuda
     

Partilhar esta Página