当前位置: 首页>>代码示例>>C#>>正文


C# ReportDocument.Dispose方法代码示例

本文整理汇总了C#中ReportDocument.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# ReportDocument.Dispose方法的具体用法?C# ReportDocument.Dispose怎么用?C# ReportDocument.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ReportDocument的用法示例。


在下文中一共展示了ReportDocument.Dispose方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: btnImprimir_Click

    protected void btnImprimir_Click(object sender, EventArgs e)
    {
        string Ciclo = this.ddlCiclo.SelectedValue;
        int Zona = int.Parse(this.ddlZonas.SelectedValue);
        int PlantelID = int.Parse(this.ddlPlanteles.SelectedValue);
        byte Turno = byte.Parse(this.ddlTurnos.SelectedValue);
        int Estatus = int.Parse(ddlEstatus.SelectedValue);

        string NomPlantel = this.ddlPlanteles.SelectedItem.Text;

        db = new DBEscolarDataContext();
        var res = (from A in db.vwRPTEstadisticaPreInscritos011s
                   where A.Ciclo == Ciclo && A.Zona == Zona && A.PlantelID == PlantelID && A.Turno == (Turno == 0 ? A.Turno : Turno)
                    && A.Estatus == (Estatus == -1 ? A.Estatus : Estatus)
                   orderby A.Zona, A.Plantel, A.Turno, A.Nombre
                   select A).ToList();

        this.lblMensaje.Visible = res.Count() == 0;
        if (res.Count() == 0)
            return;

        ReportDocument rptDoc = new ReportDocument();

        rptDoc.Load(Server.MapPath("../Reportes/rptEstPre01.rpt"));
        rptDoc.SetDataSource(res);
        rptDoc.SetParameterValue("NomPlantel", NomPlantel);

        MemoryStream stream = (MemoryStream)rptDoc.ExportToStream(CrystalDecisions.Shared.ExportFormatType.Excel);
        rptDoc.Close();
        rptDoc.Dispose();

        Response.Clear();
        Response.Buffer = true;
        Response.ContentType = "application/vnd.ms-excel";
        Response.AddHeader("Content-Disposition", "inline; filename=Alumnos.xls");
        Response.BinaryWrite(stream.ToArray());
        Response.End();
        stream.Close();
        stream.Dispose();
    }
开发者ID:amoras5,项目名称:cb_reinscripcion,代码行数:40,代码来源:Preinscripciones.aspx.cs

示例2: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        String qs = Request.QueryString.Get("bid");
        Response.Write("Query String = " + qs);
        SqlConnection sql = new SqlConnection();
        sql.ConnectionString = "Data Source=(local);Initial Catalog=Hotel;Integrated Security=True";
        sql.Open();

        ReportDocument rpd = new ReportDocument();
        rpd.Load(Server.MapPath("itcreport.rpt"));
        rpd.SetDatabaseLogon("sa", "ak");
        rpd.SetParameterValue(0, qs);
        CrystalReportViewer1.ReportSource = rpd;

        //to convert report in pdf format
        MemoryStream ostream = new MemoryStream();
        Response.Clear();
        Response.Buffer = true;
        ostream = (MemoryStream)rpd.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
        rpd.Close();
        rpd.Dispose();
        Response.ContentType = "application/pdf";
        Response.BinaryWrite(ostream.ToArray());
        ostream.Flush();
        ostream.Close();
        ostream.Dispose();
    }
开发者ID:akshaykhanna,项目名称:Hotel-Booking-website,代码行数:27,代码来源:report.aspx.cs

示例3: GeneratePDF

		private void GeneratePDF()
		{
            ReportDocument rpt = new ReportDocument();
            rpt.Load(Server.MapPath(Constants.ROOT_DIRECTORY + "/Reports/GeneralLedger.rpt"));

			ExportOptions exportop = new ExportOptions();
			DiskFileDestinationOptions dest = new DiskFileDestinationOptions();
			
			string strPath = Server.MapPath(@"\RetailPlus\temp\");

			string strFileName = "generalledger_" + Session["UserName"].ToString() + "_" + DateTime.Now.ToString("yyyyMMddhhmmssff") + ".pdf";
			if (System.IO.File.Exists(strPath + strFileName))
				System.IO.File.Delete(strPath + strFileName);

			dest.DiskFileName = strPath + strFileName;

			exportop = rpt.ExportOptions;
	
			SetDataSource(rpt);

			exportop.DestinationOptions = dest;
			exportop.ExportDestinationType = ExportDestinationType.DiskFile;
			exportop.ExportFormatType = ExportFormatType.PortableDocFormat;
			rpt.Export();   rpt.Close();    rpt.Dispose();
			
			fraViewer.Attributes.Add("src","/RetailPlus/temp/" + strFileName);
		}
开发者ID:marioricci,项目名称:erp-luma,代码行数:27,代码来源:_GeneralLedger.ascx.cs

示例4: GeneratePDF

		private void GeneratePDF()
		{
            ReportDocument rpt = new ReportDocument();
            switch (cboView.SelectedItem.Value)
            {
                case "0":
                    rpt.Load(Server.MapPath(Constants.ROOT_DIRECTORY + "/Reports/ChartOfAccountsDetails.rpt"));
                    break;
                case "1":
                    rpt.Load(Server.MapPath(Constants.ROOT_DIRECTORY + "/Reports/ChartOfAccountsSummary.rpt"));
                    break;
            }

			ExportOptions exportop = new ExportOptions();
			DiskFileDestinationOptions dest = new DiskFileDestinationOptions();
			
			string strPath = Server.MapPath(@"\RetailPlus\temp\");

			string strFileName = "chartofacc_" + Session["UserName"].ToString() + "_" + DateTime.Now.ToString("yyyyMMddhhmmssff") + ".pdf";
			if (System.IO.File.Exists(strPath + strFileName))
				System.IO.File.Delete(strPath + strFileName);

			dest.DiskFileName = strPath + strFileName;

			exportop = rpt.ExportOptions;
	
			SetDataSource(rpt);

			exportop.DestinationOptions = dest;
			exportop.ExportDestinationType = ExportDestinationType.DiskFile;
			exportop.ExportFormatType = ExportFormatType.PortableDocFormat;
			rpt.Export();   rpt.Close();    rpt.Dispose();
			
			fraViewer.Attributes.Add("src","/RetailPlus/temp/" + strFileName);
		}
开发者ID:marioricci,项目名称:erp-luma,代码行数:35,代码来源:_Reports.ascx.cs

示例5: CrystalReportViewer1_Loaded

 private void CrystalReportViewer1_Loaded(object sender, RoutedEventArgs e)
 {
     ReportDocument report = new ReportDocument();
     if (m_isurduvisible)
     {
         report.Load("../../Reports/SaleReceipt_u.rpt");
     }
     if (!m_isurduvisible)
     {
         report.Load("../../Reports/SaleReceipt_e.rpt");
     }
     
     ArrayList reportdata = new ArrayList();
     reportdata.Add(productSold);
   
     using(var db = new HCSMLEntities1())
     {               
         try
         {
             report.SetDataSource(from c in db.saleproducts where c.seqid == productSold.seqid select c);
         }
         catch (NotSupportedException ex)
         {}
         catch (Exception ex)
         {}
        
     }
     crystalReportsViewer1.ViewerCore.ReportSource = report;
     report.Dispose();
 }
开发者ID:sohaibjaved44,项目名称:HCS,代码行数:30,代码来源:winFeedMillReportViewer.xaml.cs

示例6: Imprimir

    private void Imprimir(int AlumnoID)
    {
        DBEscolarDataContext db = new DBEscolarDataContext();
        var Pago = (from P in db.vwRPTPagosEncabezados join D in db.vwRPTPagosDetalles on P.PagoID equals D.PagoID
                    where P.AlumnoID == AlumnoID && P.Ciclo == Utils.CicloActual && (P.Estatus != 0)
                    && D.Clave == "A01"
                    select P).FirstOrDefault();

        if (Pago == null)
        {
            this.lblMensaje.Text = "No se ha encontrado la ficha de pago.<br />Nota: Para poder generar la Ficha de Pago, debes de estar validado.";
            return;
        }
        else if (Pago.Estatus == 3) {

            Alumno Alumno = (from A in db.Alumnos
                             where A.AlumnoID == AlumnoID
                             select A).FirstOrDefault();

            this.lblMensaje.Text = "Felicidades. Tú ficha ha sido pagada y ya te encuentras inscrito con matrícula: " + Alumno.Matricula;
            return;

        }

        var Detalle = (from D in db.vwRPTPagosDetalles
                       where D.PagoID == Pago.PagoID
                       select D).ToList();

        //Actualiza el estatus del pago a 2:Impreso
        db.spEXEPagosCambiaEstatus(AlumnoID, Pago.PagoID, 2, Utils.CicloActual);

        ArrayList col = new ArrayList();
        col.Add(Pago);
        ReportDocument rptDoc = new ReportDocument();

        rptDoc.Load(Server.MapPath("Reportes/rptFichaDePago.rpt"));
        //set dataset to the report viewer.
        rptDoc.SetDataSource(col);
        rptDoc.Subreports["Detalle"].SetDataSource(Detalle);
        rptDoc.Subreports["Detalle2"].SetDataSource(Detalle);

        MemoryStream stream = (MemoryStream)rptDoc.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
        rptDoc.Close();
        rptDoc.Dispose();
        Response.Clear();
        Response.ContentType = @"Application/pdf";
        Response.AddHeader("Content-Disposition", "inline; filename=FichaDePago.pdf");
        Response.AddHeader("content-length", stream.Length.ToString());
        Response.BinaryWrite(stream.ToArray());
        Response.Flush();
        stream.Close();
        stream.Dispose();
    }
开发者ID:amoras5,项目名称:cb_reinscripcion,代码行数:53,代码来源:ImprimirFichaDePago.aspx.cs

示例7: GenerateReport

        public static void GenerateReport(string FileName, ReportDocument rpt, System.Web.UI.Control ClientScriptBlockControl, ExportFormatType pvtExportFormatType)
        {
            try
            {
                ExportOptions exportop = new ExportOptions();
                DiskFileDestinationOptions dest = new DiskFileDestinationOptions();

                string strFileExtensionName = ".pdf";
                switch (pvtExportFormatType)
                {
                    case ExportFormatType.PortableDocFormat: strFileExtensionName = ".pdf"; exportop.ExportFormatType = ExportFormatType.PortableDocFormat; break;
                    case ExportFormatType.WordForWindows: strFileExtensionName = ".doc"; exportop.ExportFormatType = ExportFormatType.WordForWindows; break;
                    case ExportFormatType.Excel: strFileExtensionName = ".xls"; exportop.ExportFormatType = ExportFormatType.Excel; break;
                }

                string strPath = System.Web.HttpContext.Current.Server.MapPath(@"\retailplus\temp\");
                string strFileName = FileName + "_" + DateTime.Now.ToString("yyyyMMddhhmmssff") + strFileExtensionName;

                if (System.IO.File.Exists(strPath + strFileName))
                    System.IO.File.Delete(strPath + strFileName);

                dest.DiskFileName = strPath + strFileName;
                exportop.DestinationOptions = dest;
                exportop.ExportDestinationType = ExportDestinationType.DiskFile;
                rpt.Export(exportop); //rpt.Close(); rpt.Dispose();
                
                // remove the error
                if (pvtExportFormatType == ExportFormatType.WordForWindows || pvtExportFormatType == ExportFormatType.Excel || pvtExportFormatType == ExportFormatType.PortableDocFormat)
                {
                    // the maximum report processing jobs limit configured by your system administrator has been reached.
                    rpt.Close(); rpt.Dispose();
                }

                if (pvtExportFormatType == ExportFormatType.PortableDocFormat)
                {
                    string newWindowUrl = Constants.ROOT_DIRECTORY + "/temp/" + strFileName;
                    string javaScript = "window.open('" + newWindowUrl + "');";
                    System.Web.UI.ScriptManager.RegisterClientScriptBlock(ClientScriptBlockControl, ClientScriptBlockControl.GetType(), "openwindow", javaScript, true);
                }
                else
                {
                    string newWindowUrl = Constants.ROOT_DIRECTORY + "/temp/" + strFileName;
                    string javaScript = "window.open('" + newWindowUrl + "','_self');";
                    System.Web.UI.ScriptManager.RegisterClientScriptBlock(ClientScriptBlockControl, ClientScriptBlockControl.GetType(), "openwindow", javaScript, true);

                    //System.Diagnostics.Process p = new System.Diagnostics.Process();
                    //p.StartInfo.FileName = System.Web.HttpContext.Current.Server.MapPath(Constants.ROOT_DIRECTORY + "/temp/" + strFileName);
                    //p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
                    //p.Start();
                }
            }
            catch (Exception ex) { throw ex; }
        }
开发者ID:marioricci,项目名称:erp-luma,代码行数:53,代码来源:CRSHelper.cs

示例8: ExportEt

        //Exporta a Excel el grid
        protected void ExportEt(object sender, EventArgs e)
        {
            string sucursal = cmbSucursal.Value.ToString();

            //1. Configurar la conexión y el tipo de comando
            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["OSEF"].ConnectionString);
            try
            {
                SqlCommand comando = new SqlCommand("web_spS_ObtenerRItemsAdicionales", conn);

                SqlDataAdapter adaptador = new SqlDataAdapter(comando);

                DataTable dt = new DataTable();
                adaptador.SelectCommand.CommandType = CommandType.StoredProcedure;
                adaptador.SelectCommand.Parameters.Add(@"Sucursal", SqlDbType.Char).Value = sucursal;
                adaptador.Fill(dt);

                ReportDocument reporteCuadrila = new ReportDocument();
                reporteCuadrila.Load(Server.MapPath("reportess/ResumenOC.rpt"));
                reporteCuadrila.SetDataSource(dt);

                reporteCuadrila.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, true, "Resumen de OC: " + sucursal);

                reporteCuadrila.Close();
                reporteCuadrila.Dispose();

            }
            catch (Exception ex)
            {
                ex.Message.ToString();
            }
            finally
            {
                if (conn.State != ConnectionState.Closed)
                    conn.Close();
                conn.Dispose();

            }
        }
开发者ID:JYovan,项目名称:PROJECT_APP,代码行数:40,代码来源:OrdenesCambios.aspx.cs

示例9: Export

        private void Export(ExportFormatType pvtExportFormatType)
        {
            ReportDocument rpt = new ReportDocument();
            rpt.Load(Server.MapPath(Constants.ROOT_DIRECTORY + "/Reports/_StockTransactionReport.rpt"));

            SetDataSource(rpt);

            ExportOptions exportop = new ExportOptions();
            DiskFileDestinationOptions dest = new DiskFileDestinationOptions();
            string strPath = Server.MapPath(@"\retailplus\temp\");
            string strFileExtensionName = ".pdf";
            switch (pvtExportFormatType)
            {
                case ExportFormatType.PortableDocFormat: strFileExtensionName = ".pdf"; exportop.ExportFormatType = ExportFormatType.PortableDocFormat; break;
                case ExportFormatType.WordForWindows: strFileExtensionName = ".doc"; exportop.ExportFormatType = ExportFormatType.WordForWindows; break;
                case ExportFormatType.Excel: strFileExtensionName = ".xls"; exportop.ExportFormatType = ExportFormatType.Excel; break;
            }
            string strFileName = "tranreport_" + Session["UserName"].ToString() + "_" + DateTime.Now.ToString("yyyyMMddhhmmssff") + strFileExtensionName;
            if (System.IO.File.Exists(strPath + strFileName))
                System.IO.File.Delete(strPath + strFileName);

            dest.DiskFileName = strPath + strFileName;
            exportop.DestinationOptions = dest;
            exportop.ExportDestinationType = ExportDestinationType.DiskFile;
            rpt.Export(exportop); //rpt.Close(); rpt.Dispose(); 

            if (pvtExportFormatType == ExportFormatType.PortableDocFormat)
            {
                rpt.Close(); rpt.Dispose();
                Response.Redirect(Constants.ROOT_DIRECTORY + "/temp/" + strFileName, false);
            }
            else 
            {
                CRViewer.ReportSource = rpt;
                Session["ReportDocument"] = rpt;
                CRSHelper.OpenExportedReport(strFileName); // OpenExportedReport(strFileName);
            }
            
        }
开发者ID:marioricci,项目名称:erp-luma,代码行数:39,代码来源:_Reports.ascx.cs

示例10: GenerarPDF

    private void GenerarPDF()
    {
        DBEscolarDataContext db = new DBEscolarDataContext();
        var Alumno = (from A in db.vwRPTReinscripcions
                      where A.Matricula == this.Matricula
                      select A).FirstOrDefault();

        if (Alumno == null)//No se encontro
            return;

        System.Collections.ArrayList col = new System.Collections.ArrayList();
        col.Add(Alumno);
        ReportDocument rptDoc = new ReportDocument();

        rptDoc.Load(Server.MapPath("Reportes/rptReinscripcion.rpt"));
        //set dataset to the report viewer.
        rptDoc.SetDataSource(col);

        MemoryStream stream = (MemoryStream)rptDoc.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
        rptDoc.Close();
        rptDoc.Dispose();
        Response.Clear();
        Response.ContentType = @"Application/pdf";
        Response.AddHeader("Content-Disposition", "inline; filename=Solicitud.pdf");
        // Response.AddHeader("Content-Disposition", "attachment; filename=File.pdf");
        Response.AddHeader("content-length", stream.Length.ToString());
        Response.BinaryWrite(stream.ToArray());
        Response.Flush();
        stream.Close();
        stream.Dispose();
    }
开发者ID:amoras5,项目名称:cb_reinscripcion,代码行数:31,代码来源:Solicitud.aspx.cs

示例11: ExportEt

        //Exporta a Excel el grid
        protected void ExportEt(object sender, EventArgs e)
        {
            string parametro = cmbClasificacion.Value.ToString();

            //1. Configurar la conexión y el tipo de comando
            SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["OSEF"].ConnectionString);
            try
            {
                SqlCommand comando = new SqlCommand("web_spS_ObtenerReportesPorClasificacion", conn);
                SqlDataAdapter adaptador = new SqlDataAdapter(comando);
                DataTable dt = new DataTable();
                adaptador.SelectCommand.CommandType = CommandType.StoredProcedure;
                adaptador.SelectCommand.Parameters.Add(@"CLASIFICACION", SqlDbType.VarChar).Value = parametro;
                adaptador.Fill(dt);
                ReportDocument reporteCuadrila = new ReportDocument();
                reporteCuadrila.Load(Server.MapPath("reportess/rMantenimientosFacturador.rpt"));
                reporteCuadrila.SetDataSource(dt);
                reporteCuadrila.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.Excel, Response, true, "Reportes Mantenimiento " + parametro);
                reporteCuadrila.Close();
                reporteCuadrila.Dispose();
            }
            catch (Exception ex)
            {
                ex.Message.ToString();
            }
            finally
            {
                if (conn.State != ConnectionState.Closed)
                    conn.Close();
                conn.Dispose();
            }
        }
