OpenLab CDS Summary Report - Compounds as Columns

Working with a customer that wants a very simple summary report.  Only 6 compounds.  They want the table to look like this example in Excel.:  I have looked at both Tables and Matrices, but nothing seems to be in this format.

Any assistance would be appreciated.

David

  • Hello,

    What CDS software version are you using? You either need to use a matrix object which will have formatting limitations, or you could use a table with stored values. The table can be formatted as shown but it will be static for the configured compounds. 

    Marty Adams

  • Hi! One of my tricks for this: Create tables for each component with only a Peak_Area or any parameter you want. Create a Variable from the table rows: VarName: AreaTable1 (2 3 4..) and add a UniqueKey for the results: UniqueKyValue: Injection_ID. Hide these temp tables, we need only the stored values... Create a new table for the collected datas with as many coulmns as componds you have. For the Value filed add this: =AreaTable2(Injection_ID). And Thats all :) 

    Other trick. Single table, with many columns, where the values are: sum(peak_area*if(compound_name="MeOH",1,0))  sum(peak_area*if(compound_name="EtOH",1,0)) etc...

  • Hello,

    If you need the formatting of a table, it can be done that way. I do not like to use multiple hidden tables for that kind of report as they can be hard for later customization. The example below uses a single hidden table and custom code to build the display table. The simple code in the example can pass 4 values but is easily expanded if more are needed. I also use report parameters to make updating the report for different compounds more user friendly. The attached example report template is for CDS 2.7. Please note you can also create the same kind of code as a custom dll which can provide more coding options beyond the simple array in the example. 

    /cfs-file/__key/communityserver-discussions-components-files/26/CodeTestPeakResults.zip

    'Dimension Variables 
    Public Dim MyArray(5,1) as Object
    Public Dim rows as Integer = 0
    Public Dim test as Integer = 0

    'Naming Function and sending values to fill array by injection id and compound name
    Public Function FillArray(ByVal InjIdCompName As String,ByVal Value1 as Double, ByVal Value2 As Double, ByVal Value3 As Double,Optional ByVal Value4 as Double = 0) As String
    'Filling Array
        rows = Ubound(MyArray,2) + 1
        Redim Preserve MyArray(5,rows)
        MyArray(1,rows) = InjIdCompName
        MyArray(2,rows) = Value1
        MyArray(3,rows) = Value2
        MyArray(4,rows) = Value3
        MyArray(5,rows) = Value4
            
        Return "Complete"
        
    End Function

    'Function to call back value from array
    Public Function UseArray(ByVal InjIdCompName As String, ByVal DataCol as Integer) As Double
        Dim Value as Double = 0
        Dim rowcount as Integer
        rowcount = Ubound(MyArray,2)
            For index As Integer = 1 To rowcount
                 If MyArray(1,index) = InjIdCompName
                    Value = MyArray(DataCol,index)
                 End If
            Next
       
        Return Value
        
    End Function

    'Function to clear array in case of repeating tables
    Public Function ClearArray() As String

        Redim MyArray(0,0)
        Return "Sucessfull"
        
    End Function

  • Dear Martin,

    I've been trying to use the template You have so kindly provided, but I'm getting a "The parameter {0} is either empty or null. Parameter name: value" error when trying to load it. Can You help me out?

    Thank You in advance!

Was this helpful?