各位富翁,帮帮忙,好吗?fastreport3.0的报表问题 ( 积分: 100 )

  • 主题发起人 主题发起人 dingtip
  • 开始时间 开始时间
D

dingtip

Unregistered / Unconfirmed
GUEST, unregistred user!
我的操作步骤。
我放上三个组件table,frxreport,frxdbdatabase
设置分别如下
object Form1: TForm1
Left = 192
Top = 107
Width = 696
Height = 480
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Table1: TTable
DatabaseName = 'DBDEMOS'
TableName = 'country.db'
Left = 80
Top = 56
end
object frxReport1: TfrxReport
Version = '3.15'
DataSet = frxDBDataset1
DataSetName = 'frxDBDataset1'
do
tMatrixReport = False
IniFile = '/Software/Fast Reports'
PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator]
PreviewOptions.Zoom = 1.000000000000000000
PrintOptions.Printer = 'Default'
ReportOptions.CreateDate = 38579.467288946800000000
ReportOptions.LastChange = 38579.467288946800000000
ScriptLanguage = 'PascalScript'
ScriptText.Strings = (
'begin
'
''
'end.
')
Left = 128
Top = 56
Datasets = <
item
DataSet = frxDBDataset1
DataSetName = 'frxDBDataset1'
end>
Variables = <>
Style = <>
object Page1: TfrxReportPage
PaperWidth = 210.000000000000000000
PaperHeight = 297.000000000000000000
PaperSize = 9
LeftMargin = 10.000000000000000000
RightMargin = 10.000000000000000000
TopMargin = 10.000000000000000000
BottomMargin = 10.000000000000000000
object DetailData1: TfrxDetailData
Height = 22.677180000000000000
Top = 18.897650000000000000
Width = 718.110700000000000000
RowCount = 1
object Memo1: TfrxMemoView
Left = 30.236240000000000000
Width = 94.488250000000000000
Height = 18.897650000000000000
Memo.Strings = (
'[frxDBDataset1.&quot;Name&quot;]')
end
object Memo2: TfrxMemoView
Left = 238.110390000000000000
Top = 3.779530000000001000
Width = 94.488250000000000000
Height = 18.897650000000000000
Memo.Strings = (
'[frxDBDataset1.&quot;Capital&quot;]')
end
end
end
end
object frxDBDataset1: TfrxDBDataset
UserName = 'frxDBDataset1'
CloseDataSource = False
FieldAliases.Strings = (
'Name=Name'
'Capital=Capital'
'Continent=Continent'
'Area=Area'
'Population=Population')
DataSet = Table1
Left = 176
Top = 56
end
end
在报表欲览器中我设置了添加了一个detaildata 选 single rows
然后添加text object 两个,双击一个text object选中一个字段,然后预览报出
&quot;the following errors ,have occured;
Incorrect band position DetailData1&quot;
 
我的操作步骤。
我放上三个组件table,frxreport,frxdbdatabase
设置分别如下
object Form1: TForm1
Left = 192
Top = 107
Width = 696
Height = 480
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Table1: TTable
DatabaseName = 'DBDEMOS'
TableName = 'country.db'
Left = 80
Top = 56
end
object frxReport1: TfrxReport
Version = '3.15'
DataSet = frxDBDataset1
DataSetName = 'frxDBDataset1'
do
tMatrixReport = False
IniFile = '/Software/Fast Reports'
PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator]
PreviewOptions.Zoom = 1.000000000000000000
PrintOptions.Printer = 'Default'
ReportOptions.CreateDate = 38579.467288946800000000
ReportOptions.LastChange = 38579.467288946800000000
ScriptLanguage = 'PascalScript'
ScriptText.Strings = (
'begin
'
''
'end.
')
Left = 128
Top = 56
Datasets = <
item
DataSet = frxDBDataset1
DataSetName = 'frxDBDataset1'
end>
Variables = <>
Style = <>
object Page1: TfrxReportPage
PaperWidth = 210.000000000000000000
PaperHeight = 297.000000000000000000
PaperSize = 9
LeftMargin = 10.000000000000000000
RightMargin = 10.000000000000000000
TopMargin = 10.000000000000000000
BottomMargin = 10.000000000000000000
object DetailData1: TfrxDetailData
Height = 22.677180000000000000
Top = 18.897650000000000000
Width = 718.110700000000000000
RowCount = 1
object Memo1: TfrxMemoView
Left = 30.236240000000000000
Width = 94.488250000000000000
Height = 18.897650000000000000
Memo.Strings = (
'[frxDBDataset1.&quot;Name&quot;]')
end
object Memo2: TfrxMemoView
Left = 238.110390000000000000
Top = 3.779530000000001000
Width = 94.488250000000000000
Height = 18.897650000000000000
Memo.Strings = (
'[frxDBDataset1.&quot;Capital&quot;]')
end
end
end
end
object frxDBDataset1: TfrxDBDataset
UserName = 'frxDBDataset1'
CloseDataSource = False
FieldAliases.Strings = (
'Name=Name'
'Capital=Capital'
'Continent=Continent'
'Area=Area'
'Population=Population')
DataSet = Table1
Left = 176
Top = 56
end
end
在报表欲览器中我设置了添加了一个detaildata 选 single rows
然后添加text object 两个,双击一个text object选中一个字段,然后预览报出
&quot;the following errors ,have occured;
Incorrect band position DetailData1&quot;
 
http://www.delphibbs.com/keylife/iblog_show.asp?xid=11760
KeyLife富翁笔记
作者?: zgl198171
标题?: 1、报表动态生成的类单元:
 
frxreport的dataset直接连接datamoudle.frxdbdataset
应该是这样的吧..
 
不是,我想看到的是demo中的连接方法,可我没找到,看了半天摸不着头脑,你看看的它的代码,没找那里有连接的迹象,但运行时没问题?
********************************************************************************
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Db, DBTables, frxDesgn, frxClass, frxDCtrl,
frxChart, frxRich, frxBarcode, ImgList, ComCtrls, ExtCtrls, frxOLE,
frxCross, frxDMPExport, frxExportImage, frxExportRTF, frxExportTXT,
frxExportXML, frxExportXLS, frxExportHTML, frxGZip, frxExportPDF,
frxBDEComponents, frxChBox;
type
TForm1 = class(TForm)
DesignB: TButton;
frxDesigner1: TfrxDesigner;
frxBarCodeObject1: TfrxBarCodeObject;
frxRichObject1: TfrxRichObject;
frxChartObject1: TfrxChartObject;
frxDialogControls1: TfrxDialogControls;
Tree: TTreeView;
ImageList1: TImageList;
PreviewB: TButton;
DescriptionM: TMemo;
Image1: TImage;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
frxOLEObject1: TfrxOLEObject;
frxCrossObject1: TfrxCrossObject;
frxBDEComponents1: TfrxBDEComponents;
frxDotMatrixExport1: TfrxDotMatrixExport;
frxBMPExport1: TfrxBMPExport;
frxJPEGExport1: TfrxJPEGExport;
frxTIFFExport1: TfrxTIFFExport;
frxTXTExport1: TfrxTXTExport;
frxHTMLExport1: TfrxHTMLExport;
frxXLSExport1: TfrxXLSExport;
frxXMLExport1: TfrxXMLExport;
frxRTFExport1: TfrxRTFExport;
frxGZipCompressor1: TfrxGZipCompressor;
frxPDFExport1: TfrxPDFExport;
Label4: TLabel;
frxCheckBoxObject1: TfrxCheckBoxObject;
frxReport1: TfrxReport;
procedure DesignBClick(Sender: TObject);
procedure TreeCustomDrawItem(Sender: TCustomTreeView;
Node: TTreeNode;
State: TCustomDrawState;
var DefaultDraw: Boolean);
procedure PreviewBClick(Sender: TObject);
procedure TreeChange(Sender: TObject;
Node: TTreeNode);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
WPath: String;
public
{ Public declarations }
end;

var
Form1: TForm1;
implementation
{$R *.DFM}

procedure TForm1.FormShow(Sender: TObject);
begin
WPath := ExtractFilePath(Application.ExeName);
Tree.Items[0].Item[0].Selected := True;
Label2.Caption := 'Version ' + FR_VERSION;
end;

procedure TForm1.DesignBClick(Sender: TObject);
begin
frxReport1.DesignReport;
end;

procedure TForm1.PreviewBClick(Sender: TObject);
begin
frxReport1.ShowReport;
end;

procedure TForm1.TreeCustomDrawItem(Sender: TCustomTreeView;
Node: TTreeNode;
State: TCustomDrawState;
var DefaultDraw: Boolean);
begin
if Node.Count <> 0 then
Tree.Canvas.Font.Style := [fsBold];
end;

procedure TForm1.TreeChange(Sender: TObject;
Node: TTreeNode);
begin
if Node.StateIndex = -1 then
begin
Tree.FullCollapse;
Node[0].Selected := True;
end
else
begin
DesignB.Enabled := True;
PreviewB.Enabled := True;
frxReport1.LoadFromFile(WPath + IntToStr(Node.StateIndex) + '.fr3');
DescriptionM.Lines := frxReport1.ReportOptions.Description;
end;
end;

end.
*******************************************************************************
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
frxDBSet, DBTables, Db, frxClass;
type
TReportData = class(TDataModule)
Customers: TTable;
CustomersCustNo: TFloatField;
CustomersCompany: TStringField;
CustomersAddr1: TStringField;
CustomersAddr2: TStringField;
CustomersCity: TStringField;
CustomersState: TStringField;
CustomersZip: TStringField;
CustomersCountry: TStringField;
CustomersPhone: TStringField;
CustomersFAX: TStringField;
CustomersTaxRate: TFloatField;
CustomersContact: TStringField;
CustomersLastInvoiceDate: TDateTimeField;
Orders: TTable;
OrdersOrderNo: TFloatField;
OrdersCustNo: TFloatField;
OrdersCustCompany: TStringField;
OrdersSaleDate: TDateTimeField;
OrdersShipDate: TDateTimeField;
OrdersEmpNo: TIntegerField;
OrdersShipToContact: TStringField;
OrdersShipToAddr1: TStringField;
OrdersShipToAddr2: TStringField;
OrdersShipToCity: TStringField;
OrdersShipToState: TStringField;
OrdersShipToZip: TStringField;
OrdersShipToCountry: TStringField;
OrdersShipToPhone: TStringField;
OrdersShipVIA: TStringField;
OrdersPO: TStringField;
OrdersTerms: TStringField;
OrdersPaymentMethod: TStringField;
OrdersItemsTotal: TCurrencyField;
OrdersTaxRate: TFloatField;
OrdersFreight: TCurrencyField;
OrdersAmountPaid: TCurrencyField;
LineItems: TTable;
LineItemsOrderNo: TFloatField;
LineItemsItemNo: TFloatField;
LineItemsPartNo: TFloatField;
LineItemsPartName: TStringField;
LineItemsQty: TIntegerField;
LineItemsPrice: TCurrencyField;
LineItemsDiscount: TFloatField;
LineItemsTotal: TCurrencyField;
LineItemsExtendedPrice: TCurrencyField;
Parts: TTable;
PartsPartNo: TFloatField;
PartsVendorNo: TFloatField;
PartsDescription: TStringField;
PartsOnHand: TFloatField;
PartsOnOrder: TFloatField;
PartsCost: TCurrencyField;
PartsListPrice: TCurrencyField;
CustomerSource: TDataSource;
OrderSource: TDataSource;
LineItemSource: TDataSource;
PartSource: TDataSource;
RepQuery: TQuery;
RepQueryCustNo: TFloatField;
RepQueryCompany: TStringField;
RepQueryAddr1: TStringField;
RepQueryAddr2: TStringField;
RepQueryCity: TStringField;
RepQueryState: TStringField;
RepQueryZip: TStringField;
RepQueryCountry: TStringField;
RepQueryPhone: TStringField;
RepQueryFAX: TStringField;
RepQueryTaxRate: TFloatField;
RepQueryContact: TStringField;
RepQueryLastInvoiceDate: TDateTimeField;
RepQueryOrderNo: TFloatField;
RepQueryCustNo_1: TFloatField;
RepQuerySaleDate: TDateTimeField;
RepQueryShipDate: TDateTimeField;
RepQueryEmpNo: TIntegerField;
RepQueryShipToContact: TStringField;
RepQueryShipToAddr1: TStringField;
RepQueryShipToAddr2: TStringField;
RepQueryShipToCity: TStringField;
RepQueryShipToState: TStringField;
RepQueryShipToZip: TStringField;
RepQueryShipToCountry: TStringField;
RepQueryShipToPhone: TStringField;
RepQueryShipVIA: TStringField;
RepQueryPO: TStringField;
RepQueryTerms: TStringField;
RepQueryPaymentMethod: TStringField;
RepQueryItemsTotal: TCurrencyField;
RepQueryTaxRate_1: TFloatField;
RepQueryFreight: TCurrencyField;
RepQueryAmountPaid: TCurrencyField;
RepQueryOrderNo_1: TFloatField;
RepQueryItemNo: TFloatField;
RepQueryPartNo: TFloatField;
RepQueryQty: TIntegerField;
RepQueryDiscount: TFloatField;
RepQueryPartNo_1: TFloatField;
RepQueryVendorNo: TFloatField;
RepQueryDescription: TStringField;
RepQueryOnHand: TFloatField;
RepQueryOnOrder: TFloatField;
RepQueryCost: TCurrencyField;
RepQueryListPrice: TCurrencyField;
RepQuerySource: TDataSource;
CustomersDS: TfrxDBDataset;
OrdersDS: TfrxDBDataset;
ItemsDS: TfrxDBDataset;
PartDS: TfrxDBDataset;
QueryDS: TfrxDBDataset;
Bio: TTable;
BioSource: TDataSource;
BioDS: TfrxDBDataset;
Country: TTable;
CountrySource: TDataSource;
CountryDS: TfrxDBDataset;
Cross: TTable;
CrossSource: TDataSource;
CrossDS: TfrxDBDataset;
procedure DataModuleCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
ReportData: TReportData;
implementation
{$R *.DFM}
procedure TReportData.DataModuleCreate(Sender: TObject);
begin
Cross.DatabaseName := ExtractFilePath(Application.ExeName);
end;

end.
*******************************************************************************
program FRDemo;
uses
Forms,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {ReportData: TDataModule};
{$R *.RES}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TReportData, ReportData);
Application.Run;
end.
**********************************************************************
谁看到了如何连接告诉我,好吗?
还有,好像他调用共享代码,但我不知如何看和在那里看。谢谢!
 
