Supportseite WaihonaPedia

ExportResearchCSVMacro


Usage

  • When a user is viewing a Research page and the export button (Send the answers) is pressed, the macro {{exportResearchToCSV /}} is called by the page WaihonaCode/researchSheet
  • The macro can be also called on any wiki page that contains a 'WaihonaCode.researchClass' object 
  • This macro can be inserted from the Wysiwyg editor: Edit>Wysiwyg>Macro>Insert Macro>exportResearchToCSV

Options

  • This macro does not have any parameters in this version.

Code

You can see code page under WaihonaMacros/ExportResearchCSVMacro (this page). The following actions are performed:

  • Initially we get from the current research document, the 'WaihonaCode.researchClass' object and all the properties from the it. As we do not need all the information, some of these properties are skipped.
    • The names of the remaining properties and the other 4 meta elements are inserted in the table header's cells, forming the columns, respectively, the values of each property and the values of the metas are inserted in the table body cells on each row.  
  • Secondly, we grab all the questionnaires information from the research in order to populate the table.
    • For all the questionnaires from a research, we get the object of questionnaire class type (which is created dynamically depending on the questionnaire name/type) and a new row header is created with the names of obtained object properties. The values of the page properties are inserted in the cells of table body.
  • Finally, after the button is pressed, we enable the flag on send data (datasend variable) for the current user participating in the current research

Results

  • One CSV file is generated and available for download. This file needs to be opened using semicolon (;) as separator and UTF-8 as character set.

Über den Inhalt der Website

Alle Informationen auf dieser WebSite dienen ausschließlich der Aufklärung. Der richtige Ort, um spezifischen medizinischen Rat, Diagnosen und Behandlungen zu erhalten, ist Ihr Arzt. Die Nutzung dieser Website erfolgt ausschließlich auf eigene Gefahr. Wenn Sie etwas finden, das Ihrer Meinung nach einer Korrektur oder Klärung bedarf, lassen Sie es uns bitte wissen: 

Senden Sie eine E-Mail: info@cdlsWorld.org