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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modifying dynamic columns formula in thread149-655589

Status
Not open for further replies.

elsenorjose

Technical User
Oct 29, 2003
684
US
Hello everyone,

I am trying to modify the solution in thread149-655589 to work without a user provided parameter and instead use a field in a table that indicates how many columns a report should have.

The table summarizes a series of tests for pharmaceutical products, each test being a column in the table. The table is really more of a view, but was designed as a table, since the underlying join logic is very complex. The result is a table similar to this:

Code:
CLIENT	
LOT_NUMBER	
CONDITION	
TIMEPOINT	
TEST1_NAME	
TEST1_LIMIT	
RESULT1	
TEST2_NAME	
TEST2_LIMIT	
RESULT2	
...
NUM_TESTS

The user will enter the LOT_NUMBER as a parameter and based on that lot number, the number of tests (NUM_TESTS value) is determined; Each lot has a distinct number of tests.

I've been working on this for a while and think I'm lost in the trees and can't see the forest. Can someone help me walk through lbass's formulas to use the 'NUM_TESTS' value to determine the number of columns to display?

Thank you.
 
I'm not sure why you would need to implement as in the referenced thread. If you simply place the fields in your detail section, the tests that are not needed for the specific lot would just be null, wouldn't they? Wouldn't the test1, test2, etc., be populated by the appropriate tests per lot, i.e., in order? Or are you saying that a particular lot might have test1 and test4, but no test2 or test3?

-LB
 
Thanks for the quick reply lbass. What I want to accomplish is what you indicated in reply to the original poster's question about white space. Partial quote from poster:

yasinmsm said:
When there are 19 fields and the user is selecting only 10
fields, there will be space for 9 more fields on the right hand side allocated for the non selected fields.
When I choose to print the report, Those empty columns spaces are also considered. How do I avoid this?

Partial quote from your reply:

lbass said:
If you want the columns to be equidistant, then I think you have to create 19 details sections, and place the {@coln} formulas in each section in the arrangement you wish, with the first section containing {@col1}, the second {@col1} and {@col2}, the third {@col1}, {@col2}, and {@col3}, etc.

I feel that if I modify the {@coln} formulas using the value in the NUM_TESTS field as a condition and then use your solution for spacing, I should be able to format the report properly but I'm not sure if that's correct or not.
 
You didn't really answer my question, but I think you could just place copies of the fields in separate detail sections, like this:

det_a testname1 test1limit test1result
det_b testname1 test1limit test1result testname2 test2limit testname2
det_c testname1 test1limit test1result testname2 test2limit test2result testname3 test3limit test3result

Then suppress details sections with these formulas:

//det_a:
num_test <> 1

//det_b:
num_test <> 2

//det_c:
num_test <> 3

-LB
 
Hi again lbass,

Sorry for not answering your question. I CAN just place the fields in the details like you said. But your reply is what I was looking for. I often fail to see what is obviously a very simple solution.

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top