[Jo...] Posted July 29, 2022 Share Posted July 29, 2022 Hello, How can I change the table template used in the report page using python? gom.script.table.switch_template (name='template_name') doesn't give a handle to the table to change. Thanks Johnny Link to comment Share on other sites More sharing options...
[Jo...] Posted August 22, 2022 Author Share Posted August 22, 2022 Hello, Does someone has a suggestion? Thanks in advance. Johnny Link to comment Share on other sites More sharing options...
[aa...] Posted August 24, 2022 Share Posted August 24, 2022 This might not be the best way to do it, but this script goes through all the report pages that have a table, restores the 3d view, changes the table template, then updates the report page table. You will have to input the name and uuid of your template, the script has placeholders for it. You can get those by recording yourself changing the table template and taking the values from there. Hope this helps # -*- coding: utf-8 -*- import gom for report in sorted(gom.app.project.reports): for element in report.pages[0].elements: if 'table' in element.name: gom.script.report.restore_3d_view_from_report_page (page=[element]) gom.script.table.switch_template (name='YOUR_TEMPLATE_NAME_HERE', uuid='YOUR_TEMPLATE_UUID_HERE') gom.script.report.overwrite_report_page (target=[report.pages[0].elements[element.name]]) Link to comment Share on other sites More sharing options...
[Jo...] Posted August 25, 2022 Author Share Posted August 25, 2022 Thanks I will try this. It looks promising for my use case. Link to comment Share on other sites More sharing options...
[Jo...] Posted August 28, 2022 Author Share Posted August 28, 2022 Well this was very help full. Next step is to get the list of available table templates. I have to figure out how they can be retrieved. Is there something in the api? Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in