开发者ID:JYovan,项目名称:PROJECT_APP,代码行数:33,代码来源:ExploradorMesaDeReporte.aspx.cs

示例12: btninfoBitacora_Click

    protected void btninfoBitacora_Click(object sender, EventArgs e)
    {
        string Ciclo = this.ddlCiclo.SelectedValue;
        DBEstadisticas.Escolar db = new DBEstadisticas.Escolar();

        var Bitacora = (from P in db.Bitacora
                        where P.Ciclo == Ciclo
                        group P by new { P.Z, P.P, P.Descripcion } into g
                        select new { Z = g.Key.Z, P = g.Key.P, g.Key.Descripcion, Fecha = g.Max(x => x.Fecha) }).OrderByDescending(x => x.Fecha).ToList();

        if (Bitacora.Count == 0)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", string.Format("alert('{0}');", "No hay registros encontrados"), true);
            return;
        }

        ReportDocument rptDoc = new ReportDocument();
        rptDoc.Load(Server.MapPath("../Reportes/rptEstBitacora01.rpt"));
        rptDoc.SetDataSource(Bitacora);
        rptDoc.SetParameterValue("Ciclo", Ciclo);

        MemoryStream stream = (MemoryStream)rptDoc.ExportToStream(CrystalDecisions.Shared.ExportFormatType.Excel);
        rptDoc.Close();
        rptDoc.Dispose();

        Response.Clear();
        Response.Buffer = true;
        Response.ContentType = "application/vnd.ms-excel";
        Response.AddHeader("Content-Disposition", "inline; filename=rptEstBitacora01.xls");
        Response.BinaryWrite(stream.ToArray());
        Response.End();
        stream.Close();
        stream.Dispose();
    }
