Data from the CORBA interface populates the FastReport report design process
surroundings:
Programming Tools: Borland C Builder 6.0
Operating system: Windows 2000
Application Software: Fastreport5.2 Crack Edition
1. Install fastreport
Install to C: / Program Files / FastReports
2. Use fastreport in BCB 6 (this process is copied from RastReport)
l Copy C: / Program Files / FastReports / Fastreport / Res / Chinese Folder to C: / Program Files / Fastreports / Fastreport / Source
l Copy fr_class.pas to the installation folder
l "/ fastreports / fastreport / source" (Default Folder)
l Run C Builder 6.0
l Select Menu Component-> Install packages. Check In Packages List "FastReport 2.5 Components" and Click Remove Button, Answer "YES" to all qustions. Click "OK".
l select menu file-> open, select file fr6.bpk from folder "/ fastreports / fastreport / source"
l Press Buttons "Compile" and "install" in Opened Window
l Close C Builder. on Query About Save Fr6.bpk Ansver "NO".
l Run C Builder.
l Select Menu "Component" -> "Install Packages" and set select for all installed fastreport Related Packages (ADO, BDE, DBX ETC)
L The other additional components used: 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. Use memory table
l From the BDE TTABLE control, write the following code in the form of the form, create the database and tables and table fields, and field types:
Table1-> close (); table1-> databasename = "c: // tempdb";
Table1-> TableType = TTPARADOX; // Database Type
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 = "consumeetimes";
PNewdef-> DataType = ftstring;
Table1-> CreateTable ();
}
l Set the TTable property after compiling:
n DatabaseName = C: / Tempdb folder path
n Tablename = Treport_exchange
Pull the FREPORT and FrDBDataSet controls in FastReport.
Set the frDbDataSet's DataSet property as TTable, the DataSet property of the FRREPORT is FrDbDataSet
l Double-click the FRREPORT design report.
Save to BusistBybusiItem.frf files in the current directory
l Add a button and add the click event code as follows, pay attention to add IDL2CPP generated in the header file:
Corba :: ORB_VAR ORB = :: CORBA :: ORB_INIT (__ argc, __ARGV);
TABLE1-> open ();
/ / Clear data before each report
While (Table1-> Findfirst ())
{
Table1-> delete ();
}
PortablesRVER :: ObjectId_var managerid =
PortablesRver :: 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-> BusistAvipCardType ("571000100001", DT_Start, DT_END, "1", 571, SEQREPORTEXCHANGE.out ());
Retvar1 = Manager-> BusistTAbybusiItem ("571000100001", DT_Start, DT_END, 1, 571, SeqreportExchange.out ());
For (i = 0; i
{
Table1-> appendrecord (Arrayofconst (((ARRAYOFCONST)
(ANSISSTRING) SEQREPORTEXCHANGE [I] .Item_name
(SHORT) (seqreportexchange [i] .cardtype)
, (ANSISUSTRING) SEQREPORTEXCHANGE [I] .area_name
, (ANSISUSTRING) SeqReportExchange [i]. Ga per_name
, (ANSISUSTRING) SEQREPORTEXCHANGE [I] .feecount
, (ANSISUSTRING) SEQREPORTEXCHANGE [I] .consumetimes))))))))))))))))
}
Table1-> close ();
Table1-> Active = true;
FRREPORT1-> LoadFromfile ("busistatabasebusiitem.frf");
FRREPORT1-> ShowPreparedReport ();
FRREPORT1-> ShowReport ();
}