예제 #1
0
        private void DisplayReporteTraspaso()
        {
            try
            {
                var movimiento = Datos.GetListOf <MovimientoInventarioView>(m => m.MovimientoInventarioID.Equals(oID));
                var detalle    = Datos.GetListOf <MovimientoInventarioDetalleView>(d => d.MovimientoInventarioID.Equals(oID));

                IEnumerable <MovimientoInventarioView>        movimientoE = movimiento;
                IEnumerable <MovimientoInventarioDetalleView> detalleE    = detalle;

                using (FastReport.Report report = new FastReport.Report())
                {
                    if (detalle.Count < 10)
                    {
                        report.Load(string.Format("{0}{1}", GlobalClass.ConfiguracionGlobal.pathReportes, "ReporteTraspaso.frx"));
                    }
                    else
                    {
                        report.Load(string.Format("{0}{1}", GlobalClass.ConfiguracionGlobal.pathReportes, "ReporteTraspasosMasDeDiez.frx"));
                    }

                    report.RegisterData(movimientoE, "movimiento", 3);
                    report.RegisterData(detalleE, "detalle", 3);
                    report.GetDataSource("movimiento").Enabled = true;
                    report.GetDataSource("detalle").Enabled    = true;
                    report.Show(true);
                }
            }
            catch (Exception ex)
            {
                Util.MensajeError(ex.Message, GlobalClass.NombreApp);
            }
        }
예제 #2
0
        private void DisplayReporteDevolucion()
        {
            try
            {
                var movimiento = Datos.GetListOf <MovimientoInventarioView>(m => m.MovimientoInventarioID.Equals(oID));
                var detalle    = Datos.GetListOf <MovimientoInventarioDetalleView>(d => d.MovimientoInventarioID.Equals(oID));

                IEnumerable <MovimientoInventarioView>        movimientoE = movimiento;
                IEnumerable <MovimientoInventarioDetalleView> detalleE    = detalle;

                using (FastReport.Report report = new FastReport.Report())
                {
                    report.Load(string.Format("{0}{1}", GlobalClass.ConfiguracionGlobal.pathReportes, "ReporteSalidaDevolucion.frx"));
                    report.RegisterData(movimientoE, "movimiento", 3);
                    report.RegisterData(detalleE, "detalle", 3);
                    report.GetDataSource("movimiento").Enabled = true;
                    report.GetDataSource("detalle").Enabled    = true;
                    //report.Show(true);
                    UtilLocal.EnviarReporteASalida("Reportes.DevolucionAProveedor.Salida", report);
                }
            }
            catch (Exception ex)
            {
                Util.MensajeError(ex.Message, GlobalClass.NombreApp);
            }
        }
예제 #3
0
 private void modelTree_AfterNodeSelect(object sender, AdvTreeNodeEventArgs e)
 {
     if (e.Node.Tag is Maticsoft.Model.SMT_VERMODEL_INFO)
     {
         Maticsoft.Model.SMT_VERMODEL_INFO model = e.Node.Tag as Maticsoft.Model.SMT_VERMODEL_INFO;
         if (model != null)
         {
             _lastSelectModel = model;
             ShowModelReportPreview(_lastSelectModel);
         }
     }
     else if (e.Node.Tag is FileInfo)//示例模板
     {
         try
         {
             var      dt = StaffDataHelper.GetTestReportDataTable();
             FileInfo fi = (FileInfo)e.Node.Tag;
             _report.Clear();
             _report.Load(fi.FullName);
             _report.RegisterData(dt, dt.TableName);
             _report.AutoFillDataSet = true;
             _report.Prepare();
             _report.ShowPrepared();
         }
         catch (Exception ex)
         {
             log.Error("预览示例模板异常:", ex);
             WinInfoHelper.ShowInfoWindow(this, "预览示例模板异常:" + ex.Message);
         }
     }
 }
        //getDate
        public ActionResult getReport(string fromDate, string toDate)
        {
            var    site = Session["T_SITE_CODE"].ToString();
            string lang = Session["T_LANG"].ToString();

            DataTable dtInfor   = repository.GetInforData(site, lang);
            DataTable dtDetails = repository.GetDetails(site, fromDate, toDate);

            //DataTable dtUnitInfo = repository.GetR12215CollectedUnit(site, entryDate);

            dtInfor.TableName   = "R12260Infor";
            dtDetails.TableName = "R12260Details";
            // dtUnitInfo.TableName = "R12215UnitInfo";

            DataSet dSet = new DataSet();

            dSet.Tables.Add(dtInfor);
            dSet.Tables.Add(dtDetails);
            // dSet.Tables.Add(dtUnitInfo);


            // dSet.WriteXmlSchema(Server.MapPath("~/Report/xml/R12260.xml"));

            // return View();
            using (var webReport = new FastReport.Report())
            {
                webReport.Report.Load(Server.MapPath("~/Report/Report/R12260.frx"));
                //webReport.Report.Load(Server.MapPath("~/Report/Report/R12260_Test.frx"));
                webReport.RegisterData(dtInfor, "R12260Infor");
                webReport.RegisterData(dtDetails, "R12260Details");
                webReport.Report.SetParameterValue("FromDate", fromDate);
                webReport.Report.SetParameterValue("ToDate", toDate);
                // webReport.RegisterData(dtUnitInfo, "R12215UnitInfo");

                webReport.Report.Prepare();

                using (var report = new MemoryStream())
                {
                    var pdfExport = new PDFExport();
                    webReport.Export(pdfExport, report);

                    Response.ClearContent();
                    Response.ClearHeaders();
                    Response.Buffer      = true;
                    Response.ContentType = "Application/PDF";
                    Response.BinaryWrite(report.ToArray());
                    Response.End();
                }

                ViewBag.ReportR12215 = webReport;
            }

            return(View());
        }
        public ActionResult UNIT_Report_R12219(string entryDate)
        {
            int    site = Convert.ToInt32(Session["T_SITE_CODE"].ToString());
            string lang = Session["T_LANG"].ToString();

            DataTable dtSite     = repository_R12215.GetR12215SiteCode(site, lang);
            DataTable dtSummery  = repository_R12215.GetR12215Summery(entryDate, site, entryDate);
            DataTable dtUnitInfo = repository_R12215.GetR12215CollectedUnit(site, entryDate);

            dtSite.TableName     = "R12215Site";
            dtSummery.TableName  = "R12215Summery";
            dtUnitInfo.TableName = "R12215UnitInfo";

            DataSet dSet = new DataSet();

            dSet.Tables.Add(dtSite);
            dSet.Tables.Add(dtSummery);
            dSet.Tables.Add(dtUnitInfo);


            //dSet.WriteXmlSchema(Server.MapPath("~/Report/xml/R12215.xml"));


            using (var webReport = new FastReport.Report())
            {
                webReport.Report.Load(Server.MapPath("~/Report/Report/R12215.frx"));

                webReport.RegisterData(dtSite, "R12215Site");
                webReport.RegisterData(dtSummery, "R12215Summery");
                webReport.RegisterData(dtUnitInfo, "R12215UnitInfo");

                webReport.Report.Prepare();

                using (var report = new MemoryStream())
                {
                    var pdfExport = new PDFExport();
                    webReport.Export(pdfExport, report);

                    Response.ClearContent();
                    Response.ClearHeaders();
                    Response.Buffer      = true;
                    Response.ContentType = "Application/PDF";
                    Response.BinaryWrite(report.ToArray());
                    Response.End();
                }

                ViewBag.ReportR12215 = webReport;
            }

            return(View());
        }
예제 #6
0
        public static FastReport.Report GetReport(string filePath, DataSet ds)
        {
            rep.RegisterData(ds, "data");

            if (File.Exists(filePath))
            {
                rep.Load(filePath);
            }
            else
            {
                MsgBox.ShowInfoMsg("找不到文件: \r\n" + filePath);
            }

            return(rep);
        }
예제 #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            report1 = new FastReport.Report();
            report1.Load(Path.Combine(@"AltAltaVeriYazma.frx"));


            var kisi     = new Kisi();
            var kisiList = kisi.getKisiList();

            foreach (var data in kisiList)
            {
                var rowadaparsel = dataSet1.Tables["Kisi"].NewRow();

                rowadaparsel["No"]    = data.No;
                rowadaparsel["Ad"]    = data.Ad;
                rowadaparsel["Soyad"] = data.Soyad;
                rowadaparsel["TC"]    = data.TC;
                dataSet1.Tables["Kisi"].Rows.Add(rowadaparsel);
            }

            report1.RegisterData(dataSet1.Tables["Kisi"], "Kisi");
            report1.GetDataSource("Kisi").Enabled = true;
            (report1.Report.FindObject("Data1") as FastReport.DataBand).DataSource = report1.GetDataSource("Kisi");

            report1.Show();
        }
