public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     var rpt = new CR_tomainventario();
     rpt.Site = Site;
     return rpt;
 }
        private void active_tomainventario()
        {
            try
            {
                var path = string.Empty;
                var directorios = Application.StartupPath.Split('\\');
                if (directorios.Length > 0)
                {
                    path = directorios[0] + "\\" + directorios[1];
                }
                var reporteRollokardex = new CR_tomainventario();
                reporteRollokardex.DataDefinition.FormulaFields["empresaname"].Text = "'EMPRESA: " + VariablesPublicas.EmpresaName.Trim() + "'";
                reporteRollokardex.DataDefinition.FormulaFields["empresaruc"].Text = "'RUC: " + VariablesPublicas.EmpresaRuc.Trim() + "'";

                reporteRollokardex.SetDataSource(Lista_tomainventario());
                CrsRptMain.ReportSource = reporteRollokardex;
                CrsRptMain.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void ImpresionTomaInv()
        {
            DataTable tablaReport = new DataTable();
            tb_60local_stockBL BL = new tb_60local_stockBL();
            tb_60local_stock BE = new tb_60local_stock();

            BE.moduloid = VariablesPublicas.Moduloid;
            BE.local = VariablesPublicas.Local;
            BE.lineaid = lineaid.Text.Trim();
            BE.status = chkTodos.Checked ? "1" : "0";

            tablaReport = BL.GetAll_productostock(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0];
            if (tablaReport.Rows.Count == 0)
            {
                MessageBox.Show("No existe Información Procesada", "Mensaje del Sistema", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                Frm_Reportes miForma = new Frm_Reportes();
                REPORTES.CR_tomainventario reporteInventario = new REPORTES.CR_tomainventario();
                miForma.Text = "Toma de Inventario : Linea";
                reporteInventario.DataDefinition.FormulaFields["almacen"].Text = "'" + VariablesPublicas.EmpresaTipo + "'";
                reporteInventario.DataDefinition.FormulaFields["name"].Text = "'TIENDA : " + VariablesPublicas.Local + "  - " + VariablesPublicas.nombrelocal + "'";
                #region -- Commentado
                //reporteInventario.DataDefinition.FormulaFields["empresaname"].Text = "'EMPRESA: " + VariablesPublicas.EmpresaName.Trim() + "'";
                //reporteInventario.DataDefinition.FormulaFields["empresaruc"].Text = "'RUC: " + VariablesPublicas.EmpresaRuc.Trim() + "'";

                //variables que vamos a modificar
                //reporteRollokardex.DataDefinition.FormulaFields["fechdoc"].Text = "'DE: " + fechdocini.Trim().Substring(0, 10) + "  AL:" + fechdocfin.Trim().Substring(0, 10) + "'";

               //reporteInventario.SetDataSource(tablaReport);
               // miForma.Reporte.ReportSource = reporteInventario;

                //reporte.PrintOptions.PrinterName = "EPSON LQ-590 ESC/P2";
                //reporte.PrintOptions.PaperOrientation = CrystalDecisions.Shared.PaperOrientation.Portrait;
                //reporte.PrintOptions.PaperSize = (CrystalDecisions.Shared.PaperSize)GetPaperSize("EPSON LQ-590 ESC/P2", "cretencion");

                //reporte.SetDataSource(tablaReport);
                //reporte.Refresh();
                //reporte.PrintToPrinter(1, false, 0, 0);
                #endregion

                miForma.Table = tablaReport;
                miForma.Reporte = reporteInventario;
                miForma.Show();
            }
        }