I am wondering if any Hamilton users here have been able to create custom reports that are generated at the end of the method run. Ideally looking for a .txt file or PDF file output that would display select variables that I’m tracing throughout the method.
Any examples of commands used to generate these reports would be much appreciated! Thank you!
Relatively new programmer here but this can be done through the ‘File: Open’ single step, and looping over the variables you want to write with the ‘File: Write’ command. Here is an example I just worked on today to generate a barcode export report containing destination barcodes and well locations as a .csv.
If you take the Venus II course from Hamilton they go over it.
To add, you can add information to an array as your method runs, such as timing, and when certain actions are taken and then at the end of method write the array to a txt or even csv file as the other poster mentioned.
If you’re in method editor and go to “Help” and then “Help Topics”. You can search for file and will find all of the file commands in HSL. Venus supports .xls, .txt, .csv, .tab, & .asc files. It’s good to read this information to fully understand the capability however, there are also the file handling commands as shown above by Desert_platypus under general steps that are simpler to use.
Thank you all for the helpful information! I was able to use the File Handling commands to update a .xls with my variable information, which now gets written to every time that method is run and records the relevant details.
I guess what I am more interested in would be a PDF report generation, similar to the one that appears at the conclusion of the Daily Maintenance method. Is there a way to copy/modify the maintenance method to create a report specific to my variable information?
The idea is to have a document that could be attached in a lab notebook entry, which only shows variable information specific to the run that was just completed. Currently my .xls solution shows information from all runs of the same method, as the file just gets updated with a new row each time
There is a new library that was recently released (yesterday) exactly for this purpose. The Hamilton PDF Report Generator can be downloaded at this link, and can be found in the Library Downloads section for future reference.
A list of available functions can be found below. In general, the process consists of creating a New Report, adding desired text/objects (Header/Footer, Images, Tables, Text), then Save Report.
It can take some time to get used to the flow of commands, and several of them are a bit bulky in terms of parameters, but along with the library there is a demo method which gets installed to the “C:\Program Files (x86)\Hamilton\Methods\Library Demo Methods” folder called “Hamilton PDF Report Generator Demo.med”. I highly suggest running this demo method before trying to work with the library as it helps give an idea of what the library can do and how to do it. Of course, also refer to the help file while programming your own report.
The demo method has two major paths: ‘generate a demo VeriPlate report’ and ‘generate a custom report’. I suggest running the former option first to give an example of what the library is capable of, then run the latter option to receive a dialog-by-dialog walkthrough of making your own report. Afterwards, refer to the code in the demo method to get a sense of how to write it into your own method (I find the VeriPlate sub-method most cleanly outlines what this looks like).
Again, I will note that this library is very new, so use cases up to this point are limited. If you run into any issues, please follow up here and we will do our best to support.
Depends what you wish to do, personally I am a fan of a .csv to be generated, not all PC’s in our company have Excel installed and some users are running on other OS-es so text-based is the way to go for us.
One of the things I simply create is a string and at the end of the method I simply generate a report
Apologies everyone, the previous link in my initial post regarding the Hamilton PDF Report Generator Library was incorrect. I’ve updated the link to the download (it should not require an account) and re-linked here as well: Hamilton PDF Report Generator v1.0.exe :: Hamilton