Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting details section

Status
Not open for further replies.

acessn

Programmer
Feb 16, 2005
71
NO
Working with CR10, Microsoft SQL server.

I'm having som diffuculties formatting my detail section in a nice manner.

Problem described here:
I put it out like this as it's easier to explain with images.


Thanks,

Bjorn
 
Try storing the values for each an arrays, and then populate everything at the group footer level.

So an example would be:

Details formula;
whileprintingrecords;
stringvar array days;
stringvar array aften;
stringvar array natt;
if {table.field} = "day" then
redim days[ubound(days)+1];
days[ubound(days)]:= {table.name};
if {table.field} = "aften" then
redim aften[ubound(aften)+1];
aften[ubound(aften)]:= {table.name};
if {table.field} = "natt" then
redim natt[ubound(natt)+1];
natt[ubound(natt)]:= {table.name};

Group Footer (where you display the first entry);
whileprintingrecords;
stringvar array days;
days[1]

right click and select insert section below as many times as you want lines and draw it out.

Group Footer (where you display the second entry);
whileprintingrecords;
stringvar array days;
days[2]

..etc for all values in all arrays...

Then right click the group footer one last time and place the following formula to reset the arrays;
whileprintingrecords;
stringvar array days;
stringvar array aften;
stringvar array natt;
redim days[1];
redim aften[1];
redim natt[1];

Should get you close...

-k
 
Hi, and thanks for the suggestion!

I've tried this in the details section:

(@Fvakt returns a string with the name and the time of work.)

Code:
whileprintingrecords;

stringvar array dag;
stringvar array aften;
stringvar array natt;

if (time({VP_SCHEDULE.SHIFTSTARTDATE}) in time(7,0,0) to time(10,0,0)) then
(
redim dag[ubound(dag)+1];
dag[ubound(dag)]:= {@F Vakt};
)
else
if (time({VP_SCHEDULE.SHIFTSTARTDATE}) in time(13,0,0) to time(16,0,0)) then
(
redim aften[ubound(aften)+1];
aften[ubound(aften)]:= {@F Vakt};
)
else
if (time({VP_SCHEDULE.SHIFTSTARTDATE}) in time(18,0,0) to time(23,30,0)) then
(
redim natt[ubound(natt)+1];
natt[ubound(natt)]:= {@F Vakt};
)

I'ev created two additional group footers (person name), 2a and 2b.
I've placed the display formula in footer 2a

Code:
whileprintingrecords;
stringvar array dag;
dag[1];

I then reset the array in the last group footer.
Code:
whileprintingrecords;
stringvar array dag;
stringvar array aften;
stringvar array natt;
redim dag[1];
redim aften[1];
redim natt[1];
''
Had to enter the '' because the result of a formula couldn't be an array.

When I try to preview this report , the display formula fails on dag[1]; stating this error:

A subscript must be between 1 and size of the array.

Any ideas on how to progress?

Thanks,

Bjorn
 
Additional.

I've tested the if's in the detail section, and they seem to work correctly.

It's the displaying on group footer level which gives me headache.

\b
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top