Generating a report via Reporting (Ruby)
Open a terminal/shell
Open your Reporting project (Ruby)
Make sure you have connected to the remote Cassandra database
kubectl port-forward -n cassandra cassandra-cassandra-0 9042:9042
Set your version of Ruby
rvm use 2.6.1
Run
bundle exec rails c
You should now be in the Ruby interactive terminal
Try test:
Agency.where(agency_id:'{uuid goes here}')Run a report, for example:
TenancySchedule.call('{agency_id}','excel')
Copy the report:
cp /tmp/commissionreport-1657684190624.xlsx commissionreport-1657684190624.xlsx
When using dates please use:
Format: '%Y-%m-%d'
Special Note: “2021-10-31”&.to_date&.end_of_day (You have to add &.to_date&.end_of_day to make sure time is added to the date obj)
Option 2: Jump into the pod
Using REPL execute the report remotely.
Tunnel into the reporting pod using:
kubectl -n banking exec -it reporting-images-web-0 bash
# bundle exec rails cThen choose the report you want to generate and run it:
TenancySchedule.call('{agency_id}','excel')
AgencyGroupCommissionSplit.call("754cceb6-f295-4d05-85c8-9d7ca4edeb1b", '2022-11-1'&.to_date&.end_of_day,'2022-11-31'&.to_date&.end_of_day,"excel")Then copy the report to your local drive:
kubectl cp banking/reporting-images-web-0:/tmp/deposit-report-f64fc8d1-e3b7-4269-9787-fc7e3699feb3.xlsx /tmp/deposit-report/deposit-report-f64fc8d1-e3b7-4269-9787-fc7e3699feb3.xlsx