使用FastReport制做报表实战-报表模块开发框架


文章内容
在报表条件定义窗体内选择条件筛选数据,Report Type定义报表类型,通常业务单据报表的报表类型分为"CheckList和"Document". CheckList是报表清单,是主从表合并为一张数据表打印的,如《Proforma Invoice Schedule》报表。Document 是单据报表,只打印一张单据的数据。如:《Proforma Invoice》。
附件包含报表模块基类窗体定义frmReportBase,另外一组FastReport的类。此模块可作为报表的开发框架。
报表文件(*.fr3):Debug\Reports\PISchedule.fr3和ProformaInvoiceDoc.fr3
ProformaInvoiceDoc报表比较复杂,支持打印图片功能,请参考源码及下面的图片。


业务单据报表,主从表数据,明细嵌入图片。

注:下面的条码是程序自动生成的!

这是报表清单,CheckList

public DataSet GetReportData_List(string dateTimeFrom, string dateTimeTo, string PINOFrom, string PINOTo,
string Customer, string supplier, string itemNo, string CustomerPO, string reportType, string BrandName)
{
string sql = "sp_RptPISchedule '{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}'";
sql = string.Format(sql, dateTimeFrom, dateTimeTo, PINOFrom, PINOTo, Customer,
supplier, CustomerPO, itemNo, reportType, BrandName);
DataSet ds = GetDataSet(sql);
return ds;
}
public DataSet GetReportData_Doc(string dateTimeFrom, string dateTimeTo,
string PINOFrom, string PINOTo, string Customer, string supplier, string itemNo, string CustomerPO)
{
string sql = "sp_RptPIDoc '{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}'";
sql = string.Format(sql, dateTimeFrom, dateTimeTo, PINOFrom, PINOTo,
Customer, supplier, itemNo, CustomerPO);
DataSet ds = GetDataSet(sql);
return ds;
}
// 来源:www.CSFramework.com, C/S结构框架学习网
string Customer, string supplier, string itemNo, string CustomerPO, string reportType, string BrandName)
{
string sql = "sp_RptPISchedule '{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}'";
sql = string.Format(sql, dateTimeFrom, dateTimeTo, PINOFrom, PINOTo, Customer,
supplier, CustomerPO, itemNo, reportType, BrandName);
DataSet ds = GetDataSet(sql);
return ds;
}
public DataSet GetReportData_Doc(string dateTimeFrom, string dateTimeTo,
string PINOFrom, string PINOTo, string Customer, string supplier, string itemNo, string CustomerPO)
{
string sql = "sp_RptPIDoc '{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}'";
sql = string.Format(sql, dateTimeFrom, dateTimeTo, PINOFrom, PINOTo,
Customer, supplier, itemNo, CustomerPO);
DataSet ds = GetDataSet(sql);
return ds;
}
// 来源:www.CSFramework.com, C/S结构框架学习网
报表数据库:Debug\TestReport.mdf
(注:此示例的报表数据是香港某客户的,未经许可严禁转载!)
CSFrameworkReportDemo.rar (2689KB)

扫一扫加微信


版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网