In that case first we need to check data load in database if that condition true then you can use your print function. I hope this will be useful.
Thanks