예제 #8
0
파일: FormSF.cs 프로젝트: Arainsd/WGSF
        void PrintSFD(int i_CFID)
        {
            DataSet tmpDs = BLL.ChargeBLL.GetSFDs(i_CFID);

            //
            FastReport.Report report1 = new FastReport.Report();
            report1.Load("Reports\\SFPrint.frx");

            DataSet   FDataSet = new DataSet();
            DataTable table    = new DataTable();

            table           = tmpDs.Tables[0].Copy();
            table.TableName = "ChargeF";
            FDataSet.Tables.Add(table);

            tmpDs           = BLL.ChargeBLL.GetSFChargeDetail(i_CFID);
            table           = tmpDs.Tables[0].Copy();
            table.TableName = "ChargeDetail";
            FDataSet.Tables.Add(table);
            DataRelation dr = new DataRelation("FK_1", FDataSet.Tables["ChargeF"].Columns["CFID"], FDataSet.Tables["ChargeDetail"].Columns["CFID"]);

            FDataSet.Relations.Add(dr);

            report1.RegisterData(FDataSet);
            report1.Show();
            report1.Dispose();
        }
예제 #9
0
        void 入库统计ToolStripMenuItemClick(object sender, EventArgs e)
        {
            //打印非零库存
            FastReport.Report report1 = new FastReport.Report();
            report1.Load("Reports\\IncomeSum.frx");

            DataSet   FDataSet = new DataSet();
            DataTable table    = new DataTable();

            table           = BLL.GoodsTypeBLL.GetAllGoodsType().Tables[0].Copy();
            table.TableName = "GoodsType";
            FDataSet.Tables.Add(table);

            table           = BLL.ReceiptBLL.GetAllReceiptItems().Tables[0].Copy();
            table.TableName = "ReceiptItems";
            FDataSet.Tables.Add(table);
            //report1.SetParameterValue("PeriodNo",sPeriodNo);
            DataRelation dsdr  =  new DataRelation("R1",  FDataSet.Tables["GoodsType"].Columns["GoodsTypeID"],  FDataSet.Tables["ReceiptItems"].Columns["GoodsTypeID"]);   
            FDataSet.Relations.Add(dsdr);   
            CalculateTotal(ref FDataSet);

            report1.RegisterData(FDataSet);
            report1.Show();
            report1.Dispose();
        }
예제 #10
0
        //导出
        void UCReport_ExportEvent(object sender, EventArgs e)
        {
            string fileName = GetDefaultStyleFile();

            // create report instance
            FastReport.Report report = new FastReport.Report();
            if (!string.IsNullOrEmpty(fileName))
            {
                report.Load(fileName);
                report.RegisterData(dt, styleObject);
            }
            else
            {
                Report.FastReportEx reportEx = new Report.FastReportEx();
                reportEx.dicSpanRows = dicSpanRows;
                reportEx.dt          = dt;
                reportEx.styleObject = styleObject;
                reportEx.styleTitle  = styleTitle;
                report = reportEx.DefaultReport();
            }
            if (report == null)
            {
                return;
            }
            report.Prepare();
            PDFExport export = new PDFExport();

            export.Export(report);
            report.Dispose();
        }
예제 #11
0
        //打印
        void UCReport_PrintEvent(object sender, EventArgs e)
        {
            string fileName = GetDefaultStyleFile();

            // create report instance
            FastReport.Report report = new FastReport.Report();
            if (!string.IsNullOrEmpty(fileName))
            {
                report.Load(fileName);
                report.RegisterData(dt, styleObject);
            }
            else
            {
                Report.FastReportEx reportEx = new Report.FastReportEx();
                reportEx.dicSpanRows = dicSpanRows;
                reportEx.dt          = dt;
                reportEx.styleObject = styleObject;
                reportEx.styleTitle  = styleTitle;
                report = reportEx.DefaultReport();
            }
            if (paperSize != null && report.Pages.Count > 0)
            {
                FastReport.ReportPage page = (FastReport.ReportPage)report.Pages[0];
                page.PaperHeight = paperSize.Height;
                page.PaperWidth  = paperSize.Width;
            }
            report.Prepare();
            report.Print();
            report.Dispose();
        }
예제 #12
0
        void Button1Click(object sender, EventArgs e)
        {
            //打印当前显示的库存内容
            FastReport.Report report1 = new FastReport.Report();
            report1.Load("Reports\\Stock.frx");

            DataSet   FDataSet = new DataSet();
            DataTable table    = new DataTable();

            table = ds1.Tables[0].Clone();

            table.TableName = "Stock";
            //dataGridView1.SelectAll();
            foreach (DataGridViewRow dr in dataGridView1.SelectedRows)
            {
                 
                string    tsGoodsID = dr.Cells["GoodsID"].Value.ToString();
                DataRow[] dr1       = ds1.Tables[0].Select("GoodsID = " + tsGoodsID);          //查询
                table.ImportRow(dr1[0]);
            }
            FDataSet.Tables.Add(table);
            report1.SetParameterValue("PeriodNo", sPeriodNo);
            report1.RegisterData(FDataSet);
            report1.Show();
            report1.Dispose();
        }
예제 #13
0
        void ButtonSCClick(object sender, EventArgs e)
        {
            FastReport.Report report1 = new FastReport.Report();
            report1.Load("Reports\\PriceLimit.frx");

            DataSet   FDataSet = new DataSet();
            DataTable table    = new DataTable();

            table           = BLL.GoodsTypeBLL.GetAllGoodsType().Tables[0].Copy();
            table.TableName = "GoodsType";
            FDataSet.Tables.Add(table);

            table           = BLL.RKBLL.GetInStockItems(Convert.ToInt32(comboBoxProject.SelectedValue)).Tables[0].Copy();
            table.TableName = "ReceiptItems";
            FDataSet.Tables.Add(table);

            sProjectName = comboBoxProject.Text;
            report1.SetParameterValue("ProjectName", sProjectName);

            DataRelation dsdr  =  new DataRelation("R1",  FDataSet.Tables["GoodsType"].Columns["GoodsTypeID"],  FDataSet.Tables["ReceiptItems"].Columns["GoodsTypeID"]);   
            FDataSet.Relations.Add(dsdr);   


            report1.RegisterData(FDataSet);

            report1.Show();
            report1.Dispose();
        }
예제 #14
0
 //打印
 void UCReport_PrintEvent(object sender, EventArgs e)
 {
     if (dt == null || dt.Rows.Count == 0)
     {
         MessageBoxEx.Show("请查询出要打印的数据!");
         return;
     }
     string fileName = GetDefaultStyleFile();
     // create report instance
     FastReport.Report report = new FastReport.Report();
     if (!string.IsNullOrEmpty(fileName))
     {
         report.Load(fileName);
         report.RegisterData(dt, styleObject);
     }
     else
     {
         Report.FastReportEx reportEx = new Report.FastReportEx();
         reportEx.dicSpanRows = dicSpanRows;
         reportEx.dt = dt;
         reportEx.styleObject = styleObject;
         reportEx.styleTitle = styleTitle;
         report = reportEx.DefaultReport();
     }
     if (paperSize != null && report.Pages.Count > 0)
     {
         FastReport.ReportPage page = (FastReport.ReportPage)report.Pages[0];
         page.PaperHeight = paperSize.Height;
         page.PaperWidth = paperSize.Width;
     }
     report.Prepare();
     report.Print();
     report.Dispose();
 }
예제 #15
0
        //导出
        void UCReport_ExportEvent(object sender, EventArgs e)
        {
            string fileName = GetDefaultStyleFile();
            // create report instance
            FastReport.Report report = new FastReport.Report();
            if (!string.IsNullOrEmpty(fileName))
            {
                report.Load(fileName);
                report.RegisterData(dt, styleObject);
            }
            else
            {

                Report.FastReportEx reportEx = new Report.FastReportEx();
                reportEx.dicSpanRows = dicSpanRows;
                reportEx.dt = dt;
                reportEx.styleObject = styleObject;
                reportEx.styleTitle = styleTitle;
                report = reportEx.DefaultReport();
            }
            if (report == null)
            {
                return;
            }
            report.Prepare();
            PDFExport export = new PDFExport();
            export.Name = "name";
            export.Title = "title";
            export.Export(report);
            report.Dispose();
        }
예제 #16
0
        private void toolPrint_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(taskid))
            {
                DataSet ds = new DataSet();

                DataTable dtPrint = new SqlServerHelper().GetDataTable("View_GroupInfo", "taskid='" + taskid + "'", "");

                dtPrint.TableName = "用户报装申请表";
                ds.Tables.Add(dtPrint.Copy());
                FastReport.Report report1 = new FastReport.Report();
                try
                {
                    // load the existing report
                    report1.Load(Application.StartupPath + @"\PRINTModel\业扩模板\多用户报装申请表.frx");
                    // register the dataset
                    report1.RegisterData(ds);
                    report1.GetDataSource("用户报装申请表").Enabled = true;
                    // run the report
                    report1.Show();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                finally
                {
                    // free resources used by report
                    report1.Dispose();
                }
            }
        }
