Hello,
I just developed a working solution to the same problem a few minutes ago. My problem was that the footer in the table was appearing in random places depending on the number of rows returned. I can fit 7 rows, so I needed to pad out additional rows to equal 7. So, I had to add additional data to the SQL resultset to do this. After my stored procedure produced a resultset, I immediately invoked this function to add more rows before returning to the report. Hope this helps. If anyone has an elegant solution, please post, I would like to implement it!
ALTER FUNCTION [dbo].[fCreateBlankTblRows] 
(
 @.nbrRows //my stored procedure figured out how many rows were returned and how many more were needed.
)
 
RETURNS 
@.my_temp_tbl TABLE 
(
 id int,
 id2 int,
 xyx int 
)
AS
BEGIN
Declare @.loopCount int;
set @.loopCount = 0;
WHILE (@.loopCount < @.nbrRows) 
 Begin
 INSERT INTO @.my_temp_tbl
 (id, id2, xyz)
 VALUES (null,null,null);
 set @.loopCount = @.loopCount + 1; 
 End;
 RETURN 
END
 
No comments:
Post a Comment