fastreport的动态生成问题

blueshu 2003-09-22 09:51:38
1、Demo中的runtime的例子不全,哪位能给个全一点的例子如有
pageheader,pagefooter等等
2、怎么样给TfrBandView的onbeforeprint事件赋事件
就是动态的在程序中写?我没找到这个东东
msn:huhao618@163.com
...全文
127 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
wzds2000 2003-09-22
  • 打赏
  • 举报
回复
学习,顶。。。
blueshu 2003-09-22
  • 打赏
  • 举报
回复
楼上的怎么联系啊?
blueshu 2003-09-22
  • 打赏
  • 举报
回复
楼上的继续搞定第二个问题啊
WWWWA 2003-09-22
  • 打赏
  • 举报
回复
var
t: TfrbandView;
begin
t := TfrbandView(frReport1.FindObject('masterdata1'));
if t <> nil then begin showmessage('123');
t.Script.Add('memo1.memo:="123"');end;
测试通过
WWWWA 2003-09-22
  • 打赏
  • 举报
回复
第二个问题在DEMO中没有找到答案
ujjcel 2003-09-22
  • 打赏
  • 举报
回复
楼上正是我所想知道的,关注.
zjm107 2003-09-22
  • 打赏
  • 举报
回复
楼上的写的不错,试一试吧
WWWWA 2003-09-22
  • 打赏
  • 举报
回复
var
v: TfrView;
b: TfrBandView;t3:tfrlineview;
Page: TfrPage;t2:tfrpictureview;
t: TfrshapeView;t1:tfrbarcodeview;
begin
frReport1.LoadFromFile('d:\rsc\try.frf');
Page := frReport1.Pages[0];
v := TfrEditControl.Create; // create editbox
v.SetBounds(60, 50, 75, 21);
v.Name := 'Edit1';
Page.Objects.Add(v);

v := TfrButtonControl.Create; // create button
v.SetBounds(60, 100, 75, 25);
TfrButtonControl(v).Button.Caption := 'Test!';
TfrButtonControl(v).Button.Font.Name:='隶书';
TfrButtonControl(v).Button.ModalResult := mrOk;
Page.Objects.Add(v);

v := Tfrcheckboxcontrol.Create; // create editbox
v.SetBounds(60, 150, 115, 21);
v.Name := 'checkbox1';
Tfrcheckboxcontrol(v).CheckBox.Caption:='姓名不同是否翻页?';
Tfrcheckboxcontrol(v).CheckBox.Checked:=true;
Page.Objects.Add(v);

v := Tfrradiobuttoncontrol.Create; // create editbox
v.SetBounds(250, 150, 100, 21);
v.Name := 'ra1';
Tfrradiobuttoncontrol(v).RadioButton.Checked:=true;
Page.Objects.Add(v);

v := Tfrcomboboxcontrol.Create; // create editbox
v.SetBounds(60, 200, 75, 21);
v.Name := 'com1';
Tfrcomboboxcontrol(v).ComboBox.Items.Add('123');
Tfrcomboboxcontrol(v).ComboBox.Items.Add('456');
Tfrcomboboxcontrol(v).ComboBox.Style:=csDropDownList;
Tfrcomboboxcontrol(v).ComboBox.ItemIndex:=0;
Page.Objects.Add(v);

Page := frReport1.Pages[1];
b := TfrBandView.Create; // create Title band
b.SetBounds(0,88,757,20); // position and size in pixels
b.BandType := btReportTitle; // (only Top and Height are significant
Page.Objects.Add(b);
// for the band)
b := TfrBandView.Create; // create Title band
b.SetBounds(0,112,757,20); // position and size in pixels
b.BandType := btpageheader; // (only Top and Height are significant
Page.Objects.Add(b);

v := TfrMemoView.Create; // create memo
v.SetBounds(280, 20, 112, 20);
v.BandAlign := baWidth;
v.Prop['Alignment'] := frtaCenter; // another way to access properties
v.Prop['Font.Style'] := 2;
v.Memo.Add('Your text is: zw');
Page.Objects.Add(v);

v := TfrMemoView.Create; // create memo
v.SetBounds(220,64,96,20);
v.BandAlign := baWidth;
v.Prop['Alignment'] := frtaCenter; // another way to access properties
v.Prop['Font.Style'] := 2;
v.Memo.Add('Your text is: zw1');
Page.Objects.Add(v);

