"[SOLVED] dumping text file inside a report generated"

tennenrishin
tennenrishin New Altair Community Member
edited November 5 in Community Q&A
Generating a report, I would like to include a snapshot of a text file. How can this be accomplished?

(Is there an easy way to read the text file into a macro? Or alternatively, is there a way to report a Document object? The following doesn't seem to work for me:)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.2.006">
 <context>
   <input/>
   <output/>
   <macros/>
 </context>
 <operator activated="true" class="process" compatibility="5.2.006" expanded="true" name="Process">
   <process expanded="true" height="431" width="681">
     <operator activated="true" class="text:read_document" compatibility="5.2.003" expanded="true" height="60" name="Read Document" width="90" x="112" y="75">
       <parameter key="file" value="file.txt"/>
     </operator>
     <operator activated="true" class="reporting:generate_report" compatibility="5.2.000" expanded="true" height="76" name="Generate Report" width="90" x="246" y="75">
       <parameter key="report_name" value="hi"/>
       <parameter key="format" value="HTML"/>
       <parameter key="html_output_directory" value="C:\Users\isak\Documents\hi"/>
       <parameter key="pdf_output_file" value="C:\Users\isak\Documents\hi.pdf"/>
     </operator>
     <operator activated="true" class="reporting:report" compatibility="5.2.000" expanded="true" height="60" name="Report" width="90" x="380" y="75">
       <parameter key="report_name" value="hi"/>
       <parameter key="specified" value="true"/>
       <parameter key="reportable_type" value="Document"/>
       <parameter key="renderer_name" value="Document"/>
       <list key="parameters"/>
     </operator>
     <connect from_op="Read Document" from_port="output" to_op="Generate Report" to_port="through 1"/>
     <connect from_op="Generate Report" from_port="through 1" to_op="Report" to_port="reportable in"/>
     <portSpacing port="source_input 1" spacing="0"/>
     <portSpacing port="sink_result 1" spacing="0"/>
   </process>
 </operator>
</process>
Thanks for any help
Isak

Answers

  • tennenrishin
    tennenrishin New Altair Community Member
    I don't know why it works, but I just discovered this workaround by accident:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.2.006">
     <context>
       <input/>
       <output/>
       <macros/>
     </context>
     <operator activated="true" class="process" compatibility="5.2.006" expanded="true" name="Process">
       <process expanded="true" height="431" width="681">
         <operator activated="true" class="text:read_document" compatibility="5.2.003" expanded="true" height="60" name="Read Document" width="90" x="112" y="75">
           <parameter key="file" value="file.txt"/>
         </operator>
         <operator activated="true" class="reporting:generate_report" compatibility="5.2.000" expanded="true" height="76" name="Generate Report" width="90" x="246" y="75">
           <parameter key="report_name" value="hi"/>
           <parameter key="format" value="HTML"/>
           <parameter key="html_output_directory" value="C:\Users\isak\Documents\hi"/>
           <parameter key="pdf_output_file" value="C:\Users\isak\Documents\hi.pdf"/>
         </operator>
         <operator activated="true" class="reporting:report" compatibility="5.2.000" expanded="true" height="60" name="Report" width="90" x="380" y="75">
           <parameter key="report_name" value="hi"/>
           <parameter key="specified" value="true"/>
           <parameter key="reportable_type" value="File"/>
           <parameter key="renderer_name" value="Text View"/>
           <list key="parameters"/>
         </operator>
         <connect from_op="Read Document" from_port="output" to_op="Generate Report" to_port="through 1"/>
         <connect from_op="Generate Report" from_port="through 1" to_op="Report" to_port="reportable in"/>
         <portSpacing port="source_input 1" spacing="0"/>
         <portSpacing port="sink_result 1" spacing="0"/>
       </process>
     </operator>
    </process>
    Send a Document object into the Report operator, but select reportable type: File.