進入設計狀態,選擇Report-->Data,你可看到報表連接的所有frxDBDataSet(前面打勾的)
雙擊數據帶,你可看到該數據帶連接的frxDBDataSet。
------------
也就是說你的界面上有多少個frxDBDataSet,都會在報表中顯示出來,具體你要用哪一個,
通過設置來選擇。
 
这个我看到了,可是我还是不明白,
是这样的,在datamoudle上总共放了七个table和一个query,而且table的名字和表名意义对应,我可以从这里点击,从report-->data,可我不明白这个table如何给着frxreport连接的,还是不明白,如果要动态添加有如何?不明白,关键是从代码处没看到这些。[?]
 
同意lucarl兄的意见,我也有同感,那怎么办呢?望各位帮一把
 
frxReport是通過frxDBDataSet來連接數據集或數據源的,也就是你的table和query,
看看frxDBDataSet是DataSet屬性或DataSource屬性吧。
 
时在fastreport3.0的例子中,那个main例子,我们先达成一个共识
不管我们怎么连,用frxDBDataSet.dataset:=tabel1,然后frxReport.dataset:=frxDBDataSet,这样说对吗?
如果不对,兄台请指正。反之,我想问frxReport.dataset:=frxDBDataSet在这个例子中
在那里我没有看到。
unit Unit1;//这是一个报表单元
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Db, DBTables, frxDesgn, frxClass, frxDCtrl,
frxChart, frxRich, frxBarcode, ImgList, ComCtrls, ExtCtrls, frxOLE,
frxCross, frxDMPExport, frxExportImage, frxExportRTF, frxExportTXT,
frxExportXML, frxExportXLS, frxExportHTML, frxGZip, frxExportPDF,
frxBDEComponents, frxChBox
代码:
;//这里没有引用unit2,也就是说没有连frxreport 
type
  TForm1 = class(TForm)
    DesignB: TButton;
    frxDesigner1: TfrxDesigner;
    frxBarCodeObject1: TfrxBarCodeObject;
    frxRichObject1: TfrxRichObject;
    frxChartObject1: TfrxChartObject;
    frxDialogControls1: TfrxDialogControls;
    Tree: TTreeView;
    ImageList1: TImageList;
    PreviewB: TButton;
    DescriptionM: TMemo;
    Image1: TImage;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    frxOLEObject1: TfrxOLEObject;
    frxCrossObject1: TfrxCrossObject;
    frxBDEComponents1: TfrxBDEComponents;
    frxDotMatrixExport1: TfrxDotMatrixExport;
    frxBMPExport1: TfrxBMPExport;
    frxJPEGExport1: TfrxJPEGExport;
    frxTIFFExport1: TfrxTIFFExport;
    frxTXTExport1: TfrxTXTExport;
    frxHTMLExport1: TfrxHTMLExport;
    frxXLSExport1: TfrxXLSExport;
    frxXMLExport1: TfrxXMLExport;
    frxRTFExport1: TfrxRTFExport;
    frxGZipCompressor1: TfrxGZipCompressor;
    frxPDFExport1: TfrxPDFExport;
    Label4: TLabel;
    frxCheckBoxObject1: TfrxCheckBoxObject;
    frxReport1: TfrxReport;
    procedure DesignBClick(Sender: TObject);
    procedure TreeCustomDrawItem(Sender: TCustomTreeView;
Node: TTreeNode;
      State: TCustomDrawState;
var DefaultDraw: Boolean);
    procedure PreviewBClick(Sender: TObject);
    procedure TreeChange(Sender: TObject;
Node: TTreeNode);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
    WPath: String;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
