Masshunter PDF report builder - How to reference a textbox?

Good Day,

 

I'm trying to create an if function on a text box, for example:

 

if Textbox3 is above 50 or below -50 report "A" else report "B".

 

I am trying to get it to refernce a particular value in the report that changes in the list of results on every different sample.

I cannot reference the ISTDResponsePercentDeviation directly as it says DBNull when trying to put it into an If function.

 

If anyone can solve either referencing another textbox and creating an if function from there or help resolve the DBNull:

 

Thanks in advance

 

Grant

  • yeh sure. Using the expression box, I want the ISTDPeak ISTDReponsePercentDeviation. I can get it from the Field Value options but I want to get it in an expression then I can apply a function like:

    "Pass" if BoundItems["ISTDPeak"].ISTDReponsePercentDeviation <-50 else "Fail"

    So the result would be Pass or Fail depending on whether the repsone was 50% below the ISTD response average of the calibration.

  • I'll give it a go and see if it works.

     

    Thanks for your help.

  • Hey Grant,

    Can you send me the function you're trying? I'll take a look.

     

    Best,

    Matt

  • Ok - so you are clearly aware that we have an outlier for exactly this deviation. In your Quant method - there is an outlier called 'ISTD Response Percent Deviation" with two limits Resp Min % Deviation and Resp Max % Deviation. This outlier metric is the measure of whether the internal standard response deviates more than the user defined percent limits from the average ISTD response calculated from the calibration samples (from the help, exactly what you're looking for).

     

    Because we have the outlier defined already - you don't need to do any IF/Else logic. You can just have the outlier change the color of the cell or display Pass/Fail - whatever.

     

    Check out the example of this in the shipping system suitability report template. If you click on the 'Resolution Front' expression - you can see the example:

     

     

    Let me know if you have any follow-up questions.

  • I've tried to perform it and the color change works great.

     

    However I've created a multiple if expression previously and I can't see to get it to fit.

    In this expression it consists of multple If statements and I'm not sure how to integrate the code you provided into it. Or at least have it state Pass/Fail rather than color change.

    I have also tried to integrate the expression below (my long multiple if statement) into the Color coding with next to no success

     

    " " if BoundItems["sample"].SampleType == "DoubleBlank" else " "if BoundItems["sample"].SampleType != "Sample" and BoundItems["sample"].SampleType != "QC" and BoundItems["sample"].SampleType != "CC" and BoundItems["sample"].SampleType != "Blank" and BoundItems["sample"].SampleType != "DoubleBlank" and BoundItems["Compound"].CurveFitR2 >=+0.999 else "Pass" if BoundItems["sample"].SampleType =="CC" and BoundItems["Compound"].CurveFitR2 >=+0.999  and BoundItems["TargetPeak"].Accuracy >+95 else "Pass" if BoundItems["sample"].SampleType =="Blank" and BoundItems["Compound"].CurveFitR2 >=+0.999  and BoundItems["TargetPeak"].FinalConcentration <+5 else "Pass" if BoundItems["sample"].SampleType =="QC" and BoundItems["Compound"].CurveFitR2 >=+0.999  and BoundItems["TargetPeak"].Accuracy >+95 else " " if BoundItems["sample"].SampleType =="Sample" and BoundItems["Compound"].CurveFitR2 >=+0.999 else "Fail"

     

    Do you have any suggestions on how this can be done?

     

    Thanks

  • Hi again - this is a little beyond my expertise but I know that Python is extremely formatting dependent. Can I set you up with one of our reporting consultants to see if they can get you an answer? If so - can you give us a call (800-227-9770, option 3, then 2) and the call center can arrange a callback for you.

Was this helpful?