One of the problems I wanted to tackle when I started using python-docx was replacing tools like Oracle BI Publisher. I have years experience with this and it is not that nice to use but its support for graphs and overall it does do the job. I have been using it to create monthly management reports to show progress against KPIs etc. So one thing that I needed to tackle was getting nicely formatted graphs in there. Step in XLwings. My basic process:
- Create the required graphs in Excel.
- Create SQL / XLwings scripts to update the graphs
- Export the charts as pictures.
- Insert the pictures into Word document.
It is not the remit of this post to cover the first 2 steps in detail but rather focus on step 3 and step 4.
The code:
No comments:
Post a Comment