implementation
           //这里没有引用unit2,也就是说没有连frxreport
{$R *.DFM}

procedure TForm1.FormShow(Sender: TObject);
begin
  WPath := ExtractFilePath(Application.ExeName);
  Tree.Items[0].Item[0].Selected := True;
  Label2.Caption := 'Version ' + FR_VERSION;
end;

procedure TForm1.DesignBClick(Sender: TObject);
begin
  frxReport1.DesignReport;
end;

procedure TForm1.PreviewBClick(Sender: TObject);
begin
  frxReport1.ShowReport;
end;

procedure TForm1.TreeCustomDrawItem(Sender: TCustomTreeView;
  Node: TTreeNode;
State: TCustomDrawState;
var DefaultDraw: Boolean);
begin
  if Node.Count <> 0 then
    Tree.Canvas.Font.Style := [fsBold];
end;

procedure TForm1.TreeChange(Sender: TObject;
Node: TTreeNode);
begin
  if Node.StateIndex = -1 then
  begin
    Tree.FullCollapse;
    Node[0].Selected := True;
  end
  else
  begin
    DesignB.Enabled := True;
    PreviewB.Enabled := True;
    frxReport1.LoadFromFile(WPath + IntToStr(Node.StateIndex) + '.fr3');
    DescriptionM.Lines := frxReport1.ReportOptions.Description;
  end;
