Entering Custom Text for Cells in a Table

Hello,

I'm trying to enter in custom integers/floats into a column for a table grouped by Compound Name using Agilent OpenLab Intelligent Reporting A.01.12.165. For example, it would look something like this where custom text is inputted by the user.

Sample ID Compound Amount Custom Text
## ## 1
## ## 2
## ## 3
## ## 4

I tried using the report parameters for the custom values, but I kept getting an error when I was trying to iterate through the array. It doesn't seem possible to have the index be calculated on the fly as whenever I tried something like MyPara(CInt(Injection_OrderNo)) it would error out. I assume the index number is an integer. 

Is there an alternative way of adding a column where the user can input the values per row?

Thanks,

John

Parents
  • Hello,

    Are you using IR in CDS 2.x or Chemstation? There is not a good solution for entering values at the report level per compound in IR. We would typically suggest entering this type of information in the results during data processing using compound custom fields. The configuration of compound custom fields is done in the project in CDS 2.x and the method in Chemstation. The advantage of using a custom field is the entries are stored with the results. If you use report parameters or some other custom method at the report level the results would need to be reentered to recreate the report. This data can be text, numeric or date time. The data is store per compound per injection. See a quick example below for CDS 2.x. 

    Marty

  • Hey Martin,

    I am using IR in ChemStation. I tried the Projects way before, but when I created a test project I could only see the Properties window.

    Could you show me how to use the method in ChemStation for custom text? 

    Thanks,

    John

  • John,

    If you have Chemstation ignore my example for the most part as that was for CDS. Chemstation does not use projects at all those are only for CDS 2.x and EZChrom. In Chemstation the custom fields are setup in the method and unfortunately cannot be added to the results after the acquisition. Also, you have to use a different IR fields to report the data.

  • I agree with Martin here as there is no way I know of to add specific values to a table without linking them to what lines in your table are repeated on. Generally, the easiest way is to enter that information directly into the data already linked to said fields.

    However, if you cannot rerun the sequence to resolve this, you can technically hard code to link them in as variables. For example, you can simply save a "CompoundAmount" variable with a nested if statement that takes the compound name and returns a value if the name is a specific thing, similar statements if it is sample specific, then repeat for each compound and/or sample.

    If you want it to be slightly more flexible, you can make a report parameter or 2 that users can enter a list of compound names and a list of amounts that you then parse.

    Additionally, you can abandon the table and simply make a bunch of text boxes that call the right information at the right place for this specific sequence or others with the exact same format.

    All of these solutions are much more work than simply filling the information in with the data, but will work if you have no other choice or you would rather not rerun the sequence.

  • Hello,

    There is one other way to do this with custom code. The code below will populate a dialog box, when a cell in a table calls the function, prompting the user to enter a value. I am showing the solution in CDS 2.x but the same thing will work in IR for Chemstation. You CANNOT use this report during automations only manual report generation, in the reporting tab in CDS or the report preview view in Chemstation. This is because during automation the software will not be able to prompt the user. I will outline a way to ensure the template will only prompt for the user entries when the user is generating the report directly. Also, just like report parameters any information entered in this manner will be available only on the report, the information is not saved with the data. 

    Please Note: This simple VB code solution is provided "as is" for added functionality, with no options for customization or further support. It is provided for specific use cases and is not intended for automated report generation. Your use of this solution signifies understanding and acceptance of these terms.”

    Marty Adams

    VB Code

    Public Function CaseStatement(ByVal CompName As String) As String

    Dim message, title, defaultValue As String
    Dim myValue As Object
    ' Set prompt.
    message = "Enter a comment for " & CompName
    ' Set title.
    title = "Comment Input Box"
    defaultValue = "NA"   ' Set default value.

    ' Display dialog box at position 100, 100.
    myValue = InputBox(message, title, defaultValue, 100, 100)
    ' If user has clicked Cancel, set myValue to defaultValue
    If myValue Is "" Then myValue = defaultValue

    Return myValue

    End Function

    Code goes in the Code tab under report properties.

    In report properties, I created a report parameter to turn on or off the custom parameters. This should be a boolean data type with false as the default setting. 

    In the table where you want the custom information, you enter an expression like  =If(CustomComments = True,Code.CaseStatement(Compound_Name),"NA") into the value of a column. This will ensure the function is not called unless the user sets the report parameter to true. This action will ensure the template will not cause problems if accidentally called in a processing method used for automations and give the user the ability to review the output before the need to enter the custom information. 

     

    When initially previewed the check box will be empty and the value of the custom field set to the false statement in our expression. Now if the user checks the box and clicks the view report button, the report will be updated, and the user prompted for an entry for each line of the table. I was prompted 4 times in this case once for each line in the table. For each line in the table, I entered a different text value in this example case. You may need to click on the input box on the OS toolbar to focus on it for the first entry. If you cancel any of the dialogs it will use the default value from the code. 

  • Interesting addition, Martin. I've actually run into this before as I was testing different functionalities. My lab has decided not to use custom code for various reasons, but I found you can actually call inputboxes from other objects using the base VB inputbox method. Unfortunately, the input box isn't very customizable when called from an object so we have opted to make custom parameters instead. It is also helpful for auditing and review if inputs are saved in the data.

  • Hello,

    Yes, as I said I would suggest compound custom fields for the reason that the information entered is saved with the data. The one issue with Chemstation data is that you cannot add custom fields after the data is collected unlike CDS 2.x. This makes it less useful when reporting older data if that is required so I thought I would add this option. Custom code is useful to extend IR functionality when standard reporting tools and calculation will not suffice, but I always try to exhaust the base tools and workflows before extending into custom code.  This is a very simple example able to be created directly as custom code, typically I would create a dll in VB.Net or C# to have access to a full dev studio, testing, and extended forms options. 

    Marty

Reply
  • Hello,

    Yes, as I said I would suggest compound custom fields for the reason that the information entered is saved with the data. The one issue with Chemstation data is that you cannot add custom fields after the data is collected unlike CDS 2.x. This makes it less useful when reporting older data if that is required so I thought I would add this option. Custom code is useful to extend IR functionality when standard reporting tools and calculation will not suffice, but I always try to exhaust the base tools and workflows before extending into custom code.  This is a very simple example able to be created directly as custom code, typically I would create a dll in VB.Net or C# to have access to a full dev studio, testing, and extended forms options. 

    Marty

Children
No Data
Was this helpful?