Closed susannehaase closed 12 months ago
@margalva I don't know if you've seen this
we would like to place the dynamic reporting as only solution for creating report irrespective of the simulation and I think this was also the idea behind this Tool/package. could you please look into the issue, this is important for going forward and placing the pyansys solutions by our customers.
Thanks in advance
Apologies for the delay in the answer. The problem is that you need to pass also the location of the executable and Ansys release version as arguments to the save to pdf method. So if you run:
server.export_report_as_pdf(template_003, r"D:\temp\test_report.pdf", exec_basis=r"C:\Program Files\ANSYS Inc\v232\CEI", ansys_version=232)
it will create the PDF file (note: the ansys_version argument is an integer, while the exec_basis argument is a string for the path). From my tests, this works correctly.
This issue points to the fact that indeed we need a better wrapper around this report export capability - but the functionality should be there and work as of now.
I'll therefore close this issue, but please don't hesitate to open it back up if you run into any issues. Thanks.
Hi Marina, with your solution I get a pdf, but it only shows "Oops! Error Code: 500, Sorry but something went wrong with the server. Please try again." See pdf attached. test_report.pdf Do you know what's causing this? Best regards, Susanne
Hi Susanne, it sounds like the issue is not in the PDF export but in the ADR service or the data itself. If you run the script all the way to the line:
o.set_tags("solution=solverA section=references")
(included), then open a web browser and go to the web interface at:
what do you see? Can you query the database and see all the data there? Can you go into the report and see the report correctly?
It is possible that you have two ADR services on your machine that are competing for the same port or something similar.
@margalva, I just did the deep dive and seems this is just the copy paste mistake, in your comment you have mentioned first argument as template_003
which should be template_003.guid
, right?
obviously tool cannot find any reports with GUID template_003
@susannehaase: can you please test following line, it did the trick for me
server.export_report_as_pdf(template_003.guid, r"D:\temp\test_report.pdf", exec_basis=r"C:\Program Files\ANSYS Inc\v232\CEI", ansys_version=232)
Thank you @kmahajan-cadfem! The guid was missing. Now it works! Also many thanks to @margalva Marina, for your support!
🔍 Before submitting the issue
🐞 Description of the bug
I tried to call
server.export_report_as_pdf(template_003.guid, r"D:\temp\test_report.pdf")
Error Message: