1、引用

  1. using FastReport;
  2. using FastReport.Barcode;

2、code

  1. private void toolStripButtonPrint_Click(object sender, EventArgs e)
  2. {
  3. string textNewdate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  4. string textBarcode=string.Empty;
  5. try
  6. {
  7. //seleCord = this.dataGridView1.SelectedRows[0].Cells[1].Value.ToString();//选中行的第一个单元格的值
  8. string StrSql = "SELECT PID, SN, WorkNo, Name, Sex_Name, IDCard, Age, Education_Name, CONVERT(varchar(100), EntryDate, 23) as EntryDate," + "UseManFrom_Name, Post_Name, jobs_Name,TypeWork_Name, IDCardAdress, Mobile, "
  9. + "Security_Name, ContractTerm_Name,BrithDate, Sex, Education, UseManFrom, Post, Jobs, TypeWork, Security," + "ContractTerm,WorkDate,Nation,Duty,WorkTelphone,HomeTelphone,Email,WorkAddress, HomeAddress,"
  10. +"Memo, Photo, IDCardImage"
  11. + " FROM tbEmployee where PID='" + iPid + "'";
  12.  
  13. Report FsReport = new Report();//实例化打印报表
  14.  
  15. SqlHelper helper = new SqlHelper();
  16. ds = SqlHelper.SqlGetDataSet(StrSql, "v_tbEmployee");
  17. //sda.Fill(dt,"tbDevCard");
  18. //string reportpath = AppDomain.CurrentDomain.BaseDirectory+"\OtDevPgCard.frx";
  19. //FsReport.Load(@"..\OtDevPgCard.frx");
  20. FsReport.Load(@"FastReport\OtEmpEdit.frx");
  21. FsReport.RegisterData(ds);
  22. dt = ds.Tables[];
  23. TextObject pTextPrint = FsReport.FindObject("TextPrintDate") as TextObject;
  24. //TextObject pTextIDCard = FsReport.FindObject("TextIDCard") as TextObject;
  25. textBarcode = dt.Rows[]["IDCard"].ToString();
  26.  
  27. //(FsReport.FindObject("Barcode2") as BarcodeObject).Text = "21000002009"; // strArray[3];
  28. (FsReport.FindObject("Barcode2") as BarcodeObject).Text = textBarcode;
  29. //pTextIDCard.Text = textBarcode;
  30. pTextPrint.Text = textNewdate;
  31. FsReport.Show();
  32. FsReport.Dispose();
  33. }
  34. catch (Exception err)
  35. {
  36. MessageBox.Show(err.Message);
  37. }
  38. }

C# winfrom FastReport Print的更多相关文章

  1. C# winfrom FastReport 变量设计加载

    1.源码 DataTable dt5 = new DataTable(); dt5 = SqlHelper.SqlGetDataTable(StrSql, "tbEmpCont") ...

  2. 使用FastReport.net 报表在网页上实现打印功能

    这些年的工作当中,最早是在8年前接触到FastReport这个报表工具,从名字上来看,直译过来就是快速报表,正所谓天下武功,唯快不破,FastReport报表早些年确实是制作报表的不二之选,8年前的工 ...

  3. winfrom调用FastReport模板

    '存放模板的路径 If Dir(Application.StartupPath & "\ReportsFile\HB\01\IN.frx", FileAttribute.N ...

  4. MVC架构 使用FastReport

    1.Web.config文件 添加配置 <httpHandlers> <add path="FastReport.Export.axd" verb="* ...

  5. FastReport 使用说明

    FastReport TfrxReport 此为最主要的报表元件,一个 TfrxReport 元件组成一份报表.在设计时期,双击此 元件可打开报表设计器(Report Designer),此元件拥有所 ...

  6. FastReport 使用技巧篇

    使用技巧篇 1.FastReport中如果访问报表中的对象?       可以使用FindObject方法.      TfrxMemoView(frxReport1.FindObject('memo ...

  7. FASTREPORT 整理 (mtm)

    DELPHI中用FASTREPORT制作报表  1.加载并存储报表 默认情况下,报表窗体同项目窗体构存储在同一个DFM文件中.多数情况下,无须再操作,因而你就不必采用特殊方法加载报表. 如果你决定在文 ...

  8. FastReport经验

    FastReport经验 1.FastReport中如果访问报表中的对象? 可以使用FindObject方法. TfrxMemoView(frxReport1.FindObject(’memo1′)) ...

  9. FastReport使用一——简介

    一:FastReport Designer用法简介 1.使用FastReport.Net4文件夹下的Designer.exe进行模版的创建工作 图1 图1中,右键删除除==>数据区 之外的其他区 ...

随机推荐

  1. Bootstrap3组件--2

    目录 1. 分页 2. 标签 3. 徽章 4. 巨幕 5. 页头 6. 缩略图 7. 警告框 8. 进度条 9. 列表组 10. 面板 11.Well 1. 分页 <!doctype html& ...

  2. Linux系统LVM分区减容扩容

    Linux系统LVM分区减容扩容 目标:将VolGroup-lv_home缩小到20G,并将剩余的空间添加给VolGroup-lv_root 1.首先查看磁盘使用情况 [root@localhost ...

  3. 【bzoj1899】[Zjoi2004]Lunch 午餐(贪心+dp)

    题目传送门:https://www.lydsy.com/JudgeOnline/problem.php?id=1899 显然为了节省时间,吃饭慢的人要先打饭.于是我们可以先把所有人按吃饭时间排序,于是 ...

  4. 转:gdb相关学习

    声明本文转自:http://www.cnblogs.com/rosesmall/archive/2012/04/12/2444431.html (查看内存部分有补充) 另推荐一个入门级的好文章:htt ...

  5. JavaScript 对时间日期格式化

    JavaScript 对时间日期格式化 // 对Date的扩展,将 Date 转化为指定格式的String // 月(M).日(d).小时(h).分(m).秒(s).季度(q) 可以用 1-2 个占位 ...

  6. 搜索8--noi1817:城堡问题

    搜索8--noi1817:城堡问题 一.心得 1.这题只是在普通的迷宫的基础上面加上了墙的概念,所以基本的思路和代码就和普通的迷宫是一样的,只不过需要多加上一层墙的判断 2.这里墙的判断是用的二进制加 ...

  7. Windows环境下CGAL的安装

    1 准备工作 下载cmake 下载CGAL安装包 学习如何设置环境变量 安装Qt运行demos. libQGLViewer用来运行 3D CGAL demos. 确定Visual Studio 相应的 ...

  8. hdu 1847 Good Luck in CET-4 Everybody!(sg)

    Good Luck in CET-4 Everybody! Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K ...

  9. C#中的线程(二)线程同步

    C#中的线程(二)线程同步   Keywords:C# 线程Source:http://www.albahari.com/threading/Author: Joe AlbahariTranslato ...

  10. 浅谈MariaDB Galera Cluster架构

    MariaDB          MariaDB 是由原来 MySQL 的作者Michael Widenius创办的公司所开发的免费开源的数据库服务器,MariaDB是同一MySQL版本的二进制替代品 ...