end;

end.
*******************************************************************************
unit Unit2;//这是一个远程数据单元DataModule,可这里没有连frxreport
interface
uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  frxDBSet, DBTables, Db, frxClass;
type
  TReportData = class(TDataModule)
    Customers: TTable;
    CustomersCustNo: TFloatField;
    CustomersCompany: TStringField;
    CustomersAddr1: TStringField;
    CustomersAddr2: TStringField;
    CustomersCity: TStringField;
    CustomersState: TStringField;
    CustomersZip: TStringField;
    CustomersCountry: TStringField;
    CustomersPhone: TStringField;
    CustomersFAX: TStringField;
    CustomersTaxRate: TFloatField;
    CustomersContact: TStringField;
    CustomersLastInvoiceDate: TDateTimeField;
    Orders: TTable;
    OrdersOrderNo: TFloatField;
    OrdersCustNo: TFloatField;
    OrdersCustCompany: TStringField;
    OrdersSaleDate: TDateTimeField;
    OrdersShipDate: TDateTimeField;
    OrdersEmpNo: TIntegerField;
    OrdersShipToContact: TStringField;
    OrdersShipToAddr1: TStringField;
    OrdersShipToAddr2: TStringField;
    OrdersShipToCity: TStringField;
    OrdersShipToState: TStringField;
    OrdersShipToZip: TStringField;
    OrdersShipToCountry: TStringField;
    OrdersShipToPhone: TStringField;
    OrdersShipVIA: TStringField;
    OrdersPO: TStringField;
    OrdersTerms: TStringField;
    OrdersPaymentMethod: TStringField;
    OrdersItemsTotal: TCurrencyField;
    OrdersTaxRate: TFloatField;
    OrdersFreight: TCurrencyField;
    OrdersAmountPaid: TCurrencyField;
    LineItems: TTable;
    LineItemsOrderNo: TFloatField;
    LineItemsItemNo: TFloatField;
    LineItemsPartNo: TFloatField;
    LineItemsPartName: TStringField;
    LineItemsQty: TIntegerField;
    LineItemsPrice: TCurrencyField;
    LineItemsDiscount: TFloatField;
    LineItemsTotal: TCurrencyField;
    LineItemsExtendedPrice: TCurrencyField;
    Parts: TTable;
    PartsPartNo: TFloatField;
    PartsVendorNo: TFloatField;
    PartsDescription: TStringField;
    PartsOnHand: TFloatField;
    PartsOnOrder: TFloatField;
    PartsCost: TCurrencyField;
    PartsListPrice: TCurrencyField;
    CustomerSource: TDataSource;
    OrderSource: TDataSource;
    LineItemSource: TDataSource;
    PartSource: TDataSource;
    RepQuery: TQuery;
    RepQueryCustNo: TFloatField;
    RepQueryCompany: TStringField;
    RepQueryAddr1: TStringField;
    RepQueryAddr2: TStringField;
    RepQueryCity: TStringField;
    RepQueryState: TStringField;
    RepQueryZip: TStringField;
    RepQueryCountry: TStringField;
    RepQueryPhone: TStringField;
    RepQueryFAX: TStringField;
    RepQueryTaxRate: TFloatField;
    RepQueryContact: TStringField;
    RepQueryLastInvoiceDate: TDateTimeField;
    RepQueryOrderNo: TFloatField;
    RepQueryCustNo_1: TFloatField;
    RepQuerySaleDate: TDateTimeField;
    RepQueryShipDate: TDateTimeField;
    RepQueryEmpNo: TIntegerField;
    RepQueryShipToContact: TStringField;
    RepQueryShipToAddr1: TStringField;
    RepQueryShipToAddr2: TStringField;
    RepQueryShipToCity: TStringField;
    RepQueryShipToState: TStringField;
    RepQueryShipToZip: TStringField;
    RepQueryShipToCountry: TStringField;
    RepQueryShipToPhone: TStringField;
    RepQueryShipVIA: TStringField;
    RepQueryPO: TStringField;
    RepQueryTerms: TStringField;
    RepQueryPaymentMethod: TStringField;
    RepQueryItemsTotal: TCurrencyField;
    RepQueryTaxRate_1: TFloatField;
    RepQueryFreight: TCurrencyField;
    RepQueryAmountPaid: TCurrencyField;
    RepQueryOrderNo_1: TFloatField;
    RepQueryItemNo: TFloatField;
    RepQueryPartNo: TFloatField;
    RepQueryQty: TIntegerField;
    RepQueryDiscount: TFloatField;
    RepQueryPartNo_1: TFloatField;
    RepQueryVendorNo: TFloatField;
    RepQueryDescription: TStringField;
    RepQueryOnHand: TFloatField;
    RepQueryOnOrder: TFloatField;
    RepQueryCost: TCurrencyField;
    RepQueryListPrice: TCurrencyField;
    RepQuerySource: TDataSource;
    CustomersDS: TfrxDBDataset;
    OrdersDS: TfrxDBDataset;
    ItemsDS: TfrxDBDataset;
    PartDS: TfrxDBDataset;
    QueryDS: TfrxDBDataset;
    Bio: TTable;
    BioSource: TDataSource;
    BioDS: TfrxDBDataset;
    Country: TTable;
    CountrySource: TDataSource;
    CountryDS: TfrxDBDataset;
    Cross: TTable;
    CrossSource: TDataSource;
    CrossDS: TfrxDBDataset;
    procedure DataModuleCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  ReportData: TReportData;
implementation
{$R *.DFM}
procedure TReportData.DataModuleCreate(Sender: TObject);
begin
  Cross.DatabaseName := ExtractFilePath(Application.ExeName);
end;

end.
*******************************************************************************
program FRDemo;
uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {ReportData: TDataModule};
{$R *.RES}
begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TReportData, ReportData);
  Application.Run;
end.
那么问题在那呢?
 
后退
顶部