Print one row in multiples rows, depending on a value

60 Views Asked by At

thanks on advance for your help.

I want to be able to print one row into multiples rows to print labels, example below.

ItemID Descripcion Qty
052 Orange Juice 300

I want to print 3 lines of the same row, and the numbers of row will be calculated (in this case) by 100, for example, so I want to print this:

ItemID Descripcion Qty
052 Orange Juice 100
052 Orange Juice 100
052 Orange Juice 100

But in the order table, I have one line of row.

Thanks for any help, I'm not sure if this is supported.

2

There are 2 best solutions below

0
Muhammad Saad On

Two ways to do that, Either use Push Method of Crystal Reports i.e. Fill the DataSet object (in code) and pass into Crystal Report as DataSource or make Stored Procedure and push the data in temp table as shown here

declare @i int;
declare @copies int;
select part_code, description
into #temp
from parts

select * into #temp2 from #temp;

set @i = 1;
while @i < {@copies}
begin
  insert into #temp2 select * from #temp;
  set @i = @i + 1;
end;

select * from #temp2;
0
MilletSoftware On

Option 1. if the max quantity is not too large, you can create multiple sections (Details a, Details b, Details c, ...) and use a dynamic suppress condition to hide the sections beyond the quantity value.

Option 2. Create a "REPEATER" table with a single column (How_Many) and rows for 1 | 2 | 3 | 4 | 5 | 6 | ...

Now, in your report, add the REPEATER Table and add a Record Selection condition of

{QTY}/100 >= {Repeater.How_Many}