Question

Save output from HTML report into a SQL database table

  • 19 March 2018
  • 2 replies
  • 21 views

I have a workspace that is using a polygon drawn by the user to search multiple layers, write a html report and email the html report to the user. The html report is generated using the htmlreportgenerator, htmllayouter and writehtmlfile. The workspace is run in FME server.

In the workspace, I'm saving the username, email and polygon to a SQL database to keep a record of what reports are run. However, I would like to be able to save the html report to the table as well so that it can be retrieved to see what results have been provided in the report. It would not be possible to rerun the report as the data changes and it is important to see the data results as it was generated for the user at that time.

Is it possible to do this and if so what attribute type would you use to write the the html output to the SQL table?

If this can't be done, does FME server save the output of the workspace somewhere? The HTML report would have the date and time appended to the report name so it would be unique for each report. I could then add a link to the location of the html report to the table and it could be retrieved this way.

Thanks

Catherine


2 replies

Userlevel 1
Badge +18

You can store the html as a blob into your database. But I think it's easier to store the html on the filesystem and only store the link to this file in the database.

Userlevel 4
Badge +25

I agree with @stalknecht in that it's probably best to write the report to a file. You can do this by adding a FeatureWriter right before your HTML writer (or find the output of writehtmlfile, I am not familiar with that, is it a custom transformer?)

Reply