Hi,
I will suggest, try to get the info like opening and closing balance using variable.
You need to create variable which will take care of open balance period and show the amount based on that similarly need to use closing as well.
Thank-You.
Regards,
VB