Multiplication in Agilent Report Builder 10.2

Hello  

I am updating our report template and I have one last column to create.

Basically, all I want to do is this--> {V:LimitOfDetection}*{V:Dilution}

I want a column that displays the Limit of Detection multiplied by the dilution factor of the sample.

I cannot have a fixed value for the dilution factor as we adjust it every time.

Can I use an expression in the report template to achieve this?

Thank you for your time and Have a nice day

Parents Reply
  • Hello  

    I tried looking into the other templates to understand the coding but I am no code expert or programmer and I only have basic knowledge of those things so I can't get the report to print  the info that I want it to print.

    We would like to have the column display the final concentration but only if the calculated contraction is higher that the LimitOfQuantitation.

    If this is not the case, we would like the report to print <LOQ instead of the results.

    I used a shipping template that I modified but I can get it to print only the results for the detected compound.

    As those compounds have a CalculatedConcentration higher than the LOQ, the expression activating the <LOQ is useless

    I still also want a column where my LOQ would be displayed as LimitOfQuantitation*Dilution as this would put it in the same units (ng/L) as the FinalConcentration

    I watched the videos on the USB stick but they are either too advanced or too basic. 

    I even tried asking ChatGPT for some help with the code but it suggested Python code like IIF and SWITCH function that are not recognized by the Report Builder

    I went through the data binding of the model I used and tried to erase a few filters to see the effects.

    I did get the report to print all compound on the report, but even those with a concentration of 0.0 were displayed as such.

    What could I provide you so you could help me achieve my goal?

Children
  •  ,

    There is an example of printing text instead of the final concentration based on the LOQ outlier in this discussion.

    (+) Report builder - Final Concentration Expression Change - Forum - Mass Spectrometry Software - Agilent Community

    Either of those expressions should work, depending on whether you want to report blanks the same as other sample types or not. Remember to change the binding name to match what you are using in your template. 

    For the calculation you would just use an expression like the following -

    BoundItems["cmp"].LimitOfQuantitation*BoundItems["sample"].Dilution

    Again replace "cmp" and "sample" with the binding name used in your template. This expression will only work if all compounds and all samples have a LOQ and dilution specified. If not, the report will fail. To make it more robust you could add some checks as in the previous example and just have it print nothing if any of the values are missing. 

    "" if BoundItems["sample"].IsDilutionNull() or BoundItems["cmp"].IsLimitOfQuantitationNull() else BoundItems["cmp"].LimitOfQuantitation*BoundItems["sample"].Dilution

  • Hello  

    I was able to implement everything I wanted in my report with that code. Thank you.

    The only last weird bug is that if I replace the Agilent logo with our company logo, I get an error message saying that it was not found in the report/batch folder.
    Our logo is located in the same folder as the Agilent logo and I tried various format (.jpg .tif) and sizes but it does not make a difference.

    In the report editor, I click on the logo, change the file name to the one I want, it displays correctly in the report template but crashed with the previously mentioned error when a preview is generated.

    Let me know if there is anything I need to check to correct that situation.

    Thanks again and have a nice day

  • Hello  ,

    The preview function requires that you specify the full path for any graphics you add. The exception to this seems to be the default logo.tif graphic, which appears to work even if the file is completely missing.

    The easiest way to get the full path for a file is to shift-right click on the file in the File Explorer and choose the option to copy as path. Paste this into a temporary text document, remove the double quotes, and then copy/paste the path into report builder.

    If you are running the report from quant then you don't need to specify the full file path. Just having the graphics file in the same folder as the template should work.

  • Hello  ,

    Everything is working now.

    Thank you for your invaluable help!

Was this helpful?