开发者ID:amoras5,项目名称:cb_reinscripcion,代码行数:34,代码来源:Calificaciones.aspx.cs

示例13: GenerarReporteXGrupo

    private void GenerarReporteXGrupo(int Zona, int Plantel, string Ciclo, int Periodo, byte Turno, byte Semestre)
    {
        EscolarModel.EstaEntities db = new EscolarModel.EstaEntities();

        var Alumnos = (from A in db.vwRPTParcial1XGPO
                       join P in db.vwPlanteles on new { z = A.or_zona, pl = A.or_plant } equals new { z = (byte)P.idZona, pl = (int)P.idPlantel }
                       where A.Ciclo == Ciclo && A.Periodo == Periodo &&
                            A.or_zona == (Zona == 0 ? A.or_zona : Zona) && A.or_plant == (Plantel == 0 ? A.or_plant : Plantel)
                            && A.or_turno == (Turno == 0 ? A.or_turno : Turno) && A.or_semest == (Semestre == 0 ? A.or_semest : Semestre)
                            && P.EsEmsad == 0
                       orderby A.or_zona, A.or_plant, A.or_turno, A.or_semest, A.or_grupo, A.or_asigna
                       select A).ToList();

        if (Alumnos.Count == 0)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", string.Format("alert('{0}');", "No hay registros encontrados"), true);
            return;
        }

        ReportDocument rptDoc = new ReportDocument();
        rptDoc.Load(Server.MapPath("../Reportes/rptEstCalXGpo01.rpt"));
        rptDoc.SetDataSource(Alumnos);
        rptDoc.SetParameterValue("Periodo", Periodo);
        rptDoc.SetParameterValue("Ciclo", Ciclo);

        MemoryStream stream = (MemoryStream)rptDoc.ExportToStream(CrystalDecisions.Shared.ExportFormatType.Excel);
        rptDoc.Close();
        rptDoc.Dispose();

        Response.Clear();
        Response.Buffer = true;
        Response.ContentType = "application/vnd.ms-excel";
        Response.AddHeader("Content-Disposition", "inline; filename=rptEstCalXGpo01.xls");
        Response.BinaryWrite(stream.ToArray());
        Response.End();
        stream.Close();
        stream.Dispose();
    }
