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. .NET 中如何判断文件与目录

    FileInfo fileInfo = new FileInfo(pth); if ((fileInfo.Attributes & FileAttributes.Directory) != 0 ...

  2. Spring插件的安装与卸载---笔记

    Spring插件的安装 1.在eclipse中选择工具菜单Help--->Install New Software选项 2.点击Add, 3.选择插件地址或输入网址,点击  OK  . http ...

  3. SQL查询顺序

    SQL查询顺序 1 FROM 2 WHERE 3 SELECT 4 ORDER BY 5 GOUP BY 6 HAVING 左外连接:查询出 left join 左边表的全部数据,left join右 ...

  4. Codeforces Round #367 (Div. 2) A , B , C

    A. Beru-taxi time limit per test 1 second memory limit per test 256 megabytes input standard input o ...

  5. Spring Boot入门——使用jsp

    使用步骤: 1.创建Maven web project项目 2.在pom.xml文件中添加依赖 <project xmlns="http://maven.apache.org/POM/ ...

  6. 《Think in Java》(八)多态

    "封装"通过合并特征和行为来创建新的数据类型: "实现隐藏"通过将细节"私有化"把接口和实现分离开来: "多态"消除类型 ...

  7. Mac终端ls显示文件名为彩色

    原理: ls -G 可显示彩色文件名. 在终端输入: nano ~/.bash_profile 辑器.bash_profile文件,粘贴下面内容: alias cls='tput reset' ali ...

  8. 简单CSS3动画

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  9. Jfinal整合百度富文本编辑器ueditor

    ueditor配置文件ueditor.config.js修改参数serverUrl:(改为要调用的action) 后台代码 package com.sandu.mega.admin.ueditor; ...

  10. /var/adm/wtmp文件太大该怎么办?

    /var/admin/wtmp文件记录所有用户的登陆信息,随着时间会增长到很大,/var/adm/wtmp文件太大该怎么办呢?先来看看/var/adm/wtmp文件的属性:testterm1:/#ls ...