Hi lbass,
I've put the following syntax into the reports: -
Main report variables -
whileprintingrecords;
Shared StringVar array f;
Shared StringVar array f1;
Shared StringVar array f2;
Shared StringVar array f3;
Shared StringVar array f4;
Shared StringVar array f5;
Shared StringVar array f6;
Shared StringVar array f7;
Shared StringVar array f8;
Shared StringVar array f9;
Shared StringVar array f10;
Shared StringVar array f11;
Shared StringVar array f12;
Shared StringVar array f13;
Shared StringVar array f14;
Shared StringVar array f15;
Shared StringVar array f16;
Shared StringVar array f17;
Shared StringVar array f18;
NumberVar g:= g + 1;
Numbervar g1;
Numbervar g2;
Numbervar g3;
Numbervar g4;
Numbervar g5;
Numbervar g6;
Numbervar g7;
Numbervar g8;
Numbervar g9;
Numbervar g10;
Numbervar g11;
Numbervar g12;
Numbervar g13;
Numbervar g14;
Numbervar g15;
Numbervar g16;
Numbervar g17;
Numbervar g18;
if g <= 1000 then (
redim preserve f[g];
f[g]:= totext({AccountPool.Id},"0000")
);
if (g > 1000 and g <= 2000) then (
g1 := g1 + 1;
if g1 <= 1000 then(
redim preserve f1[g1];
f1[g1] := totext({AccountPool.Id},"0000"))
);
if (g > 2000 and g <=3000) then (
g2 := g2 + 1;
if g2 <= 1000 then(
redim preserve f2[g2];
f2[g2] := totext({AccountPool.Id},"0000"))
);
if (g > 3000 and g <=4000) then (
g3 := g3 + 1;
if g3 <= 1000 then(
redim preserve f3[g3];
f3[g3] := totext({AccountPool.Id},"0000"))
);
if (g > 4000 and g <=5000) then (
g4 := g4 + 1;
if g4 <= 1000 then(
redim preserve f4[g4];
f4[g4] := totext({AccountPool.Id},"0000"))
);
if (g > 5000 and g <=6000) then (
g5 := g5 + 1;
if g5 <= 1000 then(
redim preserve f5[g5];
f5[g5] := totext({AccountPool.Id},"0000"))
);
if (g > 6000 and g <=7000) then (
g6 := g6 + 1;
if g6 <= 1000 then(
redim preserve f6[g6];
f6[g6] := totext({AccountPool.Id},"0000"))
);
if (g > 7000 and g <=8000) then (
g7 := g7 + 1;
if g7 <= 1000 then(
redim preserve f7[g7];
f7[g7] := totext({AccountPool.Id},"0000"))
);
if (g > 8000 and g <=9000) then (
g8 := g8 + 1;
if g8 <= 1000 then(
redim preserve f8[g8];
f8[g8] := totext({AccountPool.Id},"0000"))
);
if (g > 9000 and g <=10000) then (
g9 := g9 + 1;
if g9 <= 1000 then(
redim preserve f9[g9];
f9[g9] := totext({AccountPool.Id},"0000"))
);
if (g > 10000 and g <=11000) then (
g10 := g10 + 1;
if g10 <= 1000 then(
redim preserve f10[g10];
f10[g10] := totext({AccountPool.Id},"0000"))
);
if (g > 11000 and g <=12000) then (
g11 := g11 + 1;
if g11 <= 1000 then(
redim preserve f11[g11];
f11[g11] := totext({AccountPool.Id},"0000"))
);
if (g > 12000 and g <=13000) then (
g12 := g12 + 1;
if g12 <= 1000 then(
redim preserve f12[g12];
f12[g12] := totext({AccountPool.Id},"0000"))
);
if (g > 13000 and g <=14000) then (
g13 := g13 + 1;
if g13 <= 1000 then(
redim preserve f13[g13];
f13[g13] := totext({AccountPool.Id},"0000"))
);
if (g > 14000 and g <=15000) then (
g14 := g14 + 1;
if g14 <= 1000 then(
redim preserve f14[g14];
f14[g14] := totext({AccountPool.Id},"0000"))
);
if (g > 15000 and g <=16000) then (
g15 := g15 + 1;
if g15 <= 1000 then(
redim preserve f15[g15];
f15[g15] := totext({AccountPool.Id},"0000"))
);
if (g > 16000 and g <=17000) then (
g16 := g16 + 1;
if g16 <= 1000 then(
redim preserve f16[g16];
f16[g16] := totext({AccountPool.Id},"0000"))
);
if (g > 17000 and g <=18000) then (
g17 := g17 + 1;
if g17 <= 1000 then(
redim preserve f17[g17];
f17[g17] := totext({AccountPool.Id},"0000"))
);
if (g > 18000 and g <=19000) then (
g18 := g18 + 1;
if g18 <= 1000 then(
redim preserve f18[g18];
f18[g18] := totext({AccountPool.Id},"0000"))
);
Subreport formula -
whileprintingrecords;
shared stringvar array f;
shared stringvar array f1;
shared stringvar array f2;
shared stringvar array f3;
shared stringvar array f4;
shared stringvar array f5;
shared stringvar array f6;
shared stringvar array f7;
shared stringvar array f8;
shared stringvar array f9;
shared stringvar array f10;
shared stringvar array f11;
shared stringvar array f12;
shared stringvar array f13;
shared stringvar array f14;
shared stringvar array f15;
shared stringvar array f16;
shared stringvar array f17;
shared stringvar array f18;
stringvar h1;
numbervar h2;
for h2 := 1 to ubound(f) do(
if f[h2] = totext({AccountPool.Id},"0000") then
h1 := f[h2]);
for h2 := 1 to ubound(f1) do(
if f1[h2] = totext({AccountPool.Id},"0000") then
h1 := f1[h2]);
for h2 := 1 to ubound(f2) do(
if f2[h2] = totext({AccountPool.Id},"0000") then
h1 := f2[h2]);
for h2 := 1 to ubound(f3) do(
if f3[h2] = totext({AccountPool.Id},"0000") then
h1 := f3[h2]);
for h2 := 1 to ubound(f4) do(
if f4[h2] = totext({AccountPool.Id},"0000") then
h1 := f4[h2]);
for h2 := 1 to ubound(f5) do(
if f5[h2] = totext({AccountPool.Id},"0000") then
h1 := f5[h2]);
for h2 := 1 to ubound(f6) do(
if f6[h2] = totext({AccountPool.Id},"0000") then
h1 := f6[h2]);
for h2 := 1 to ubound(f7) do(
if f7[h2] = totext({AccountPool.Id},"0000") then
h1 := f7[h2]);
for h2 := 1 to ubound(f8) do(
if f8[h2] = totext({AccountPool.Id},"0000") then
h1 := f8[h2]);
for h2 := 1 to ubound(f9) do(
if f9[h2] = totext({AccountPool.Id},"0000") then
h1 := f9[h2]);
for h2 := 1 to ubound(f10) do(
if f10[h2] = totext({AccountPool.Id},"0000") then
h1 := f10[h2]);
for h2 := 1 to ubound(f11) do(
if f11[h2] = totext({AccountPool.Id},"0000") then
h1 := f11[h2]);
for h2 := 1 to ubound(f12) do(
if f12[h2] = totext({AccountPool.Id},"0000") then
h1 := f12[h2]);
for h2 := 1 to ubound(f13) do(
if f13[h2] = totext({AccountPool.Id},"0000") then
h1 := f13[h2]);
for h2 := 1 to ubound(f14) do(
if f14[h2] = totext({AccountPool.Id},"0000") then
h1 := f14[h2]);
for h2 := 1 to ubound(f15) do(
if f15[h2] = totext({AccountPool.Id},"0000") then
h1 := f15[h2]);
for h2 := 1 to ubound(f16) do(
if f16[h2] = totext({AccountPool.Id},"0000") then
h1 := f16[h2]);
for h2 := 1 to ubound(f17) do(
if f17[h2] = totext({AccountPool.Id},"0000") then
h1 := f17[h2]);
for h2 := 1 to ubound(f18) do(
if f18[h2] = totext({AccountPool.Id},"0000") then
h1 := f18[h2]);
val(h1);
When I tab to the last page of the main report all is fine but when it hits the subreport I get the error message "A subscript must be between 1 and the size of the array". I was sure I was passing through arrays of 1000 records but obviously not!
Any thoughts appreciated.
T