开发者ID:amoras5,项目名称:cb_reinscripcion,代码行数:38,代码来源:Calificaciones.aspx.cs

示例14: PrintReport

    //dbINFO._SRV, dbINFO._CAT, dbINFO._UID, dbINFO._PWD
    public void PrintReport(Page _Page, string _ReportName, string _FileName, DataTable dt)
    {
        ReportDocument rptDoc = new ReportDocument();
        try
        {
            rptDoc.Load(_Page.Server.MapPath("~/Reports/" + _ReportName));
            rptDoc.SetDataSource(dt);

            rptDoc.SetDatabaseLogon(dbINFO._UID, dbINFO._PWD, dbINFO._SRV, dbINFO._CAT);
            _Page.Response.Buffer = false;
            _Page.Response.ClearContent();
            _Page.Response.ClearHeaders();
            //Export the Report to Response stream in PDF format and file name Customers
            rptDoc.ExportToHttpResponse(ExportFormatType.PortableDocFormat, _Page.Response, true, _FileName);
        }
        catch (Exception ex)
        {
            Utility.ShowHTMLMessage(_Page, "100", ex.Message);
        }
        finally
        {
            rptDoc.Close();
            rptDoc.Dispose();
        }
    }
开发者ID:Mithunchowdhury,项目名称:Save-the-children-,代码行数:26,代码来源:ApplicationManager.cs

