自己写存储过程就可以了。给你一个方法而已。
fastreport2.5如果是多页的
话是无法实现的,单页就可以。是我给
一个存储过程你参考。
CREATE PROCEDURE w_dycrkmx(@dh char(25)) AS
declare @coun int,@hs int,@i int
set @hs=8 --表示当前页打印8行,
truncate table sys_swslxs_lsb--建要打印的临时表
select @coun=count(*) from sys_swslxs_MX where 单号=@dh
if @coun/@hs*@hs=@coun
begin
insert into sys_swslxs_lsb SELECT * FROM sys_swslxs_MX where 单号=@dh
end
--下面是一个数学算法.
if @coun/@hs=0 and @coun>0
begin
set @i=0
insert into sys_swslxs_lsb SELECT * FROM sys_swslxs_MX where 单号=@dh
while @i<(@hs-@coun)
begin
insert into sys_swslxs_lsb(自动编号)values(1)
set @i=@i+1
end
end
if @coun/@hs>=1
begin
set @i=0
insert into sys_swslxs_lsb SELECT * FROM sys_swslxs_MX where 单号=@dh
while @i<(@hs*(@coun/@hs+1)-@coun)
begin
insert into sys_swslxs_lsb(自动编号)values(1)
set @i=@i+1
end
end
select[材料编号],[材料名称],[型号规格],[单位],cast([数量] as char(12)) as 数量 ,cast([单价] as char(12)) as 单价,cast([金额] as char(15)) as 金额 from sys_swslxs_lsb
GO