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

  • It's OK. I've figured out why it's doing it now. Some sample types didn't have the outlier applied to them. this meant that the DBNull error kept coming up as there was no error to correspond to it. By limiting to Samples or Blank or CC as a fisrt arguement, the report doesn't crash:

    "Pass" if BoundItems["sample"].SampleType == "CC" and (BoundItems["ISTDPeak"].ISTDResponsePercentDeviation >-50 and BoundItems["ISTDPeak"].ISTDResponsePercentDeviation <+50) or BoundItems["sample"].SampleType == "Sample" and (BoundItems["ISTDPeak"].ISTDResponsePercentDeviation >-50 and BoundItems["ISTDPeak"].ISTDResponsePercentDeviation <+50) or BoundItems["sample"].SampleType == "Blank" and (BoundItems["ISTDPeak"].ISTDResponsePercentDeviation >-50 and BoundItems["ISTDPeak"].ISTDResponsePercentDeviation <+50) else "Fail"

     

    Thanks for your help though, Iv'e used the code you rpovided previously with a different report, so thank you.

  • I'm really glad to hear that, I appreciate your contributing to the community with your investigations and conclusions. Many thanks.

Was this helpful?