示例15: ImprimirTicket


//.........这里部分代码省略.........
            string logo = Application.StartupPath + "\\Imagenes\\Logotipos\\" + caja.Sucursal.Datos.Logo;
            ReportDocument rpt= new ReportDocument();
            rpt.Load("Reportes\\Ticket2.rpt");
            rpt.SetParameterValue("SUCURSAL", caja.Sucursal.Datos.RazonSocial);
            rpt.SetParameterValue("RFC", caja.Sucursal.Datos.RFC);
            rpt.SetParameterValue("DIRECCION", caja.Sucursal.Datos.Direccion);
            rpt.SetParameterValue("CABECERA", caja.Sucursal.Datos.Cabecera);
            rpt.SetParameterValue("FOLIO", t.Folio.ToString("00000"));
            rpt.SetParameterValue("FECHA", t.Datos.Fecha);
            rpt.SetParameterValue("PIE", caja.Sucursal.Datos.Pie);
            rpt.SetParameterValue("Logo", logo);
            string concepto,titulo1,titulo2,firma;
            decimal tc,pago,total,cantidad,vuelto;
            switch (tipo)
            {
                case TipoTransaccion.VentaDll:
                case TipoTransaccion.CompraDll:

                    if(tipo == TipoTransaccion.VentaDll)
                    {
                        concepto="Venta de dolares";
                        cantidad= t.Datos.CargosDLL;
                        titulo1="T.C. Venta";
                        tc=t.Datos.TCVenta;
                        total=t.Datos.AbonosMXN;
                    }
                    else
                    {
                        concepto="Compra de dolares";
                        cantidad= t.Datos.AbonosDLL;
                        titulo1="T.C. Compra";
                        tc=t.Datos.TCCompra;
                        total=t.Datos.CargosMXN;
                    }
                    titulo2="Pago con";
                    pago=t.Datos.PagoCliente;
                    vuelto = t.Datos.VueltoCliente;
                    rpt.SetParameterValue("CONCEPTO", concepto);
                    rpt.SetParameterValue("CANTIDAD", cantidad);
                    rpt.SetParameterValue("Titulo1", titulo1);
                    rpt.SetParameterValue("TC", tc);
                    rpt.SetParameterValue("Titulo2", titulo2);
                    rpt.SetParameterValue("Pago", pago);
                    rpt.SetParameterValue("TOTAL", total);
                    rpt.SetParameterValue("Vuelto", vuelto);
                    rpt.SetParameterValue("Firma", "");
                    break;
                case TipoTransaccion.CambioCheque:
                    cantidad = t.Datos.PagoCliente - t.Datos.VueltoCliente;
                    rpt.SetParameterValue("CONCEPTO", "Comisión cambio cheque" );
                    rpt.SetParameterValue("CANTIDAD",cantidad);
                    rpt.SetParameterValue("Titulo1", "comisión %");
                    rpt.SetParameterValue("TC", t.Datos.ChqComision);
                    rpt.SetParameterValue("Titulo2", "Cantidad del chq.");
                    rpt.SetParameterValue("Pago", t.Datos.PagoCliente);
                    rpt.SetParameterValue("TOTAL", cantidad);
                    rpt.SetParameterValue("Vuelto", t.Datos.VueltoCliente);
                    rpt.SetParameterValue("Firma", "");
                    break;
                case TipoTransaccion.EntradaPrestamo:
                    rpt.SetParameterValue("CONCEPTO", "Pago préstamo");
                    rpt.SetParameterValue("CANTIDAD", t.Datos.AbonosMXN);
                    rpt.SetParameterValue("Titulo1", "");
                    rpt.SetParameterValue("TC", 0);
                    rpt.SetParameterValue("Titulo2", "Pago con");
                    rpt.SetParameterValue("Pago", t.Datos.PagoCliente);
                   rpt.SetParameterValue("TOTAL", t.Datos.AbonosMXN);
                   rpt.SetParameterValue("Vuelto", t.Datos.VueltoCliente);
                   rpt.SetParameterValue("Firma", "");
                   break;
                case TipoTransaccion.Gasto:
                   rpt.SetParameterValue("CONCEPTO", "Gasto");
                   rpt.SetParameterValue("CANTIDAD", t.Datos.CargosMXN);
                   rpt.SetParameterValue("Titulo1", "");
                   rpt.SetParameterValue("TC", 0);
                   rpt.SetParameterValue("Titulo2", "Pago con");
                   rpt.SetParameterValue("Pago", t.Datos.PagoCliente);
                   rpt.SetParameterValue("TOTAL", t.Datos.CargosMXN);
                   rpt.SetParameterValue("Vuelto", t.Datos.VueltoCliente);
                   rpt.SetParameterValue("Firma", "Recibo");
                   break;
            }
            if (!Properties.Settings.Default.TicketPantalla)
            {
                rpt.PrintOptions.PrinterName = Properties.Settings.Default.Impresora;
                rpt.PrintToPrinter(Properties.Settings.Default.NoCopias, false, 1, 2);
                rpt.Dispose();
                rpt = null;
            }
            else
            {
                frmReporte frm = new frmReporte(rpt);
                //frm.CrViewer1.PrintReport();
                frm.ShowDialog();
                rpt.Dispose();
                rpt = null;
                frm.Dispose();
                frm = null;
            }
        }
开发者ID:fdoaragon,项目名称:SICOB,代码行数:101,代码来源:frmCambio.cs


注:本文中的ReportDocument.Dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。