C# winfrom FastReport Print
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的更多相关文章
- C# winfrom FastReport 变量设计加载
1.源码 DataTable dt5 = new DataTable(); dt5 = SqlHelper.SqlGetDataTable(StrSql, "tbEmpCont") ...
- 使用FastReport.net 报表在网页上实现打印功能
这些年的工作当中,最早是在8年前接触到FastReport这个报表工具,从名字上来看,直译过来就是快速报表,正所谓天下武功,唯快不破,FastReport报表早些年确实是制作报表的不二之选,8年前的工 ...
- winfrom调用FastReport模板
'存放模板的路径 If Dir(Application.StartupPath & "\ReportsFile\HB\01\IN.frx", FileAttribute.N ...
- MVC架构 使用FastReport
1.Web.config文件 添加配置 <httpHandlers> <add path="FastReport.Export.axd" verb="* ...
- FastReport 使用说明
FastReport TfrxReport 此为最主要的报表元件,一个 TfrxReport 元件组成一份报表.在设计时期,双击此 元件可打开报表设计器(Report Designer),此元件拥有所 ...
- FastReport 使用技巧篇
使用技巧篇 1.FastReport中如果访问报表中的对象? 可以使用FindObject方法. TfrxMemoView(frxReport1.FindObject('memo ...
- FASTREPORT 整理 (mtm)
DELPHI中用FASTREPORT制作报表 1.加载并存储报表 默认情况下,报表窗体同项目窗体构存储在同一个DFM文件中.多数情况下,无须再操作,因而你就不必采用特殊方法加载报表. 如果你决定在文 ...
- FastReport经验
FastReport经验 1.FastReport中如果访问报表中的对象? 可以使用FindObject方法. TfrxMemoView(frxReport1.FindObject(’memo1′)) ...
- FastReport使用一——简介
一:FastReport Designer用法简介 1.使用FastReport.Net4文件夹下的Designer.exe进行模版的创建工作 图1 图1中,右键删除除==>数据区 之外的其他区 ...
随机推荐
- 九度oj-题目1103:二次方程计算器
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:2799 解决:633 题目描述: 设计一个二次方程计算器 输入: 每个案例是关于x的一个二次方程表达式,为了简单,每个系数都是整数形式. 输 ...
- PAT1030. Travel Plan (30)
#include <iostream> #include <limits> #include <vector> using namespace std; int n ...
- python3与anaconda2共存
我是先下载了python3,后来因为需要2为了省事就去下载了anaconda2,但发现这里有个很严重的共存问题. 找了一下网上的各种共存问题,发现网上的基本上都是基于一个anaconda然后通过虚拟环 ...
- nova instance启动中的同步与异步
instance create:nova/api/servers.create -- self.compute_api.create -- self.compute_task_api.build_in ...
- 开发者必备,超实用的PHP代码片段!
此前,研发频道曾发布<直接拿来用,10个PHP代码片段>,得到了网友们的一致好评.本文,笔者将继续分享九个超级有用的PHP代码片段.当你在开发网站.应用或者博客时,利用这些代码能为你节省大 ...
- sql 触发器回顾
一: 触发器是一种特殊的存储过程﹐它不能被显式地调用﹐而是在往表中插入记录﹑更新记录或者删除记录时被自动地激活.所以触发器可以用来实现对表实施复杂的完整性约束. 二: SQL Server为每个触发器 ...
- 编写TreeSet类的实现程序,其中相关的迭代器使用二叉查找树
package com.test.tree; import java.util.Iterator; /** * 编写TreeSet类的实现程序,其中相关的迭代器使用二叉查找树. * 在每个节点上添加一 ...
- 字典:dict.c/dict.h
Redis 源码分析(1):字典和哈希表(dict.c 和 dict.h)http://huangz.iteye.com/blog/1455808两个点:字典结构的运作流程哈希表的渐进式 rehash ...
- php:PHP解析xml的4种方法
XML处理是开发过程中经常遇到的,PHP对其也有很丰富的支持,本文只是对其中某几种解析技术做简要说明,包括:Xml parser, SimpleXML, XMLReader, DOMDocument. ...
- 使用JMeter建立接口测试
[需求]某组机器是Android和iOS输入法接口服务器,有很多重要的接口,例如:升级,网络开关,热词等.现在有3台机器过保要下线,新申请了3台机器,需要验证一下这3台机器接口的正确性. [测试步骤] ...