Book a Demo

Author Topic: Automate printing of Documents  (Read 6225 times)

Mads Kirstan

  • EA Novice
  • *
  • Posts: 14
  • Karma: +1/-0
    • View Profile
Automate printing of Documents
« on: October 25, 2016, 09:21:06 pm »
Hi,

For the reports and report specifications in EA you can automate the generation by using the proj.RunReport() interface.
Is there a interface/way to invoke the "Print to PDF" command on Documents?

Kind regards.
Mads

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Automate printing of Documents
« Reply #1 on: October 25, 2016, 10:40:44 pm »
From the documentation on RunReport:

Quote
FileName: String - the file name and path to store the generated report; the file extension specified will determine the format of the generated document - for example, RTF, PDF

Geert

Mads Kirstan

  • EA Novice
  • *
  • Posts: 14
  • Karma: +1/-0
    • View Profile
Re: Automate printing of Documents
« Reply #2 on: October 25, 2016, 10:51:54 pm »
Hi Geert,

Thanks for the answer, this relates to the <<ReportSpecification>> object where I will use the RunReport() function, but how about to generate the <<Document>> object in-line contents?

Kind regards,
Mads

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Automate printing of Documents
« Reply #3 on: October 25, 2016, 11:12:21 pm »
Hi Geert,

Thanks for the answer, this relates to the <<ReportSpecification>> object where I will use the RunReport() function, but how about to generate the <<Document>> object in-line contents?

Kind regards,
Mads
No it doesn't. It relates to the Project Interface.RunReport() method. The last parameter allows you to define the format the report will be generated to. (at least in v 12.1 that is the case)

Geert

Mads Kirstan

  • EA Novice
  • *
  • Posts: 14
  • Karma: +1/-0
    • View Profile
Re: Automate printing of Documents
« Reply #4 on: October 25, 2016, 11:38:50 pm »
Hi Geert,

Sorry, but as I understand the RunReport() interface you need to supply a Report template as input, and yes this also allows you to specify output file format :-)

BUT, if I have objects for type Document, where the contents is not generated thru the Report generator, but is static, how do I in a automatic way generate all the pdf's for these objects?

Kind regards.
Mads

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Automate printing of Documents
« Reply #5 on: October 26, 2016, 12:44:26 am »
Hi Geert,

Sorry, but as I understand the RunReport() interface you need to supply a Report template as input, and yes this also allows you to specify output file format :-)

BUT, if I have objects for type Document, where the contents is not generated thru the Report generator, but is static, how do I in a automatic way generate all the pdf's for these objects?

Kind regards.
Mads
What type of objects are you talking about?
Objects with a linked document? In that case you can create a template that simply generates the linked document and use that template with the RunReport() operation.

Geert