v := TfrpictureView.Create; // create memo
v.SetBounds(352,68,96,20);
//v.BandAlign := baWidth;
v.Prop['Alignment'] := frtaCenter; // another way to access properties
v.Prop['Font.Style'] := 2;
v.Name:='zz';
//v.Memo.Add('Your text is: zw1');
Page.Objects.Add(v);

v := TfrMemoView.Create; // create memo
v.SetBounds(260,88,96,20);
v.BandAlign := baWidth;
v.Prop['Alignment'] := frtaCenter; // another way to access properties
v.Prop['Font.Style'] := 2;
v.Memo.Add('Your text is: zw2');
Page.Objects.Add(v);

v := TfrMemoView.Create; // create memo
v.SetBounds(236, 112, 112, 20);
v.BandAlign := baWidth;
v.Prop['Alignment'] := frtaCenter; // another way to access properties
v.Prop['Font.Style'] := 2;
v.Memo.Add('Your text is: zw3');
Page.Objects.Add(v);

v:=tfrshapeview.Create;
v.SetBounds(328,20,96,20);
v.Name:='shape2';
Page.Objects.Add(v);

v:=tfrlineview.Create;
v.SetBounds(200,20,0,20);
v.Name:='line1';
Page.Objects.Add(v);

v:=tfrbarcodeview.Create;
v.SetBounds(444,20,142,20);
v.Name:='barcode1';
Page.Objects.Add(v);

v := TfrMemoView.Create; // create memo
v.SetBounds(150, 20, 96, 20);
//v.BandAlign := baWidth;
v.Prop['Alignment'] := frtaCenter; // another way to access properties
v.Prop['Font.Style'] := 2;
v.Memo.Add('[dialogform.query1.sfgz]');
Page.Objects.Add(v);

t1:= TfrbarcodeView(frReport1.FindObject('barcode1'));
if t1<>nil then t1.Memo.clear;t1.Memo.Add('[dialogform.query1.bh]');

t2:= TfrpictureView(frReport1.FindObject('zz'));
if t2<>nil then t2.Picture.LoadFromFile('d:\rsc\normal.ico');

t:= TfrshapeView(frReport1.FindObject('shape2'));
if t<>nil then t.ShapeType:=skDiagonal1;

t3:= TfrlineView(frReport1.FindObject('line1'));
if t3<>nil then t3.FrameWidth:=10;

frReport1.ShowReport;
end;

end.
WWWWA 2003-09-22
  • 打赏
  • 举报
回复
var
v: TfrView;
b: TfrBandView;t3:tfrlineview;
Page: TfrPage;t2:tfrpictureview;
t: TfrshapeView;t1:tfrbarcodeview;
begin
frReport1.LoadFromFile('d:\rsc\try.frf');
Page := frReport1.Pages[0];
v := TfrEditControl.Create; // create editbox
v.SetBounds(60, 50, 75, 21);
v.Name := 'Edit1';
Page.Objects.Add(v);

v := TfrButtonControl.Create; // create button
v.SetBounds(60, 100, 75, 25);
TfrButtonControl(v).Button.Caption := 'Test!';
TfrButtonControl(v).Button.Font.Name:='隶书';
TfrButtonControl(v).Button.ModalResult := mrOk;
Page.Objects.Add(v);

v := Tfrcheckboxcontrol.Create; // create editbox
v.SetBounds(60, 150, 115, 21);
v.Name := 'checkbox1';
Tfrcheckboxcontrol(v).CheckBox.Caption:='姓名不同是否翻页?';
Tfrcheckboxcontrol(v).CheckBox.Checked:=true;
Page.Objects.Add(v);

v := Tfrradiobuttoncontrol.Create; // create editbox
v.SetBounds(250, 150, 100, 21);
v.Name := 'ra1';
Tfrradiobuttoncontrol(v).RadioButton.Checked:=true;
Page.Objects.Add(v);

v := Tfrcomboboxcontrol.Create; // create editbox
v.SetBounds(60, 200, 75, 21);
v.Name := 'com1';
Tfrcomboboxcontrol(v).ComboBox.Items.Add('123');
Tfrcomboboxcontrol(v).ComboBox.Items.Add('456');
Tfrcomboboxcontrol(v).ComboBox.Style:=csDropDownList;
Tfrcomboboxcontrol(v).ComboBox.ItemIndex:=0;
Page.Objects.Add(v);

Page := frReport1.Pages[1];
b := TfrBandView.Create; // create Title band
b.SetBounds(0,88,757,20); // position and size in pixels
b.BandType := btReportTitle; // (only Top and Height are significant
Page.Objects.Add(b);
// for the band)
b := TfrBandView.Create; // create Title band
b.SetBounds(0,112,757,20); // position and size in pixels
b.BandType := btpageheader; // (only Top and Height are significant
Page.Objects.Add(b);

