FastReport.Net v2016.6 FastScript安装 安装 VCL mvc FastReport.Net 报表 FastReport.Net v2016.2 TeeChart,图表开发 FastReport FMX 2.3 FastReport.Net v2016.1 FastReport.Net更新 FastCube VCL v2.5 FastReport VCL FastReport Online Designer教程 FastReport Online Designer组件 FastReport在线报表设计器:组件简介 FastReport在线报表设计器:界面结构简介 FastReport在线报表设计器:工作原理 FastReport Online Designer简介 FastReport Online Designer促销 FastReport Online Designer FastReport.Net授权促销 数据库查询构建 使用技巧 fastreport,报表 脚本引擎 FastScript FastScript, 脚本引擎 OLAP控件
作者:转载 来源:Johnny的专栏 浏览:Loading... 日期:2012-09-13
1.安装FastReport
如安装到c:/program files/fastreports
2.在bcb 6中使用FastReport(本过程从FastReport中抄写)
复制c:/program files/fastreports/ fastreport /RES/chinese文件夹到c:/program files/fastreports/ fastreport/SOURCE
Copy fr_class.pas to the installation folder
"/FastReports/FastReport/sources/" (default folder)
Run C++ Builder 6.0
Select menu Component->Install Packages. Check in packages list "FastReport 2.5 Components" and click Remove button, Answer "Yes" to all questions. Click "OK".
l Select menu File->Open, select file fr6.bpk from folder"/FastReports/FastReport/sources/"
Press buttons "Compile" and "Install" in opened window
Close C++ Builder. On query about save fr6.bpk ansver "No".
Run C++ Builder.
Select menu "Component"->"Install Packages" and set select for all installed FastReport related packages (ADO, BDE, DBX etc)
安装用到的其它额外的组件:There are three additional components included in standard FR package.These components can be found in SOURCE/BDE, SOURCE/IBX and SOURCE/ADO folders. They supersede old datamanager (TfrDataStorage component). To install them, use same technique as described above. Each component have a package file. To install in Delphi2, use file with Reg suffix (for example,FR_BDEReg.pas).
3.使用内存表
从BDE中拉Ttable控件,在窗体的构造函数中写如下代码,创建数据库和表和表字段和字段类型:
Table1->Close();
Table1->DatabaseName = "c://tempDB";
Table1->TableType = ttParadox;//数据库类型
Table1->TableName = "TREPORT_EXCHANGE";
if (!Table1->Exists) // Don't overwrite an existing table
{
// describe the fields in the table
Table1->FieldDefs->Clear();
TFieldDef *pNewDef = Table1->FieldDefs->AddFieldDef();
pNewDef->Name = "ITEM_NAME";
pNewDef->DataType = ftString;
pNewDef = Table1->FieldDefs->AddFieldDef();
pNewDef->Name = "CARDTYPE";
pNewDef->DataType = ftInteger;
pNewDef = Table1->FieldDefs->AddFieldDef();
pNewDef->Name = "AREA_NAME";
pNewDef->DataType = ftString;
pNewDef = Table1->FieldDefs->AddFieldDef();
pNewDef->Name = "OPER_NAME";
pNewDef->DataType = ftString;
pNewDef = Table1->FieldDefs->AddFieldDef();
pNewDef->Name = "FEECOUNT";
pNewDef->DataType = ftString;
pNewDef = Table1->FieldDefs->AddFieldDef();
pNewDef->Name = "ConsumeTimes";
pNewDef->DataType = ftString;
Table1->CreateTable();
}
编译后设置Ttable属性:
n DatabaseName=c:/tempDB文件夹路径
n Tablename=TREPORT_EXCHANGE
拉FastReport中的frReport和frDbDataSet控件。
设置frDbDataSet的DataSet属性为Ttable,frReport的Dataset属性为frDbDataSet
双击frReport设计报表视图。
保存到当前目录下的BusiStatByBusiItem.frf文件
l 添加一个按钮,并添加单击事件代码如下,注意在头文件中添加idl2cpp生成的.h文件:
CORBA::ORB_var orb = ::CORBA::ORB_init(__argc, __argv);
Table1->Open();
//每次报表前清空数据
while(Table1->FindFirst())
{
Table1->Delete();
}
PortableServer::ObjectId_var managerId =
PortableServer::string_to_ObjectId("InterfaceReport");
VipCenter::InterfaceReport_var manager =VipCenter::InterfaceReport::_bind("/InterfaceReport_poa",managerId);
VipCenter::StructRet_var retVar1;
VipCenter::SeqReportExchange_var seqReportExchange;
CORBA::ULong i=0;
VipCenter::date_time dt_start,dt_end;
dt_start.year=2002;
dt_start.month=1;
dt_start.day=1;
dt_start.hour=0;
dt_start.minute=0;
dt_start.second=0;
dt_end.year=2004;
dt_end.month=1;
dt_end.day=1;
dt_end.hour=0;
dt_end.minute=0;
dt_end.second=0;
//retVar1 = manager->BusiStatByVipCardType("571000100001",dt_start,dt_end,"1",571,seqReportExchange.out());
retVar1 = manager->BusiStatByBusiItem("571000100001",dt_start,dt_end,1,571,seqReportExchange.out());
for(i=0;i<seqReportExchange->length();i++)
{
Table1->AppendRecord(ARRAYOFCONST((
(AnsiString)seqReportExchange.ITEM_NAME
,(short)(seqReportExchange.CARDTYPE)
,(AnsiString)seqReportExchange.AREA_NAME
,(AnsiString)seqReportExchange.OPER_NAME
, (AnsiString)seqReportExchange.FEECOUNT
,(AnsiString)seqReportExchange.ConsumeTimes)));
}
Table1->Close();
Table1->Active = true;
frReport1->LoadFromFile("BusiStatByBusiItem.frf");
frReport1->ShowPreparedReport();
frReport1->ShowReport();
}
Tag标签:FastReport COM/ActiveX报表
上一篇: FastReport报表向导以及操作
慧都科技旗下网站-FastReport中文网版权所有 Copyright 2012
FastReport,报表控件,FastReport报表,VCL报表,.NET报表,COM/ActiveX报表,OLAP控件,联机分析处理