Can I export an ADR report for offline viewing?

Landon Mitchell Kanner
Landon Mitchell Kanner Member, Employee, GitHub-issue-creator Posts: 319
50 Answers 100 Comments Second Anniversary 25 Likes
✭✭✭✭

I am using Ansys Dynamic Reporting to generate reports (from Mechanical and Fluent). But my ADR server is on my local machine, which cannot be accessed by others. Is there a way to save the report to disk, so that I can share it with others via email?

Answers

  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee, GitHub-issue-creator Posts: 319
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭
    edited August 12
    outfolder = r'D:\Temp\nexus_report'
    server_address = "http://127.0.0.1:3528/"
    Template_name = 'MyTemplate'
    
    import ansys.dynamicreporting.core as adr
    
    adr_service = adr.Service()
    adr_service.connect(url=server_address)
    report_obj = adr_service.get_report(report_name=Template_name )
    
    ##HTML Version
    #You can then zip the outfolder to share with others.  Receiver can unzip and then double click index.html to view.
    report_obj.export_html(outfolder)
    
    ##PDF version
    report_obj.export_pdf(outfolder+r'\report.pdf')