v := TfrMemoView.Create; // create memo
v.SetBounds(280, 20, 112, 20);
v.BandAlign := baWidth;
v.Prop['Alignment'] := frtaCenter; // another way to access properties
v.Prop['Font.Style'] := 2;
v.Memo.Add('Your text is: zw');
Page.Objects.Add(v);

v := TfrMemoView.Create; // create memo
v.SetBounds(220,64,96,20);
v.BandAlign := baWidth;
v.Prop['Alignment'] := frtaCenter; // another way to access properties
v.Prop['Font.Style'] := 2;
v.Memo.Add('Your text is: zw1');
Page.Objects.Add(v);

v := TfrpictureView.Create; // create memo
v.SetBounds(352,68,96,20);
//v.BandAlign := baWidth;
v.Prop['Alignment'] := frtaCenter; // another way to access properties
v.Prop['Font.Style'] := 2;
v.Name:='zz';
//v.Memo.Add('Your text is: zw1');
Page.Objects.Add(v);

v := TfrMemoView.Create; // create memo
v.SetBounds(260,88,96,20);
v.BandAlign := baWidth;
v.Prop['Alignment'] := frtaCenter; // another way to access properties
v.Prop['Font.Style'] := 2;
v.Memo.Add('Your text is: zw2');
Page.Objects.Add(v);

v := TfrMemoView.Create; // create memo
v.SetBounds(236, 112, 112, 20);
v.BandAlign := baWidth;
v.Prop['Alignment'] := frtaCenter; // another way to access properties
v.Prop['Font.Style'] := 2;
v.Memo.Add('Your text is: zw3');
Page.Objects.Add(v);

v:=tfrshapeview.Create;
v.SetBounds(328,20,96,20);
v.Name:='shape2';
Page.Objects.Add(v);

v:=tfrlineview.Create;
v.SetBounds(200,20,0,20);
v.Name:='line1';
Page.Objects.Add(v);

v:=tfrbarcodeview.Create;
v.SetBounds(444,20,142,20);
v.Name:='barcode1';
Page.Objects.Add(v);

v := TfrMemoView.Create; // create memo
v.SetBounds(150, 20, 96, 20);
//v.BandAlign := baWidth;
v.Prop['Alignment'] := frtaCenter; // another way to access properties
v.Prop['Font.Style'] := 2;
v.Memo.Add('[dialogform.query1.sfgz]');
Page.Objects.Add(v);

t1:= TfrbarcodeView(frReport1.FindObject('barcode1'));
if t1<>nil then t1.Memo.clear;t1.Memo.Add('[dialogform.query1.bh]');

t2:= TfrpictureView(frReport1.FindObject('zz'));
if t2<>nil then t2.Picture.LoadFromFile('d:\rsc\normal.ico');

t:= TfrshapeView(frReport1.FindObject('shape2'));
if t<>nil then t.ShapeType:=skDiagonal1;

t3:= TfrlineView(frReport1.FindObject('line1'));
if t3<>nil then t3.FrameWidth:=10;

frReport1.ShowReport;
end;

end.
内容概要:本文详细介绍了利用Simulink进行变压器开路试验的电路连接配置与仿真实现方法,重点在于通过仿真手段还原实际电力系统中变压器在空载条件下的电气特性,从而深入理解其工作原理与性能表现。文章作为电力系统仿真系列研究的一部分,系统阐述了从电路模型搭建、参数设定、仿真运行到结果分析的完整流程,突出展示了MATLAB/Simulink在电力设备建模与教学科研中的强大功能与应用价值。; 适合人群:具备电力系统基础知识,熟悉MATLAB/Simulink仿真环境,从事电气工程、自动化及相关领域的研发人员,以及高年级本科和研究。; 使用场景及目标:①掌握变压器开路试验的基本原理与Simulink仿真建模的具体步骤;②通过仿真实验深入理解空载电流、铁芯损耗及励磁特性等关键参数的物理意义;③为后续开展变压器短路试验、暂态过程分析以及其他电力设备的仿真研究奠定理论与实践基础。; 阅读建议:建议结合Simulink软件动手实践,逐步构建并调试电路模型,重点关注各元件参数的设置方法与测量模块的应用技巧,同时推荐参考文中提及的其他相关仿真案例进行拓展学习,以全面提升对电力系统仿真实践的整体认知与操作能力。

5,943

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