예제 #17
0
        private void button1_Click(object sender, EventArgs e)
        {
            DateTime d_rq1 = dateTimePicker1.Value.Date;
            DateTime d_rq2 = dateTimePicker1.Value.AddDays(1).Date;

            var dataList = SqlUtil.Inst.Orders.Where(a => a.date >= d_rq1 && a.date < d_rq2).ToList().Select(a => new {
                no   = a.no,
                date = a.date.ToString("yyyy年MM月dd日"),
                zje  = a.zje.ToString("0.00"),
                yhje = a.yhje.ToString("0.00"),
                ssje = (a.zje - a.yhje).ToString("0.00"),
                zffs = a.zffs
            }).ToList();

            Assembly assembly = Assembly.GetExecutingAssembly();

            //获取指定的资源

            using (Stream stream = assembly.GetManifestResourceStream("DishSysManager.daily_mx.frx"))
            {
                if (stream != null)  //没有找到,GetManifestResourceStream会返回null
                {
                    report.Clear();
                    report.Load(stream);
                    report.RegisterData(dataList, "mx");
                    report.Preview = this.previewControl1;
                    report.Prepare();
                    report.ShowPrepared();
                }
            }
        }
예제 #18
0
        void ButtonPrint1Click(object sender, EventArgs e)
        {
            //打印非零库存
            FastReport.Report report1 = new FastReport.Report();
            report1.Load("Reports\\Stock.frx");

            DataSet   FDataSet = new DataSet();
            DataTable table    = new DataTable();

            table = ds1.Tables[0].Clone();
            DataRow[] drArr = ds1.Tables[0].Select("EndQty <> 0");            //查询
            table.TableName = "Stock";
            for (int i = 0; i < drArr.Length; i++)
            {
                 
                {
                     
                        table.ImportRow(drArr[i]);
                }
            }
            FDataSet.Tables.Add(table);
            report1.SetParameterValue("PeriodNo", sPeriodNo);
            report1.RegisterData(FDataSet);
            report1.Show();
            report1.Dispose();
        }
예제 #19
0
        private void btnImprimir_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.dgvDatos.DataSource == null)
                {
                    return;
                }

                BindingSource bs = (BindingSource)this.dgvDatos.DataSource;
                DataTable     dt = (DataTable)bs.DataSource;

                using (FastReport.Report report = new FastReport.Report())
                {
                    report.Load(string.Format("{0}{1}", GlobalClass.ConfiguracionGlobal.pathReportes, "ReportePartesClasificacionAbc.frx"));
                    report.RegisterData(dt, "PartesClasificacionAbc");
                    report.GetDataSource("PartesClasificacionAbc").Enabled = true;
                    report.Show(true);
                }
            }
            catch (Exception ex)
            {
                Util.MensajeError(ex.Message, GlobalClass.NombreApp);
            }
        }
예제 #20
0
        //选择打印样式
        private void cboPrintStyle_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cboPrintStyle.SelectedItem == null)
            {
                return;
            }
            DataRowView drv = (DataRowView)cboPrintStyle.SelectedItem;
            //样式ID
            string styleID = CommonCtrl.IsNullToString(drv["style_id"]);

            //如果是默认样式,则不用设为默认样式
            btnDefault.Enabled = styleID.Length > 0 && CommonCtrl.IsNullToString(drv["is_default"]) != "1";
            //如果有样式ID,才可以删除
            btnDelete.Enabled = styleID.Length > 0;

            if (dt == null || dt.Rows.Count == 0)
            {
                return;
            }
            string printStyle = CommonCtrl.IsNullToString(cboPrintStyle.SelectedValue);

            FastReport.Report rep;
            //FileTransferOperation fileOperation = new FileTransferOperation();
            ////如果下载出问题,用默认样式
            //if (!fileOperation.DownLoadFile(printStyle, "Report"))
            //{
            //    //LoadDefaultStyle();
            //    reportEx.LoadDefaultStyle(designerReport);
            //}
            //fileOperation.DownFile += new HXCFileTransferCache_Client.DownLoadFileHandler<HXCFileTransferCache_Client.DownLoadFileEventArgs>(fileOperation_DownFile);
            //下载打印样式
            string fileName = FileOperation.DownLoadFileByFile(cboPrintStyle.SelectedValue.ToString(), "Report");

            //如果没找到,则用默认样式
            if (string.IsNullOrEmpty(fileName))
            {
                FastReportEx reportEx = new FastReportEx();
                reportEx.styleObject = styleObject;
                reportEx.dt          = dt;
                reportEx.dicSpanRows = dicSpanRows;
                reportEx.styleTitle  = styleTitle;
                rep = reportEx.DefaultReport();
                if (rep == null)
                {
                    return;
                }
            }
            else
            {
                rep = new FastReport.Report();
                rep.Load(fileName);
                if (dt != null && dt.Rows.Count > 0)
                {
                    rep.RegisterData(dt, styleObject);
                }
            }
            designerReport.Report = rep;
            designerReport.RefreshLayout();
        }
