1、引用

using FastReport;
using FastReport.Barcode;

2、code

      private void toolStripButtonPrint_Click(object sender, EventArgs e)
{
string textNewdate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
string textBarcode=string.Empty;
try
{
//seleCord = this.dataGridView1.SelectedRows[0].Cells[1].Value.ToString();//选中行的第一个单元格的值
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, "
+ "Security_Name, ContractTerm_Name,BrithDate, Sex, Education, UseManFrom, Post, Jobs, TypeWork, Security," + "ContractTerm,WorkDate,Nation,Duty,WorkTelphone,HomeTelphone,Email,WorkAddress, HomeAddress,"
+"Memo, Photo, IDCardImage"
+ " FROM tbEmployee where PID='" + iPid + "'"; Report FsReport = new Report();//实例化打印报表 SqlHelper helper = new SqlHelper();
ds = SqlHelper.SqlGetDataSet(StrSql, "v_tbEmployee");
//sda.Fill(dt,"tbDevCard");
//string reportpath = AppDomain.CurrentDomain.BaseDirectory+"\OtDevPgCard.frx";
//FsReport.Load(@"..\OtDevPgCard.frx");
FsReport.Load(@"FastReport\OtEmpEdit.frx");
FsReport.RegisterData(ds);
dt = ds.Tables[];
TextObject pTextPrint = FsReport.FindObject("TextPrintDate") as TextObject;
//TextObject pTextIDCard = FsReport.FindObject("TextIDCard") as TextObject;
textBarcode = dt.Rows[]["IDCard"].ToString(); //(FsReport.FindObject("Barcode2") as BarcodeObject).Text = "21000002009"; // strArray[3];
(FsReport.FindObject("Barcode2") as BarcodeObject).Text = textBarcode;
//pTextIDCard.Text = textBarcode;
pTextPrint.Text = textNewdate;
FsReport.Show();
FsReport.Dispose();
}
catch (Exception err)
{
MessageBox.Show(err.Message);
}
}

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. poj 3468 线段树模板题

    #include<iostream> #include<algorithm> #include<stdio.h> using namespace std; #def ...

  2. 玲珑杯 第4次 String cut(暴力字符串)

    题意:给你长度为n(<=100000)的字符串,问你任意删除一个字符后得到循环节最多的数量是多少 题解:最简单的想法就是枚举删除的字符,再kmp求循环节,但是时间复杂度为O(n*n)会超时 因此 ...

  3. 并发Socket程序设计

    1. 非阻塞并发模型 直接将socket设置为非阻塞, 轮询处理连接和接收. 缺点: 极大消耗CPU资源,不适合实际应用. 2. 信号驱动模型 当Socket文件描述符准备就绪后 内核会给进程发送一个 ...

  4. ambari2.4.2在CentOS7上的二次开发

    前言:如果想安装到CentOS7,就一定要将源码在CentOS7上编译,然后安装,否则可能会出现各种问题 目录 源码结构 技术点 编译环境的搭建  安装samba 安装编译环境 整体编译 ambari ...

  5. 天地图OGC WMTS服务规则

    图层名称 服务地址 投影类型 矢量底图 http://t0.tianditu.gov.cn/vec_c/wmts?tk=您的密钥 经纬度投影 http://t0.tianditu.gov.cn/vec ...

  6. 考虑 PHP 5.0~5.6 各版本兼容性的 cURL 文件上传

    最近做的一个需求,要通过PHP调用cURL,以multipart/form-data格式上传文件.踩坑若干,够一篇文章了. 重要警告 没事不要读PHP的官方中文文档!版本跟不上坑死你! 不同版本PHP ...

  7. webservice 交错数组

    net webservices public DataSet SelectOPQuestionByWhere(string strWhere, string[][] strArry) { if (!k ...

  8. The tag handler class for "c:set"(org.apache.taglibs.standard.tag.rt.core.UrlTag)was not found on the Java Build Path

    1.源码: <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> < ...

  9. uva 10739 dp

    https://vjudge.net/problem/UVA-10739 和昨天的那个回文串几乎一样只是加了条件限制,可以随意增删以及替换. #include<iostream> #inc ...

  10. Unable to load native-hadoop library for your platform(已解决)

    1.增加调试信息寻找问题 2.两种方式解决unable to load native-hadoop library for you platform 附:libc/glibc/glib简介 参考: 1 ...