vanny
10-10-2006, 01:11 AM
Is it possible to dynamically create variables as you need them.
Why I ask this is that in my reporting engine, I am looking at create the posibility to have TOT, AVG etc at the bottom of the groups as well as Grand Totals/AVG
But I dont know how many columns I will have to create them, I could bite the bullet and just allow for a maximum width of 50 columns, but I thought there could be a better way.
Sample Data Example
GROUP 1
TEST 1 4 5 3
TEST 1 4 5 3
TEST 1 4 5 3
TEST 1 4 5 3
TEST 1 4 5 3
---------------------
AVG 1 4 5 3
GROUP 2
TEST 2 4 5 3
TEST 2 4 5 3
TEST 2 4 5 3
TEST 2 4 5 3
TEST 2 4 5 3
---------------------
AVG 2 4 5 3
---------------------
OVERALL 1.5 4 5 3
Just before someone says why not use a Stored procedure, basically, every report is different, and I store my SQL in a table, then the engine I have written does all the formatting for me so far, All I have to do is pass a parrameter, so all I want to be able to say is AVG column 5, TOT column 2 etc. Oh and I am limited to Access databases. :(
Why I ask this is that in my reporting engine, I am looking at create the posibility to have TOT, AVG etc at the bottom of the groups as well as Grand Totals/AVG
But I dont know how many columns I will have to create them, I could bite the bullet and just allow for a maximum width of 50 columns, but I thought there could be a better way.
Sample Data Example
GROUP 1
TEST 1 4 5 3
TEST 1 4 5 3
TEST 1 4 5 3
TEST 1 4 5 3
TEST 1 4 5 3
---------------------
AVG 1 4 5 3
GROUP 2
TEST 2 4 5 3
TEST 2 4 5 3
TEST 2 4 5 3
TEST 2 4 5 3
TEST 2 4 5 3
---------------------
AVG 2 4 5 3
---------------------
OVERALL 1.5 4 5 3
Just before someone says why not use a Stored procedure, basically, every report is different, and I store my SQL in a table, then the engine I have written does all the formatting for me so far, All I have to do is pass a parrameter, so all I want to be able to say is AVG column 5, TOT column 2 etc. Oh and I am limited to Access databases. :(