请问,如何动态的在FastReport预览时设置纸张的大小和页边距? rt?在线等待 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我在frReport1ManualBuild中写了: Page.LeftMargin := 10; Page.RightMargin := 10; Page.TopMargin := 10; Page.BottomMargin := 10;但是出错了,不知为什么??? 如何在frReport1中动态画Shape呢? Page.LeftMargin := 10.00mm;是不是少了单位?page.pagesize:=a4;//设置大小 //控制页边距 frReport1.Pages.Clear; frReport1.Pages.Add; // create page Page := frReport1.Pages[0]; Page.pgMargins.Left := strtoint(Edit4.Text);//此句在预浏中,体现不出来,为什么? Page.pgMargins.Right := strtoint(Edit5.Text);//此句在预浏中,体现不出来,为什么? Page.pgMargins.Top := strtoint(Edit2.Text); Page.pgMargins.Bottom := strtoint(Edit3.Text);//报表标题 b := TfrBandView.Create; // create Title band b.SetBounds(0, 20, 0, 20); // position and size in pixels b.BandType := btReportTitle; // (only Top and Height are significant Page.Objects.Add(b); // for the band) v := TfrMemoView.Create; // create memo v.SetBounds(20, 20, 200, 16); v.BandAlign := baWidth; v.Prop['Alignment'] := frtaCenter; // another way to access properties v.Prop['Font.Style'] := 2; v.Memo.Add(MyVar + '仓库库存数量'); Page.Objects.Add(v);//报表字段名{ b := TfrBandView.Create; b.SetBounds(0,40,0,20); b.BandType := btPageHeader; // b.BandType := btReportTitle; Page.Objects.Add(b);for i:=0 to ListBox6.Items.Count-1 dobegin v := TfrMemoView.Create; s := TfrShapeView.Create; v.SetBounds(20+(100*i),40,100,16); s.SetBounds(20+(100*i),40,100,20); v.Prop['Font.Style'] := 2; //Showmessage(Listbox6.Items.GetText[i]); v.Memo.Add(Listbox6.Items[i]); Page.Objects.Add(s); Page.Objects.Add(v);end;}//报表数据 b := TfrBandView.Create; // create MasterData band b.SetBounds(0, 60, 0, 20); b.BandType := btMasterData; b.Dataset := 'frDBDataSet1'; // band's dataset Page.Objects.Add(b);//字段一for i:=0 to ListBox6.Items.Count-1 dobegin FieldName :=Listbox6.Items[i]; if FieldName = '库存数量' then FieldName := 'SumTotal'; v := TfrMemoView.Create; // create data field s := TfrShapeView.Create; v.SetBounds(20+(100*i), 60, 100, 16); s.SetBounds(20+(100*i),60,100,20); v.Memo.Add('[ADODataSet1'+'."'+FieldName+'"'+']'); //v.Memo.Add('[ADODataSet1."货号"]'); // v.Memo.Add('[i]'); Page.Objects.Add(s); Page.Objects.Add(v);end;//预浏报表 frReport1.ShowReport;以上报表程序如果屏蔽了从<//报表字段名>到<报表数据>这段程序,预浏时就可以根据frDBDataSet1得到多条数据,而如果加了上了从<//报表字段名>到<报表数据>这段程序,这数据就只出现一条啊!为什么,请教高手? 如何判断可见字符 Unicode delphi listview如何显示图标 关于处理jpg图片的问题,有谁做过请帮忙,在线等! DLL里的ActionList的快捷键设置问题..急 把Access SQl语句改成sql server 2000的 语句 两个简单问题 创建VCL出现的问题:动态创建的对象不能动态赋给事件,请高手相助。 请问哪有Delphi6下呀(不是试用版)!!! 百万奖给软件奇才! ADOdataset 无法删除记录! 提示是commandtext 无法返回结果 小小SELECT问题,谢谢给予解决!!!!!
Page.LeftMargin := 10;
Page.RightMargin := 10;
Page.TopMargin := 10;
Page.BottomMargin := 10;
但是出错了,不知为什么???
frReport1.Pages.Clear;
frReport1.Pages.Add; // create page
Page := frReport1.Pages[0];
Page.pgMargins.Left := strtoint(Edit4.Text);//此句在预浏中,体现不出来,为什么?
Page.pgMargins.Right := strtoint(Edit5.Text);//此句在预浏中,体现不出来,为什么?
Page.pgMargins.Top := strtoint(Edit2.Text);
Page.pgMargins.Bottom := strtoint(Edit3.Text);
//报表标题
b := TfrBandView.Create; // create Title band
b.SetBounds(0, 20, 0, 20); // position and size in pixels
b.BandType := btReportTitle; // (only Top and Height are significant
Page.Objects.Add(b); // for the band)
v := TfrMemoView.Create; // create memo
v.SetBounds(20, 20, 200, 16);
v.BandAlign := baWidth;
v.Prop['Alignment'] := frtaCenter; // another way to access properties
v.Prop['Font.Style'] := 2;
v.Memo.Add(MyVar + '仓库库存数量');
Page.Objects.Add(v);//报表字段名
{
b := TfrBandView.Create;
b.SetBounds(0,40,0,20);
b.BandType := btPageHeader;
// b.BandType := btReportTitle;
Page.Objects.Add(b);
for i:=0 to ListBox6.Items.Count-1 do
begin
v := TfrMemoView.Create;
s := TfrShapeView.Create;
v.SetBounds(20+(100*i),40,100,16);
s.SetBounds(20+(100*i),40,100,20);
v.Prop['Font.Style'] := 2;
//Showmessage(Listbox6.Items.GetText[i]);
v.Memo.Add(Listbox6.Items[i]);
Page.Objects.Add(s);
Page.Objects.Add(v);
end;
}
//报表数据
b := TfrBandView.Create; // create MasterData band
b.SetBounds(0, 60, 0, 20);
b.BandType := btMasterData;
b.Dataset := 'frDBDataSet1'; // band's dataset
Page.Objects.Add(b);
//字段一
for i:=0 to ListBox6.Items.Count-1 do
begin
FieldName :=Listbox6.Items[i];
if FieldName = '库存数量' then
FieldName := 'SumTotal';
v := TfrMemoView.Create; // create data field
s := TfrShapeView.Create;
v.SetBounds(20+(100*i), 60, 100, 16);
s.SetBounds(20+(100*i),60,100,20);
v.Memo.Add('[ADODataSet1'+'."'+FieldName+'"'+']');
//v.Memo.Add('[ADODataSet1."货号"]');
// v.Memo.Add('[i]');
Page.Objects.Add(s);
Page.Objects.Add(v);
end;
//预浏报表
frReport1.ShowReport;
以上报表程序如果屏蔽了从<//报表字段名>到<报表数据>这段程序,
预浏时就可以根据frDBDataSet1得到多条数据,
而如果加了上了从<//报表字段名>到<报表数据>这段程序,
这数据就只出现一条啊!
为什么,请教高手?