Link to home
Start Free TrialLog in
Avatar of Lucy Gomes
Lucy Gomes

asked on

Variable starting point for a crosstab?

Hi Experts!
I have a crystal report that has a mock crosstab with 48 spaces.
Techs use this as a plate map for testing samples.  Each batch can have up to 47 samples (first cell is always a control).  
I need to be able to put the sample ID in the correct space but have not been able to do that so far because the batch does not always start on cell #2.  If the plate has cells that are not suitable for testing, they can start a batch on the next available cell, like cell number 22, for instance.
How can I possibly place the correct ID's in the correct cells whey they're starting at random numbers?  I created a table with 48 numbers as "cell addresses" and have a parameter called "First Cell" for the tech to enter the first cell they are using but I can't seem to get any further - how do I link the two??
Any attempt I've made to use *next* function works great on first and second values, but doesn't go anymore.  The ID's are alphanumeric so i can't really use +1.  I've also tried creating arrays and then calling each element out one by one but that's not working well either.
This mock table is in the report footer.
Any help is much appreciated!
Avatar of Lucy Gomes
Lucy Gomes

ASKER

A bit more on what I've tried:
I was thinking of creating 47 formulas, one for each potential sample ID.
First usable cell is 2 so:  
if {?Starting Cell} = 2 then
(whileprintingrecords;
stringvar array arr;
arr[1])
else ''

For Cell 3:

if {?Starting Cell} = 3
then
    minimum({ORDTASK.ORDNO})
else
    (
        if length ({@two}) < 2
        then
        ""
        else
       
        stringvar array arr[2]

       
    )

//second cell on table so this can only go three ways:
//is it the first cell used? yes - then show first ordno.
//if it's not the first cell, then is there a value in previous cell (@two)?
    //no - so it's not the first cell and there is no value in previous cell - leave blank.
    //yes - show the second value in the array (second ordno)
   
and that's where I hit a wall.  What I really want to to do is say - look at previous cell formula and show me the next sample ID.
Avatar of Mike McCracken
Can you upload the report?

mlmcc
Sure, it's a mess, but here's the report.

Lucy
Oops, let's try that again.
Bact-Maldi-Run-Sheet001.rpt
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oh my goodness!!!!!!!!!!!!!!!

It works perfectly!!!  I wish I could convey how much I appreciate your help on this!  Totally just made my week, maybe month!!
I've been battling this report for days.

Thank you, thank you, thank you!

Lucy