各位DFW,中秋节快乐!问个FasterReport的问题!请大家进来看看.(50分)

  • 主题发起人 主题发起人 zouzujun
  • 开始时间 开始时间
Z

zouzujun

Unregistered / Unconfirmed
GUEST, unregistred user!
v:=TfrMemoView.Create;
//数据项
v.SetBounds(10,20,60,20);
v.Memo.Add('[q_fr."'+str+'"]');
// 我想在这设置该memo的显示格式,
// 就象我在界面设置时可以在它的displayformat属性中设置它的格式一样
// 请各位高手指点指点!
page.Objects.Add(v);
 
来自FastReport中的FAQ.TXT.
2.31. 如何从Delphi中访问报表对象?
FR 对象不是组件,访问方法如下:
var
t: TfrMemoView;
begin
t := TfrMemoView(frReport1.FindObject('Memo1'));
if t <> nil then
t.Memo.Text := 'FastReport';
// 或者这样:
if t <> nil then
t.Prop['Memo'] := 'FastReport';
end;
 
已回答,见
http://www.delphibbs.com/delphibbs/dispq.asp?lid=2170182
 
可能我没说明白.
我想知道怎么设置显示格式,不是设置字体格式.
例如:我这个memo要显示的是数字,我想让它小数点后保留两位小数.
我想应该是v.Prop['displayformat.?'] :=? 但问号处我不知到怎么写?
 
我试了一下,确实不好弄,建议你在形成记录集(SQL)时提前搞好。
[DialogForm.YourQuery./"FloatField/" #N,##0.000]
 
我复制了几个帖子,可能对你有用。
-------------------------------
Arthur: Formatting variables(16 Jan 2003 09am:13:24)
Hi Guys, I have the following....
v := TfrMemoView.Create;
v.SetBounds(xNew, 104, dx, 18);

Howdo
I numeric fields at runtime. I've tried the following, but nothing happens.
v.Prop['DisplayFormat'] := '0.00'
any help would be apreciated.
TIA
Arthur

--------------------------------------------------------------------------------

Teo (21 Jan 2003 09:18:19)
Hello Arthur,
You could try FormatStr function for that. The second argument of the function would be the fieldname.

--------------------------------------------------------------------------------

gord knight (21 Jan 2003 20:40:15)
Hi Arthur
the DisplayFormat is not directly accessable
IMHO due to the peculiarities of its editor.
the actual prop for tfrmemoview is format and it is an integer value (result of several calculations) so you will never know the value.
Teo is right where adding the text to the memo
contents encloseit with a known Fr function.
[formatfloat(<formatmask>,<Numeric>)]
regards
gord

--------------------------------------------------------------------------------

Teo (21 Jan 2003 21:32:42)
There is a second option: if you want to set this at runtime, you could try a variable in the frMemo which you set like other variables. Ido
n't know if this works but it's worth the try.

 
谢了ty123,按[DialogForm.YourQuery./"FloatField/" #N,##0.000] 这种方法解决了.
两个地方问的分都送你了!
 
多人接受答案了。
 
后退
顶部