예제 #21
0
        //Print
        private void button1_Click(object sender, EventArgs e)
        {
            errorProvider1.Clear( );
            int  number = 0;
            bool isOk   = true;

            if (int.TryParse(textBox1.Text, out number) == false)
            {
                errorProvider1.SetError(textBox1, "请输入正确的打印数量");
                isOk = false;
            }
            if (texProduct.Tag == null)
            {
                errorProvider1.SetError(texProduct, "品号不可为空");
                isOk = false;
            }
            if (string.IsNullOrEmpty(texProduct.Text))
            {
                errorProvider1.SetError(texProduct, "品名不可为空");
                isOk = false;
            }
            if (string.IsNullOrEmpty(texSpec.Text))
            {
                errorProvider1.SetError(texSpec, "规格不可为空");
                isOk = false;
            }
            if (string.IsNullOrEmpty(textBox3.Text))
            {
                errorProvider1.SetError(textBox3, "型号不可为空");
                isOk = false;
            }
            if (string.IsNullOrEmpty(comboBox1.Text))
            {
                errorProvider1.SetError(comboBox1, "轴号不可为空");
                isOk = false;
            }
            if (isOk == false)
            {
                return;
            }
            numOf( );
            if (Save( ) == false)
            {
                return;
            }
            RDataSet = new DataSet( );

            getDataTable( );
            FastReport.Report report = new FastReport.Report( );
            string            path   = "";

            path = Application.StartupPath;
            //if ( string . IsNullOrEmpty ( texPack . Text ) )
            report.Load(path + "\\PrintBarCode.frx");
            //else
            //report . Load ( path + "\\PrintBarCodeA.frx" );
            report.RegisterData(RDataSet);
            report.Show( );
        }
 private void btn_storage_Click(object sender, EventArgs e)
 {
     try
     {
         FastReport.Report report1 = new FastReport.Report();
         report1.Load("2.frx");
         DataTable dt = new DataTable();
         DataSet   ds = new DataSet();
         dt.Columns.Add("物品名");
         dt.Columns.Add("物品数量");
         dt.Columns.Add("物品代码");
         dt.Columns.Add("物品备注");
         dt.Columns.Add("物品价格");
         dt.Columns.Add("物品类型");
         dt.Columns.Add("物品体积");
         dt.Columns.Add("物品重量");
         dt.Columns.Add("仓库名称");
         dt.Columns.Add("客户名称");
         dt.Columns.Add("物品规格");
         dt.Columns.Add("入库方式");
         dt.Columns.Add("生产日期");
         dt.Columns.Add("到期日期");
         dt.Columns.Add("批号");
         dt.Columns.Add("清单备注");
         dt.Columns.Add("操作人员");
         dt.Rows.Add();
         dt.Rows[0][0]  = gm.Goods_name;
         dt.Rows[0][1]  = bm.Goods_amount;
         dt.Rows[0][2]  = gm.Goods_code;
         dt.Rows[0][3]  = gm.Goods_note;
         dt.Rows[0][4]  = bm.Goods_price;
         dt.Rows[0][5]  = gtm.Goods_type;
         dt.Rows[0][6]  = gm.Goods_volume;
         dt.Rows[0][7]  = gm.Goods_wight;
         dt.Rows[0][8]  = wnm.Warehouse_name;
         dt.Rows[0][9]  = cm.Client_name;
         dt.Rows[0][10] = gm.Specifications;
         dt.Rows[0][11] = otm.Operation_type;
         dt.Rows[0][12] = bm.Expiration_date;
         dt.Rows[0][13] = bm.Manufacture_date;
         dt.Rows[0][14] = bm.Lot_number;
         dt.Rows[0][15] = bm.Bill_note;
         dt.Rows[0][16] = mm.Manager_name;
         ds.Tables.Add(dt);
         dt.TableName = "putreport";
         report1.RegisterData(ds);
         report1.GetDataSource("putreport").Enabled = true;
         report1.Show();
         //report1.Design();
         //report1.Prepare();
         //report1.ShowPrepared();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
예제 #23
0
        /// <summary>
        /// FastReports
        /// </summary>
        /// <param name="isDesign"></param>
        private void FastReports(bool isDesign)
        {
            System.Data.DataSet printDataDs = new System.Data.DataSet();
            try
            {
                int[]   rownumber = this.gridViewMainData.GetSelectedRows();
                DataRow row       = this.gridViewMainData.GetDataRow(rownumber[0]);
                System.Data.DataTable mainData    = ToDataTable(row);
                System.Data.DataTable detailsData = ((DataView)this.gridViewDetailsData.DataSource).ToTable();
                if (mainData != null && mainData.Rows.Count > 0)
                {
                    mainData.TableName = "mainData";
                    printDataDs.Tables.Add(mainData.Copy());
                }
                if (detailsData != null && detailsData.Rows.Count > 0)
                {
                    detailsData.TableName = "detailsData";
                    printDataDs.Tables.Add(detailsData.Copy());
                }
                FastReport.Report report = new FastReport.Report();
                Res.LocaleFolder = AppDomain.CurrentDomain.BaseDirectory + "FastReports\\Localization";
                Res.LoadLocale(Res.LocaleFolder + @"\Chinese (Simplified).frl");
                string FDataTables = "FDataTables";
                string filename    = @"FastReports\Reports\fx_001.frx";
                report.Load(filename);

                using (Designer designer = new Designer())
                {
                    designer.SetModified(this, "EditData");
                    int i = 0;
                    foreach (DataTable dt in printDataDs.Tables)
                    {
                        FDataTables = "FDataTables" + i.ToString();
                        printDataDs.Tables[i].TableName = FDataTables;
                        report.RegisterData(printDataDs.Tables[i], FDataTables);
                        report.GetDataSource(FDataTables).Enabled = true;
                        i = i + 1;
                    }
                    Res.LocaleFolder = AppDomain.CurrentDomain.BaseDirectory + "FastReports\\Localization";
                    Res.LoadLocale(Res.LocaleFolder + @"\Chinese (Simplified).frl");
                    if (isDesign)
                    {
                        report.Design();
                    }
                    else
                    {
                        report.SetParameterValue("time", DateTime.Now.Date.ToString("yyyy-MM-dd"));
                        report.Prepare();
                        report.ShowPrepared();
                    }
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }
예제 #24
0
        public static void GenereteReport(ReportParams reportParams)
        {
            if (reportParams == null)
            {
                throw new ArgumentNullException($"{nameof(reportParams)} cannot be null.");
            }

            // create report instance
            using (FastReport.Report report = new FastReport.Report())
            {
                // load the existing report
                report.Load(reportParams.FrxPath);

                // register datasource's
                if (reportParams.DataSource != null)
                {
                    foreach (var pair in reportParams.DataSource)
                    {
                        report.RegisterData(pair.Value, pair.Key);
                    }
                }

                if (reportParams.Parameters != null)
                {
                    foreach (var pair in reportParams.Parameters)
                    {
                        report.SetParameterValue(pair.Key, pair.Value);
                    }
                }

                // prepare the report
                report.Prepare();

                ExportBase export = null;
                switch (reportParams.OutputType)
                {
                case 0:     // export to html
                    export = new HTMLExport();
                    (export as HTMLExport).Format = HTMLExportFormat.HTML;
                    break;

                case 1:
                    export = new ImageExport();
                    (export as ImageExport).ImageFormat = ImageExportFormat.Png;
                    break;

                default:
                    throw new ArgumentException($"O parametro {reportParams.OutputType} é inválido");
                }

                report.Export(export, reportParams.OutStream);
            }

            reportParams.OutStream.Position = 0;
        }
예제 #25
0
        public static void PrintCredit(CreditViewModel model, ServiceClient repository)
        {
            ReportDataSet dsRep = new ReportDataSet();

            ReportDataSet.CreditDTRow dsCreditDtRowRow = dsRep.CreditDT.NewCreditDTRow();
            dsCreditDtRowRow.Fio       = model.UserName;
            dsCreditDtRowRow.Data      = model.DataStart;
            dsCreditDtRowRow.SummaFull = model.SummaFull.ToString();
            dsCreditDtRowRow.Stavka    = model.Stavka.ToString();
            dsCreditDtRowRow.TermMonth = model.TermMonth.ToString();
            dsCreditDtRowRow.IdCredit  = model.Id.ToString();

            dsRep.CreditDT.Rows.Add(dsCreditDtRowRow);

            List <Payment> payments = repository.GetPaymentsByIdCredit(model.Id).ToList();

            foreach (var item in payments)
            {
                ReportDataSet.PaymentDTRow dsPaymentDtRow = dsRep.PaymentDT.NewPaymentDTRow();
                dsPaymentDtRow.IdCredit    = model.Id.ToString();
                dsPaymentDtRow.NumberMonth = item.NumberMonth.ToString();
                dsPaymentDtRow.Data        = item.Data;
                dsPaymentDtRow.LostSumma   = item.LostSumma.ToString();
                dsPaymentDtRow.MainPay     = item.MainPay.ToString();
                dsPaymentDtRow.Percent     = item.Percent.ToString();
                dsPaymentDtRow.SummaMonth  = item.SummaMonth.ToString();
                dsRep.PaymentDT.Rows.Add(dsPaymentDtRow);
            }

            using (FastReport.Report report = new FastReport.Report())
            {
                report.StoreInResources = true;
                report.Load("Report\\CreditReport.frx");

                report.RegisterData((DataTable)dsRep.CreditDT, "CreditInfoList");
                report.GetDataSource("CreditInfoList").Enabled = true;
                report.RegisterData((DataTable)dsRep.PaymentDT, "PaymentList");
                report.GetDataSource("PaymentList").Enabled = true;
                //report.Design();
                report.Show();
            }
        }
예제 #26
0
        public FormReportCP(string ord_no)
        {
            InitializeComponent();
            var order = SqlUtil.Inst.Orders.FirstOrDefault(a => a.no == ord_no);

            if (order == null)
            {
                return;
            }
            var          dataList  = SqlUtil.Inst.Details.Where(a => a.ord_no == order.no).ToList();
            Assembly     assembly  = Assembly.GetExecutingAssembly();
            List <Order> dataList2 = new List <Order>();

            dataList2.Add(order);
            var hz = dataList2.Select(a => new
            {
                date = a.date.ToString("yyyy-MM-dd HH:mm"),
                zje  = a.zje.ToString("0.00"),
                yhje = a.yhje.ToString("0.00"),
                sfje = (a.zje - a.yhje).ToString("0.00"),
                a.desk,
                ord_no = a.no
            }).ToList();

            //获取指定的资源

            using (Stream stream = assembly.GetManifestResourceStream("DishSysManager.daily_cp.frx"))
            {
                if (stream != null)  //没有找到,GetManifestResourceStream会返回null
                {
                    report.Clear();
                    report.Load(stream);
                    report.RegisterData(dataList, "mx");
                    report.RegisterData(hz, "hz");
                    report.Prepare();
                    report.PrintSettings.ShowDialog = false;
                    report.Print();
                }
            }
            autoClose = true;
        }
        public override void ImprimirEnOtroFormato()
        {
            string nombreArchivo = "";
            string logoEmpresa   = "";
            Bitmap imgLogo;
            double monto = 0;

            try
            {
                nombreArchivo = Environment.CurrentDirectory + @"\Reportes\cajaReciboOtros.frx";
                monto         = objUtil.GetAsDouble("Monto", DTVistaData.Rows[0]);
                montoLetras   = Numalet.ToCardinal(monto);

                using (FastReport.Report report = new FastReport.Report())
                {
                    report.Load(nombreArchivo);
                    report.RegisterData(DTVistaData, "VCAJAS_RECIBOS");
                    report.RegisterData(DTOficina, "VEMPRESAS_OFICINAS");

                    report.SetParameterValue("MONTO_LETRA", montoLetras);

                    //Vamos a asignar el logo
                    logoEmpresa = Environment.CurrentDirectory + @"\images\logo.png";

                    if (File.Exists(logoEmpresa))
                    {
                        imgLogo = (Bitmap)Image.FromFile(logoEmpresa);
                        FastReport.PictureObject ptLogo = report.FindObject("ptLogo") as FastReport.PictureObject;
                        ptLogo.Image = imgLogo;
                    }

                    report.PrintSettings.ShowDialog = false;
                    report.PrintSettings.Printer    = impresoraDefault;
                    report.Print();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #28
0
        private void DisplayReporteEtiquetas()
        {
            try
            {
                var movimientoEtiquetas = Datos.GetListOf <MovimientoInventarioEtiquetasView>(l => l.MovimientoInventarioID.Equals(oID));
                var listaEtiquetas      = new List <Etiquetas>();

                var cont = 0;
                foreach (var etiqueta in movimientoEtiquetas)
                {
                    for (var x = 0; x < etiqueta.NumeroEtiquetas; x++)
                    {
                        cont += 1;

                        var e = new Etiquetas()
                        {
                            MovimientoInventarioEtiquetaID = cont,
                            MovimientoInventarioID         = oID,
                            ParteID         = etiqueta.ParteID,
                            sParteID        = etiqueta.ParteID.ToString("D8"),
                            NumeroParte     = etiqueta.NumeroParte,
                            CodigoBarra     = etiqueta.CodigoBarra,
                            NumeroEtiquetas = 1,
                            NombreParte     = etiqueta.NombreParte
                                              //NombreParte = etiqueta.ParteID.ToString("D8")
                        };
                        listaEtiquetas.Add(e);
                    }
                }

                // Se obtiene el folio de la factura, para mandarlo al reporte
                var oMov = Datos.GetEntity <MovimientoInventario>(c => c.MovimientoInventarioID == oID);

                IEnumerable <Etiquetas> detalleE = listaEtiquetas;
                using (FastReport.Report report = new FastReport.Report())
                {
                    report.Load(string.Format("{0}{1}", GlobalClass.ConfiguracionGlobal.pathReportes, "ReporteEtiquetas.frx"));
                    report.RegisterData(detalleE, "etiquetas", 3);
                    report.SetParameterValue("FolioFactura", oMov.FolioFactura);
                    report.GetDataSource("etiquetas").Enabled = true;
                    report.Show(true);
                    //report.Design(true);
                }
            }
            catch (Exception ex)
            {
                Util.MensajeError(ex.Message, GlobalClass.NombreApp);
            }
        }
예제 #29
0
파일: FormHisSF.cs 프로젝트: Arainsd/WGSF
        void ButtonPrintClick(object sender, EventArgs e)
        {
            string s_CFIDs = "";

            foreach (DataGridViewRow drs in dataGridView1.SelectedRows)
            {
                s_CFIDs += drs.Cells["CFID"].Value.ToString();
                s_CFIDs += ",";
            }

            if (s_CFIDs != "")
            {
                s_CFIDs = s_CFIDs.Substring(0, s_CFIDs.Length - 1);
                s_CFIDs = "(" + s_CFIDs + ")";
            }
            else
            {
                s_CFIDs = "(0)";
            }

            DataSet tmpDs = BLL.ChargeBLL.GetSFDs(s_CFIDs);

            //
            FastReport.Report report1 = new FastReport.Report();
            report1.Load("Reports\\SFPrint.frx");

            DataSet   FDataSet = new DataSet();
            DataTable table    = new DataTable();

            table           = tmpDs.Tables[0].Copy();
            table.TableName = "ChargeF";
            FDataSet.Tables.Add(table);

            tmpDs = BLL.ChargeBLL.GetSFChargeDetail(s_CFIDs);
            if (ds2.Tables.Count == 0)
            {
                return;
            }
            table           = tmpDs.Tables[0].Copy();
            table.TableName = "ChargeDetail";
            FDataSet.Tables.Add(table);
            DataRelation dr = new DataRelation("FK_1", FDataSet.Tables["ChargeF"].Columns["CFID"], FDataSet.Tables["ChargeDetail"].Columns["CFID"]);

            FDataSet.Relations.Add(dr);

            report1.RegisterData(FDataSet);
            report1.Show();
            report1.Dispose();
        }
예제 #30
0
        //导出到Excel
        void OutPutExcel(DataGridView dgv, string name)
        {
            FastReport.Report report1 = new FastReport.Report();
            report1.Load("Reports\\GoodsList1.frx");

            DataSet   FDataSet = new DataSet();
            DataTable table    = new DataTable();

            table           = ds1.Tables[0].Copy();
            table.TableName = "Goods";
            FDataSet.Tables.Add(table);
            report1.RegisterData(FDataSet);
            report1.Show();
            report1.Dispose();
        }
예제 #31
0
 protected static void SetParameters <T, H>(T entity, IList <H> details, FastReport.Report report, string dataSourceName)
 {
     System.Reflection.PropertyInfo[] properties = entity.GetType().GetProperties();
     foreach (System.Reflection.PropertyInfo info in properties)
     {
         string name  = info.Name;
         object value = info.GetValue(entity, null);
         if (report.Parameters.FindByName(name) != null)
         {
             report.SetParameterValue(name, value);
         }
     }
     System.Data.DataTable dt = Utility.JsonUtil.ToDataTable <H>(details);
     report.RegisterData(dt, dataSourceName);
 }
예제 #32
0
        void ButtonPrintClick(object sender, EventArgs e)
        {
            if (dataGridView1.CurrentRow == null)
            {
                return;
            }



            DataSet   tmpDs    = new DataSet();
            DataSet   FDataSet = new DataSet();
            DataTable table    = new DataTable();


            int     i_CompanyID      = Convert.ToInt32(comboBoxProjectCompany.SelectedValue);
            int     i_ProjectID      = Convert.ToInt32(comboBoxProject.SelectedValue);
            string  s_StatementCycle = dataGridView1.CurrentRow.Cells["StatementCycle"].Value.ToString();;
            LeaseHT tLeaseHT         = BLL.LeaseBLL.GetLeaseHT(i_ProjectID, i_CompanyID);

            tmpDs           = BLL.LeaseBLL.GetLeaseAccountDs(i_ProjectID, i_CompanyID, s_StatementCycle);
            table           = tmpDs.Tables[0].Copy();
            table.TableName = "LeaseAccount";
            FDataSet.Tables.Add(table);

            int i_BillID = 0;

            foreach (DataRow drtmp in table.Rows)
            {
                i_BillID = Convert.ToInt32(drtmp["BillID"]);
            }

            tmpDs           = BLL.LeaseBLL.GetLeaseAccountList(i_BillID);
            table           = tmpDs.Tables[0].Copy();
            table.TableName = "LeaseAccountList";
            FDataSet.Tables.Add(table);

            tmpDs           = BLL.LeaseBLL.GetLeaseAccountList(0, i_BillID);
            table           = tmpDs.Tables[0].Copy();
            table.TableName = "LeaseAccountLeft";
            FDataSet.Tables.Add(table);
            //将需要结算的数据填写到报表中的表中

            FastReport.Report report1 = new FastReport.Report();
            report1.Load("Reports\\LeaseHisJS.frx");
            report1.RegisterData(FDataSet);
            report1.Show();
            report1.Dispose();
        }
예제 #33
0
 /// <summary>
 /// 明细设计
 /// </summary>
 /// <param name="dic"></param>
 public void DetailDesigner(Dictionary<string, DataTable> dic)
 {
     if (dic == null)
     {
         return;
     }
     FastReport.Report report = new FastReport.Report();
     foreach (string key in dic.Keys)
     {
         report.RegisterData(dic[key], key);
     }
     //report.Show();
     report.Design();
     report.Dispose();
     dic = null;
 }
예제 #34
0
파일: PDFTest.cs 프로젝트: meimeic/XYS
        private string GenderPDF(string model, DataSet ds)
        {
            FastReport.Report report = new FastReport.Report();
            report.Load(model);
            report.RegisterData(ds);

            report.Prepare();
            //report.PreparePhase1();
            //report.PreparePhase2();

            //初始化输出类
            PDFExport export = new PDFExport();
            //输出
            string path = "E:\\lis\\temp.pdf";
            export.Export(report, path);

            return path;
        }
예제 #35
0
 /// <summary>
 /// 生成明细报表
 /// </summary>
 /// <param name="dt">打印数据</param>
 /// <returns></returns>
 public FastReport.Report GetDetailReport(Dictionary<string, DataTable> dic)
 {
     if (!Directory.Exists("BusinessPrint"))
     {
         Directory.CreateDirectory("BusinessPrint");
     }
     
     FastReport.Report report = new FastReport.Report();
     foreach (string key in dic.Keys)
     {
         report.RegisterData(dic[key], key);
     }
     if (File.Exists(reportFileName))
     {
         report.Load(reportFileName);
     }
     report.DoublePass = true;//双通道,只有这样才能显示总页数
     return report;
 }
예제 #36
0
        public static void getReport(string SQL, string AliasName, string FolderName, string FileName)
        {
            FastReport.Report report = new FastReport.Report();
            try
            {
                if (Function.FTPDownload(@"C:\Report/" + FolderName, FolderName, FileName))
                {
                    DataTable dt = Services.Database.ExecuteQuery(SQL).Tables[0];

                    report.RegisterData(dt, AliasName);
                    report.GetDataSource(AliasName).Enabled = true;
                    report.Load(@"C:\Report/" + FolderName + "/" + FileName);
                    report.Show();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Дараахи алдаа гарлаа. " + ex.Message.ToString(), "Алдаа", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                report.Dispose();
            }
        }
예제 #37
0
        private void btnImprimir_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.dgvDatos.DataSource == null)
                    return;

                BindingSource bs = (BindingSource)this.dgvDatos.DataSource;
                DataTable dt = (DataTable)bs.DataSource;

                using (FastReport.Report report = new FastReport.Report())
                {
                    report.Load(string.Format("{0}{1}", GlobalClass.ConfiguracionGlobal.pathReportes, "ReportePartesClasificacionAbc.frx"));
                    report.RegisterData(dt, "PartesClasificacionAbc");
                    report.GetDataSource("PartesClasificacionAbc").Enabled = true;
                    report.Show(true);
                }
            }
            catch (Exception ex)
            {
                Util.MensajeError(ex.Message, GlobalClass.NombreApp);
            }
        }
예제 #38
0
        private void DisplayReporteEtiquetas()
        {
            try
            {
                var movimientoEtiquetas = Datos.GetListOf<MovimientoInventarioEtiquetasView>(l => l.MovimientoInventarioID.Equals(oID));
                var listaEtiquetas = new List<Etiquetas>();

                var cont = 0;
                foreach (var etiqueta in movimientoEtiquetas)
                {
                    for (var x = 0; x < etiqueta.NumeroEtiquetas; x++)
                    {
                        cont += 1;
                        var e = new Etiquetas()
                        {
                            MovimientoInventarioEtiquetaID = cont,
                            MovimientoInventarioID = oID,
                            ParteID = etiqueta.ParteID,
                            NumeroParte = etiqueta.NumeroParte,
                            CodigoBarra = etiqueta.CodigoBarra,
                            NumeroEtiquetas = 1,
                            NombreParte = etiqueta.NombreParte
                        };
                        listaEtiquetas.Add(e);
                    }
                }

                // Se obtiene el folio de la factura, para mandarlo al reporte
                var oMov = Datos.GetEntity<MovimientoInventario>(c => c.MovimientoInventarioID == oID);

                IEnumerable<Etiquetas> detalleE = listaEtiquetas;
                using (FastReport.Report report = new FastReport.Report())
                {
                    report.Load(string.Format("{0}{1}", GlobalClass.ConfiguracionGlobal.pathReportes, "ReporteEtiquetas.frx"));
                    report.RegisterData(detalleE, "etiquetas", 3);
                    report.SetParameterValue("FolioFactura", oMov.FolioFactura);
                    report.GetDataSource("etiquetas").Enabled = true;
                    report.Show(true);
                    //report.Design(true);
                }

            }
            catch (Exception ex)
            {
                Util.MensajeError(ex.Message, GlobalClass.NombreApp);
            }
        }
예제 #39
0
        private void DisplayReporteEntradaCompra()
        {
            try
            {
                var movimiento = Datos.GetListOf<MovimientoInventarioView>(m => m.MovimientoInventarioID.Equals(oID));
                var detalle = Datos.GetListOf<MovimientoInventarioDetalleView>(d => d.MovimientoInventarioID.Equals(oID));

                var detalleDescuentosGen = new List<MovimientoInventarioDescuentoView>();
                var detalleDescuentosGenerales = Datos.GetListOf<MovimientoInventarioDescuentoView>(m => m.MovimientoInventarioID.Equals(oID)
                    && (m.TipoDescuentoID.Equals(1) || m.TipoDescuentoID.Equals(4) || m.TipoDescuentoID.Equals(2) || m.TipoDescuentoID.Equals(5)));

                bool uno = false;
                bool cuatro = false;
                bool dos = false;
                bool cinco = false;
                foreach (var descuentoGen in detalleDescuentosGenerales)
                {
                    if (descuentoGen.TipoDescuentoID.Equals(1) && uno.Equals(false))
                    {
                        uno = true;
                        detalleDescuentosGen.Add(descuentoGen);
                    }
                    if (descuentoGen.TipoDescuentoID.Equals(4) && cuatro.Equals(false))
                    {
                        cuatro = true;
                        detalleDescuentosGen.Add(descuentoGen);
                    }
                    if (descuentoGen.TipoDescuentoID.Equals(2) && dos.Equals(false))
                    {
                        dos = true;
                        detalleDescuentosGen.Add(descuentoGen);
                    }
                    if (descuentoGen.TipoDescuentoID.Equals(5) && cinco.Equals(false))
                    {
                        cinco = true;
                        detalleDescuentosGen.Add(descuentoGen);
                    }
                }

                var detalleDescuentosInd = Datos.GetListOf<MovimientoInventarioDescuentoView>(m => m.MovimientoInventarioID.Equals(oID)
                    && m.TipoDescuentoID.Equals(3));

                foreach (var descuentoGen in detalleDescuentosInd)
                {
                    detalleDescuentosGen.Add(descuentoGen);
                }

                IEnumerable<MovimientoInventarioView> movimientoE = movimiento;
                IEnumerable<MovimientoInventarioDetalleView> detalleE = detalle;
                IEnumerable<MovimientoInventarioDescuentoView> descuentosGen = detalleDescuentosGen;
                //IEnumerable<MovimientoInventarioDescuentoView> descuentosInd = detalleDescuentosInd;

                using (FastReport.Report report = new FastReport.Report())
                {
                    report.Load(string.Format("{0}{1}", GlobalClass.ConfiguracionGlobal.pathReportes, "ReporteEntradaCompra.frx"));
                    report.RegisterData(movimientoE, "movimiento", 3);
                    report.RegisterData(detalleE, "detalle", 3);
                    report.RegisterData(descuentosGen, "descuentosGenerales", 3);
                    //report.RegisterData(descuentosInd, "descuentosIndividuales", 3);
                    report.GetDataSource("movimiento").Enabled = true;
                    report.GetDataSource("detalle").Enabled = true;
                    report.GetDataSource("descuentosGenerales").Enabled = true;
                    //report.GetDataSource("descuentosIndividuales").Enabled = true;
                    report.Show(true);
                }

            }
            catch (Exception ex)
            {
                Util.MensajeError(ex.Message, GlobalClass.NombreApp);
            }
        }
예제 #40
0
        private void DisplayReporteTraspaso()
        {
            try
            {
                var movimiento = Datos.GetListOf<MovimientoInventarioView>(m => m.MovimientoInventarioID.Equals(oID));
                var detalle = Datos.GetListOf<MovimientoInventarioDetalleView>(d => d.MovimientoInventarioID.Equals(oID));

                IEnumerable<MovimientoInventarioView> movimientoE = movimiento;
                IEnumerable<MovimientoInventarioDetalleView> detalleE = detalle;

                using (FastReport.Report report = new FastReport.Report())
                {
                    if (detalle.Count < 10)
                        report.Load(string.Format("{0}{1}", GlobalClass.ConfiguracionGlobal.pathReportes, "ReporteTraspaso.frx"));
                    else
                        report.Load(string.Format("{0}{1}", GlobalClass.ConfiguracionGlobal.pathReportes, "ReporteTraspasosMasDeDiez.frx"));

                    report.RegisterData(movimientoE, "movimiento", 3);
                    report.RegisterData(detalleE, "detalle", 3);
                    report.GetDataSource("movimiento").Enabled = true;
                    report.GetDataSource("detalle").Enabled = true;
                    report.Show(true);
                }
            }
            catch (Exception ex)
            {
                Util.MensajeError(ex.Message, GlobalClass.NombreApp);
            }
        }
예제 #41
0
파일: Master.cs 프로젝트: moisesiq/aupaga
        private void ImprimirEtiquetas(string sReporte)
        {
            // Se muestra progreso de avance
            this.IniciarTerminarProgreso(true);

            // Se inicia el proceso de impresión
            Datos.StartPersistentContext();
            foreach (DataGridViewRow oFila in this.dgvDatos.Rows)
            {
                this.pgrGuardar.EjecutarPaso(true);
                if (!Util.Logico(oFila.Cells["Procesar"].Value)) continue;

                int iParteID = Util.Entero(oFila.Cells["ParteID"].Value);
                var oParte = Datos.GetEntity<Parte>(c => c.ParteID == iParteID && c.Estatus);
                var oEtiqueta = new Etiquetas()
                {
                    ParteID = iParteID,
                    NumeroParte = oParte.NumeroParte,
                    NombreParte = oParte.NombreParte,
                    CodigoBarra = oParte.CodigoBarra
                };

                // Se manda imprimir el reporte
                var oRep = new FastReport.Report();
                oRep.Load(sReporte);
                oRep.RegisterData(new List<Etiquetas>() { oEtiqueta }, "etiquetas");
                oRep.Print();
            }
            Datos.EndPersistentContext();

            this.IniciarTerminarProgreso(false);
            UtilLocal.MostrarNotificacion("Proceso completado correctamente.");
        }
예제 #42
0
        private void btnImprimirSugerido_Click(object sender, EventArgs e)
        {
            try
            {
                // if (this.dgvSugeridos.DataSource == null) return;
                if (this.tabPedidos.SelectedIndex != 0) return;

                /*
                DataTable t = new DataTable();
                DataTable dt = new DataTable();

                BindingSource bs = (BindingSource)this.dgvSugeridos.DataSource;
                if (string.IsNullOrEmpty(bs.Filter))
                {
                    dt = (DataTable)bs.DataSource;
                    t = dt.AsEnumerable().Where(x => x.Field<Boolean>("Sel") && x.Field<decimal>("Pedido") > 0).CopyToDataTable();
                }
                else
                {
                    DataView dv = (DataView)bs.List;
                    dt = dv.ToTable();
                    t = dt.AsEnumerable().Where(x => x.Field<Boolean>("Sel") && x.Field<decimal>("Pedido") > 0).CopyToDataTable();
                }
                */

                // Se quitan los que no estén seleccionados y los que no tengan pedido
                var oPartes = new List<pauPedidosSugeridos_Res>();
                foreach (DataGridViewRow oFila in this.dgvSugeridos.Rows)
                {
                    if (!oFila.Visible || !Util.Logico(oFila.Cells["sug_Sel"].Value) || Util.Decimal(oFila.Cells["sug_Pedido"].Value) <= 0)
                        continue;
                    oPartes.Add(new pauPedidosSugeridos_Res()
                    {
                        ParteID = Util.Entero(oFila.Cells["sug_ParteID"].Value),
                        NumeroParte = Util.Cadena(oFila.Cells["sug_NumeroDeParte"].Value),
                        NombreParte = Util.Cadena(oFila.Cells["sug_Descripcion"].Value),
                        UnidadEmpaque = Util.Decimal(oFila.Cells["sug_UnidadDeEmpaque"].Value),
                        CriterioABC = Util.Cadena(oFila.Cells["sug_AbcDeVentas"].Value),
                        NecesidadMatriz = Util.Decimal(oFila.Cells["sug_NecesidadMatriz"].Value),
                        NecesidadSuc02 = Util.Decimal(oFila.Cells["sug_NecesidadSuc02"].Value),
                        NecesidadSuc03 = Util.Decimal(oFila.Cells["sug_NecesidadSuc03"].Value),
                        Total = Util.Decimal(oFila.Cells["sug_Total"].Value),
                        Pedido = Util.Decimal(oFila.Cells["sug_Pedido"].Value),
                        CostoConDescuento = Util.Decimal(oFila.Cells["sug_CostoConDescuento"].Value),
                        Costo = Util.Decimal(oFila.Cells["sug_CostoTotal"].Value),
                        Observacion = Util.Cadena(oFila.Cells["sug_Observacion"].Value),
                    });
                }

                var oRep = new FastReport.Report();
                oRep.Load(string.Format("{0}{1}", GlobalClass.ConfiguracionGlobal.pathReportes, "ReportePedidosSugeridos.frx"));
                oRep.RegisterData(oPartes, "PartesSugeridas");
                oRep.SetParameterValue("Proveedor", this.dgvProveedores.CurrentRow.Cells["pro_Proveedor"].Value);
                oRep.SetParameterValue("Usuario", GlobalClass.UsuarioGlobal.NombreUsuario);
                // oRep.GetDataSource("PartesSugeridas").Enabled = true;
                UtilLocal.EnviarReporteASalida("Reportes.Pedidos.Pedido", oRep);
            }
            catch (Exception ex)
            {
                Util.MensajeError(ex.Message, GlobalClass.NombreApp);
            }
        }
예제 #43
0
        private void btnProcesar_Click(object sender, EventArgs e)
        {
            try
            {
                this.tabPedidos.SelectedIndex = 0; ;
                if (this.dgvProveedores.CurrentRow == null)
                {
                    Util.MensajeError("Debe seleccionar a un Proveedor.", GlobalClass.NombreApp);
                    return;
                }

                // Se valida que haya al menos una parte seleccionada
                bool bError = true;
                foreach (DataGridViewRow oFila in this.dgvSugeridos.Rows)
                {
                    if (Util.Logico(oFila.Cells["sug_Sel"].Value))
                    {
                        bError = false;
                        break;
                    }
                }
                // if (this.dgvSugeridos.DataSource == null)
                if (bError)
                {
                    Util.MensajeError("Debe seleccionar al menos un número de parte.", GlobalClass.NombreApp);
                    return;
                }

                var proveedorId = Util.Entero(this.dgvProveedores.CurrentRow.Cells["pro_ProveedorID"].Value);
                var proveedor = Datos.GetEntity<Proveedor>(p => p.ProveedorID == proveedorId);
                if (proveedor != null)
                {
                    var msj = string.Format("{0} {1} {2}", "¿Está seguro de que la información del Pedido es correcta?", "Para el Proveedor:", proveedor.NombreProveedor);
                    var res = Util.MensajePregunta(msj, GlobalClass.NombreApp);
                    if (res == DialogResult.No)
                        return;
                }
                else
                {
                    Util.MensajeError("Proveedor Inválido.", GlobalClass.NombreApp);
                    return;
                }

                this.Cursor = Cursors.WaitCursor;
                SplashScreen.Show(new Splash());
                this.btnProcesar.Enabled = false;

                var pedido = new Pedido()
                {
                    ProveedorID = proveedorId,
                    ImporteTotal = Util.Decimal(this.txtImporteTotal.Text.SoloNumeric()),
                    PedidoEstatusID = 2
                };

                Datos.Guardar<Pedido>(pedido);

                if (pedido.PedidoID <= 0)
                {
                    this.Cursor = Cursors.Default;
                    SplashScreen.Close();
                    Util.MensajeError("Ocurrio un error al guardar el Pedido.", GlobalClass.NombreApp);
                    this.btnProcesar.Enabled = true;
                    return;
                }

                // DataTable dt = new DataTable();
                // BindingSource bs = (BindingSource)this.dgvSugeridos.DataSource;

                //Validación, debe estar seleccionado y el pedido debe ser mayor a 0
                /* if (!string.IsNullOrEmpty(bs.Filter))
                {
                    DataView dv = (DataView)bs.List;
                    dt = dv.ToTable().AsEnumerable().Where(x => x.Field<Boolean>("Sel") && x.Field<decimal>("Pedido") > 0).CopyToDataTable();
                } */

                foreach (DataGridViewRow oFila in this.dgvSugeridos.Rows)
                {
                    if (!oFila.Visible) continue;

                    int iParteID = Util.Entero(oFila.Cells["sug_ParteID"].Value);

                    // Se verifica si no se debe pedir por existencia en equivalentes
                    var oNoPedir = Datos.GetEntity<ParteCaracteristicaTemporal>(c => c.ParteID == iParteID
                        && c.Caracteristica == Cat.CaracTempPartes.NoPedidosPorEquivalentes);
                    if (Util.Cadena(oFila.Cells["sug_Caracteristica"].Value) == "NP")
                    {
                        if (oNoPedir == null)
                        {
                            oNoPedir = new ParteCaracteristicaTemporal()
                            {
                                ParteID = iParteID,
                                Caracteristica = Cat.CaracTempPartes.NoPedidosPorEquivalentes
                            };
                            Datos.Guardar<ParteCaracteristicaTemporal>(oNoPedir);
                        }
                    }
                    else
                    {
                        if (oNoPedir != null)
                            Datos.Eliminar<ParteCaracteristicaTemporal>(oNoPedir);
                    }

                    // Se verifica si está marcado o tiene pedidos para procesar, si no, se salta
                    if (!Util.Logico(oFila.Cells["sug_Sel"].Value) || Util.Decimal(oFila.Cells["sug_Pedido"].Value) <= 0)
                        continue;

                    if (Util.Entero(oFila.Cells["sug_ProveedorID"].Value) != proveedorId)
                    {
                        this.Cursor = Cursors.Default;
                        SplashScreen.Close();
                        var msj = string.Format("{0} {1} {2} {3}", "El número de Parte:", Util.Cadena(oFila.Cells["sug_NumeroDeParte"].Value)
                            , "No está asignado al Proveedor:", proveedor.NombreProveedor);
                        Util.MensajeError(msj, GlobalClass.NombreApp);
                        this.btnProcesar.Enabled = true;
                        return;
                    }

                    //
                    var detallePedido = new PedidoDetalle()
                    {
                        PedidoID = pedido.PedidoID,
                        ParteID = iParteID,
                        CantidadPedido = Util.Decimal(oFila.Cells["sug_Pedido"].Value),
                        CostosUnitario = Util.Decimal(oFila.Cells["sug_CostoConDescuento"].Value),
                        PedidoEstatusID = 2
                    };
                    Datos.Guardar<PedidoDetalle>(detallePedido);

                    // Se marca como pedido si es 9500
                    if (Util.Cadena(oFila.Cells["sug_Caracteristica"].Value) == "9500")
                    {
                        var o9500 = Datos.GetListOf<Cotizacion9500Detalle>(c => c.ParteID == iParteID && !c.Pedido && c.Estatus);
                        foreach (var oReg in o9500)
                        {
                            oReg.Pedido = true;
                            Datos.Guardar<Cotizacion9500Detalle>(oReg);
                        }
                    }

                    // Se marca como pedido en reporte de faltante, si aplica
                    if (Util.Cadena(oFila.Cells["sug_Caracteristica"].Value) == "RF")
                    {
                        var oFaltantes = Datos.GetListOf<ReporteDeFaltante>(c => c.ParteID == iParteID && !c.Pedido && c.Estatus);
                        foreach (var oReg in oFaltantes)
                        {
                            oReg.Pedido = true;
                            Datos.Guardar<ReporteDeFaltante>(oReg);
                        }
                    }
                }

                var ped = Datos.GetListOf<PedidosView>(p => p.PedidoID.Equals(pedido.PedidoID));
                var detalle = Datos.GetListOf<PedidosDetalleView>(p => p.PedidoID.Equals(pedido.PedidoID));

                IEnumerable<PedidosView> pedidoE = ped;
                IEnumerable<PedidosDetalleView> detalleE = detalle;

                using (FastReport.Report report = new FastReport.Report())
                {
                    report.Load(string.Format("{0}{1}", GlobalClass.ConfiguracionGlobal.pathReportes, "ReportePedidos.frx"));
                    report.RegisterData(pedidoE, "Pedido");
                    report.GetDataSource("Pedido").Enabled = true;
                    report.RegisterData(detalleE, "DetallePedido");
                    report.GetDataSource("DetallePedido").Enabled = true;
                    report.Show(true);
                }

                this.Cursor = Cursors.Default;
                this.LimpiarFormularioDos();
                SplashScreen.Close();
                this.btnProcesar.Enabled = true;
                new Notificacion("Pedido Guardado exitosamente", 2 * 1000).Mostrar(Principal.Instance);
            }
            catch (Exception ex)
            {
                this.Cursor = Cursors.Default;
                SplashScreen.Close();
                this.btnProcesar.Enabled = true;
                Util.MensajeError(ex.Message, GlobalClass.NombreApp);
            }
        }
예제 #44
0
        //导出
        void UCReport_ExportEvent(object sender, EventArgs e)
        {
            if (dt == null || dt.Rows.Count == 0)
            {
                MessageBoxEx.Show("请查询出要导出的数据!");
                return;
            }
            string fileName = GetDefaultStyleFile();
            // create report instance
            FastReport.Report report = new FastReport.Report();
            if (!string.IsNullOrEmpty(fileName))
            {
                report.Load(fileName);
                report.RegisterData(dt, styleObject);
            }
            else
            {

                Report.FastReportEx reportEx = new Report.FastReportEx();
                reportEx.dicSpanRows = dicSpanRows;
                reportEx.dt = dt;
                reportEx.styleObject = styleObject;
                reportEx.styleTitle = styleTitle;
                report = reportEx.DefaultReport();
            }
            if (report == null)
            {
                return;
            }
            report.Prepare();
            report.FileName = styleTitle;
            //PDFExport export = new PDFExport();
            //export.Name = "name";
            //export.Title = styleTitle;
            //export.Export(report,styleTitle+".pdf");
            FastReport.Export.Csv.CSVExport csvExport = new FastReport.Export.Csv.CSVExport();
            csvExport.Export(report);
            //report.Export(export, styleTitle + ".pdf");
            report.Dispose();
        }
예제 #45
0
파일: LabService.cs 프로젝트: meimeic/XYS
 private string GenderPDF(string model, DataSet ds)
 {
     //
     using (FastReport.Report report = new FastReport.Report())
     {
         report.Load(model);
         report.RegisterData(ds);
         report.Prepare(); //报告准备
         //report.PreparePhase1();
         //report.PreparePhase2();
         //初始化PDF输出类
         using (PDFExport export = new PDFExport())
         {
             this.InitPDFExport(export);
             //输出PDF
             string fileFullName = GetFileFullName();
             export.Export(report, fileFullName);
             return fileFullName;
         }
     }
 }
예제 #46
0
        //选择打印样式
        private void cboPrintStyle_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cboPrintStyle.SelectedItem == null)
            {
                return;
            }
            DataRowView drv = (DataRowView)cboPrintStyle.SelectedItem;
            //样式ID
            string styleID = CommonCtrl.IsNullToString(drv["style_id"]);
            //如果是默认样式,则不用设为默认样式
            btnDefault.Enabled = styleID.Length > 0 && CommonCtrl.IsNullToString(drv["is_default"]) != "1";
            //如果有样式ID,才可以删除
            btnDelete.Enabled = styleID.Length > 0;

            if (dt == null || dt.Rows.Count == 0)
            {
                return;
            }
            string printStyle = CommonCtrl.IsNullToString(cboPrintStyle.SelectedValue);
            FastReport.Report rep;
            //FileTransferOperation fileOperation = new FileTransferOperation();
            ////如果下载出问题,用默认样式
            //if (!fileOperation.DownLoadFile(printStyle, "Report"))
            //{
            //    //LoadDefaultStyle();
            //    reportEx.LoadDefaultStyle(designerReport);
            //}
            //fileOperation.DownFile += new HXCFileTransferCache_Client.DownLoadFileHandler<HXCFileTransferCache_Client.DownLoadFileEventArgs>(fileOperation_DownFile);
            //下载打印样式
            string fileName = FileOperation.DownLoadFileByFile(cboPrintStyle.SelectedValue.ToString(), "Report");
            //如果没找到,则用默认样式
            if (string.IsNullOrEmpty(fileName))
            {
                FastReportEx reportEx = new FastReportEx();
                reportEx.styleObject = styleObject;
                reportEx.dt = dt;
                reportEx.dicSpanRows = dicSpanRows;
                reportEx.styleTitle = styleTitle;
                rep = reportEx.DefaultReport();
                if (rep == null)
                {
                    return;
                }
            }
            else
            {
                rep = new FastReport.Report();
                rep.Load(fileName);
                if (dt != null && dt.Rows.Count > 0)
                {
                    rep.RegisterData(dt, styleObject);
                }
            }
            designerReport.Report = rep;
            designerReport.RefreshLayout();
        }
예제 #47
0
        private void DisplayReporteDevolucion()
        {
            try
            {
                var movimiento = Datos.GetListOf<MovimientoInventarioView>(m => m.MovimientoInventarioID.Equals(oID));
                var detalle = Datos.GetListOf<MovimientoInventarioDetalleView>(d => d.MovimientoInventarioID.Equals(oID));

                IEnumerable<MovimientoInventarioView> movimientoE = movimiento;
                IEnumerable<MovimientoInventarioDetalleView> detalleE = detalle;

                using (FastReport.Report report = new FastReport.Report())
                {
                    report.Load(string.Format("{0}{1}", GlobalClass.ConfiguracionGlobal.pathReportes, "ReporteSalidaDevolucion.frx"));
                    report.RegisterData(movimientoE, "movimiento", 3);
                    report.RegisterData(detalleE, "detalle", 3);
                    report.GetDataSource("movimiento").Enabled = true;
                    report.GetDataSource("detalle").Enabled = true;
                    //report.Show(true);
                    UtilLocal.EnviarReporteASalida("Reportes.DevolucionAProveedor.Salida", report);
                }
            }
            catch (Exception ex)
            {
                Util.MensajeError(ex.Message, GlobalClass.NombreApp);
            }
        }
예제 #48
0
        private void btnImprimirTicket_Click(object sender, EventArgs e)
        {
            if (!EsNuevo && oParte != null)
            {
                int copias = 0;
                var frmCantidad = new MensajeObtenerValor("Número de etiquetas", "1", MensajeObtenerValor.Tipo.Entero);
                if (frmCantidad.ShowDialog(Principal.Instance) == DialogResult.OK)
                {
                    copias = Util.Entero(frmCantidad.Valor);
                }
                frmCantidad.Dispose();

                if (copias > 0)
                {
                    var etiquetas = new List<Etiquetas>();
                    for (int x = 0; x < copias; x++)
                    {
                        var etiqueta = new Etiquetas()
                        {
                            ParteID = oParte.ParteID,
                            NumeroParte = oParte.NumeroParte,
                            NombreParte = oParte.NombreParte,
                            CodigoBarra = oParte.CodigoBarra,
                            NumeroEtiquetas = copias
                        };
                        etiquetas.Add(etiqueta);
                    }

                    IEnumerable<Etiquetas> listaEtiquetas = etiquetas;
                    using (FastReport.Report report = new FastReport.Report())
                    {
                        report.Load(string.Format("{0}{1}", GlobalClass.ConfiguracionGlobal.pathReportes, "ReporteEtiquetas.frx"));
                        report.RegisterData(etiquetas, "etiquetas", 3);
                        report.GetDataSource("etiquetas").Enabled = true;
                        // report.FindObject("Text1").Delete();
                        // report.Show(true);
                        UtilLocal.EnviarReporteASalida("Reportes.Partes.Etiqueta", report);
                    }
                }
            }
        }