ideaconsult / Toxtree.js

http://ideaconsult.github.io/Toxtree.js/
2 stars 3 forks source link

Assessment report updates. (issue #171) #176

Closed gonzomir closed 8 years ago

gonzomir commented 8 years ago

Removed company field. Assessment DocLink has clickable icon next to it in Assessment details that opens the DocLink. Generated report DOCX filte is compressed.

vedina commented 8 years ago

Trying to generate report (Chrome) gives this error (and fails to generate docx)

Uncaught Error: InvalidStateError: Failed to read the 'responseText' property from 'XMLHttpRequest': The value is only accessible if the object's 'responseType' is '' or 'text' (was 'arraybuffer').xhr.onreadystatechange @ jszip-utils.js:93

Just accessing the report page (from the uses folder) gives an error - wondering why it needs to call this at all?

jtoxkit.js:4423 Error [3]: nullnull/myaccount/users?...
gonzomir commented 8 years ago

The problem is with opening the report file with file:// protocol. When requesting the DOCX template two bad thing happen:

  1. If you didn't change the location of assessment-repot.docx in ui-matrix.js line 1056, the request fails. Otherwise it is aborted by Chrome as CORS with wrong protocol.
  2. When JSZipUtils tries to get the binary data from the responce, it checks for xhr.response || xhr.responseText. The first does not exist because the request failed, so it tries responseText, which is not supported.

So, the report page should be opened with http(s):// protocol.

gonzomir commented 8 years ago

This now closes #160, #162, #165, #171

vedina commented 8 years ago

OK, my bad taking shortcuts while testing (usually disabling chrome file security is sufficient).

vedina commented 8 years ago

Confirmed it works fine if properly tested.

Annex 4 and Annex 5 sections are missing in the DOCX report ( but are in place in HTML)

Please add titles and links (as in HTML). Will postpone deciding on Excel files embedding for now #173 .