• 大小: 1.70M
    文件类型: .rar
    金币: 1
    下载: 1 次
    发布日期: 2024-06-20
  • 语言: C#
  • 标签: 打印  条码  源码  C#  

资源简介

本demo主要是C#实现打印报表展示,条码打印功能,集成gridReport

资源截图

代码片段和文件信息

using grproLib;  //grid++
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace NewuLib
{
    /// 
    /// Grid++封装类
    /// 作者:wang.shuai
    /// 日期:2019-02-21
    /// 版本:1.0.0
    /// 

    public class GridPrintHelper
    {
        private GridppReport _gridppReport = new GridppReport();
        private EGridPrintGrf _grf;
        private List _fieldList = new List();
        private List _paraList = new List();

        private List fieldNameList = new List();
        private List paraNameList = new List();
        /// 
        /// 记录集的实参
        /// 

        public List dataFieldList = new List();

        /// 
        /// 参数的实参
        /// 

        public List dataParalist = new List();

        public string ErrMessage = ““;

        /// 
        /// 构造函数
        /// 

        /// 打开的模板名称 EGridPrintGrf
        public GridPrintHelper(EGridPrintGrf grf)
        {
            this._grf = grf;
            _gridppReport.LoadFromFile(Application.StartupPath + @“\“ + _grf.ToString() + @“.grf“);
            _gridppReport.Initialize += _gridppReport_Initialize;
            _gridppReport.FetchRecord += _gridppReport_FetchRecord;
            GetGrfParaAndFieldName();
        }

        private void GetGrfParaAndFieldName()
        {
            foreach (IGRField item in _gridppReport.DetailGrid.Recordset.Fields)
            {
                fieldNameList.Add(item.Name);
            }

            foreach (IGRParameter item in _gridppReport.Parameters)
            {
                paraNameList.Add(item.Name);
            }
        }

        /// 
        /// 赋值数据
        /// 

        void _gridppReport_FetchRecord()
        {
            _gridppReport.DetailGrid.Recordset.Append();

            foreach (GridParaKeyValue item in dataFieldList)
            {
                for (int j = 0; j < fieldNameList.Count;j++ )
                {
                    if (item.gridKey == fieldNameList[j])
                    {
                        GridParaSetValue(_fieldList[j] item);
                        break;
                    }
                }
            }
            _gridppReport.DetailGrid.Recordset.Post();

            foreach (GridParaKeyValue item in dataParalist)
            {
                for (int j = 0; j < paraNameList.Count; j++)
                {
                    if (item.gridKey == paraNameList[j])
                    {
                        GridParaSetValue(_paraList[j] item);
                        break;
                    }
                }
            }
       

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       6381  2019-02-21 15:21  grid++test\Grid 封装类库\GridPrintHelper.cs

     文件       1466  2019-02-21 11:18  grid++test\Grid 封装类库\使用说明.txt

     文件      28722  2019-02-21 11:20  grid++test\Grid 封装类库\效果图片1.png

     文件      30831  2019-02-21 15:22  grid++test\Grid 封装类库\效果图片2.png

     文件      36784  2019-02-21 15:31  grid++test\Grid 封装类库\示例代码.png

     文件       1014  2019-02-20 10:20  grid++test\grid++test.sln

    ..A..H.     67584  2019-12-05 16:11  grid++test\grid++test.v12.suo

     文件        187  2019-02-20 10:18  grid++test\WinformGridTest\App.config

     文件      49664  2019-02-20 10:19  grid++test\WinformGridTest\bin\Debug\AxInterop.grproLib.dll

     文件     289280  2019-02-20 10:18  grid++test\WinformGridTest\bin\Debug\Interop.grproLib.dll

     文件       4227  2018-07-03 13:14  grid++test\WinformGridTest\bin\Debug\tiaoma.grf

     文件      20736  2019-02-21 15:15  grid++test\WinformGridTest\bin\Debug\tipPrint.grf

     文件      16896  2019-02-21 17:29  grid++test\WinformGridTest\bin\Debug\WinformGridTest.exe

     文件        187  2019-02-20 10:18  grid++test\WinformGridTest\bin\Debug\WinformGridTest.exe.config

     文件      38400  2019-02-21 17:29  grid++test\WinformGridTest\bin\Debug\WinformGridTest.pdb

     文件      23168  2019-12-05 16:03  grid++test\WinformGridTest\bin\Debug\WinformGridTest.vshost.exe

     文件        187  2019-02-20 10:18  grid++test\WinformGridTest\bin\Debug\WinformGridTest.vshost.exe.config

     文件        490  2018-04-12 07:35  grid++test\WinformGridTest\bin\Debug\WinformGridTest.vshost.exe.manifest

     文件     642048  2010-12-11 00:00  grid++test\WinformGridTest\DLL\grdes50.dll

     文件    1021440  2010-12-11 00:00  grid++test\WinformGridTest\DLL\gregn50.dll

     文件       3788  2019-02-21 17:29  grid++test\WinformGridTest\Form1.cs

     文件       3992  2019-02-21 11:07  grid++test\WinformGridTest\Form1.Designer.cs

     文件       6436  2019-02-21 11:07  grid++test\WinformGridTest\Form1.resx

     文件        396  2019-02-21 11:01  grid++test\WinformGridTest\Form2.cs

     文件       2482  2019-02-21 11:01  grid++test\WinformGridTest\Form2.Designer.cs

     文件       6436  2019-02-21 11:01  grid++test\WinformGridTest\Form2.resx

     文件        396  2019-12-05 16:11  grid++test\WinformGridTest\Form3.cs

     文件       1412  2019-12-05 16:11  grid++test\WinformGridTest\Form3.Designer.cs

     文件       5817  2019-12-05 16:11  grid++test\WinformGridTest\Form3.resx

     文件       6381  2019-02-21 15:38  grid++test\WinformGridTest\GridPrintHelper.cs

............此处省略42个文件信息

评论

共有 条评论