当前位置: 首页 > >

FastReport使用

发布时间:

1、控件、参数赋值



try
{
FastReport.Report report = new FastReport.Report();
string filename = @"C:UsersAdministratorDesktopTemplatedcqzs.frx";
report.Load(filename);

string textBarcode = "ceshi001";
FastReport.TextObject pTextPrint = report.FindObject("txtqlr") as FastReport.TextObject;
pTextPrint.Text = textBarcode;

report.SetParameterValue("gyqk", "gyqk");

report.Show();

}
catch (Exception err)
{
MessageBox.Show(err.Message);
}

2、报表打印



FastReport.Report report = new FastReport.Report();
string filename = @"C:UsersAdministratorDesktopTemplatedcqzs.frx";
report.Load(filename);

string textBarcode = "ceshi001";
FastReport.TextObject pTextPrint = report.FindObject("txtqlr") as FastReport.TextObject;
pTextPrint.Text = textBarcode;

report.SetParameterValue("gyqk", "gyqk");

report.PrintSettings.ShowDialog = false; //不弹出打印设置框
report.PrintSettings.Printer = "Microsoft XPS Document Writer"; // 设置默认打印机.
report.Print();

?



转载于:https://www.cnblogs.com/leebokeyuan/p/7510757.html






相关资源:FastReport4 中文使用手册教程



友情链接: