[SOLVED] PDF Report in a LoopFiles

pedata
pedata New Altair Community Member
edited November 5 in Community Q&A
Dear rapid-Team,
I have a problem creating pdf reports in a file loop.
The loop works fine (My test: files opened in the loop and saved as new file => OK).
The pdf report works in principle BUT during the loop a report is created ONLY for the last file in the file list.
Is this a user error or a bug?
Thanks for help .. and for your great work!!

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.3.000">
 <context>
   <input/>
   <output/>
   <macros/>
 </context>
 <operator activated="true" class="process" compatibility="5.3.000" expanded="true" name="Process">
   <process expanded="true" height="839" width="681">
     <operator activated="true" class="loop_files" compatibility="5.3.000" expanded="true" height="60" name="Loop Files" width="90" x="179" y="30">
       <parameter key="directory" value="D:\FociExp-new\LD_V013I + II\test"/>
       <parameter key="filter" value=".*RTprob[.]txt"/>
       <process expanded="true" height="839" width="701">
         <operator activated="true" class="read_csv" compatibility="5.3.000" expanded="true" height="60" name="Read CSV (2)" width="90" x="45" y="30">
           <parameter key="csv_file" value="%{file_path}"/>
           <parameter key="column_separators" value="&#9;"/>
           <parameter key="use_quotes" value="false"/>
           <parameter key="date_format" value="yyyy.MM.dd G 'at' HH:mm:ss z"/>
           <list key="annotations">
             <parameter key="0" value="Name"/>
           </list>
           <parameter key="locale" value="German"/>
           <parameter key="encoding" value="windows-1252"/>
           <list key="data_set_meta_data_information">
             <parameter key="0" value="idx .true.integer.id"/>
             <parameter key="1" value="Area.true.integer.attribute"/>
             <parameter key="2" value="Mean.true.real.attribute"/>
             <parameter key="3" value="StdDev.false.real.attribute"/>
             <parameter key="4" value="Min.false.integer.attribute"/>
             <parameter key="5" value="Max.false.integer.attribute"/>
             <parameter key="6" value="XM.false.real.attribute"/>
             <parameter key="7" value="YM.false.real.attribute"/>
             <parameter key="8" value="BX.false.integer.attribute"/>
             <parameter key="9" value="BY.false.integer.attribute"/>
             <parameter key="10" value="Width.false.integer.attribute"/>
             <parameter key="11" value="Height.false.integer.attribute"/>
             <parameter key="12" value="Circ\..true.real.attribute"/>
             <parameter key="13" value="IntDen.false.integer.attribute"/>
             <parameter key="14" value="Median.false.integer.attribute"/>
             <parameter key="15" value="RawIntDen.false.integer.attribute"/>
             <parameter key="16" value="Slice.false.integer.attribute"/>
             <parameter key="17" value="AR.true.real.attribute"/>
             <parameter key="18" value="Round.true.real.attribute"/>
             <parameter key="19" value="Solidity.false.real.attribute"/>
             <parameter key="20" value="Up25Mean.true.real.attribute"/>
             <parameter key="21" value="Up4Pix.true.real.attribute"/>
             <parameter key="22" value="Mean-CH2.true.real.attribute"/>
             <parameter key="23" value="Max-CH2.true.integer.attribute"/>
             <parameter key="24" value="Median-CH2.false.integer.attribute"/>
             <parameter key="25" value="Up25Mean-CH2.true.real.attribute"/>
             <parameter key="26" value="Up50Mean-CH2.false.integer.attribute"/>
             <parameter key="27" value="IntDen-CH2.false.integer.attribute"/>
             <parameter key="28" value="Up4Pix-CH2.true.real.attribute"/>
             <parameter key="29" value="Z2.true.integer.label"/>
             <parameter key="30" value="Z1.true.integer.attribute"/>
             <parameter key="31" value="Z22.true.integer.attribute"/>
             <parameter key="32" value="Z3.true.integer.attribute"/>
             <parameter key="33" value="-1-.false.integer.attribute"/>
             <parameter key="34" value="p1.false.real.attribute"/>
             <parameter key="35" value="p2.false.real.attribute"/>
             <parameter key="36" value="p20.false.real.attribute"/>
             <parameter key="37" value="p22.false.real.attribute"/>
             <parameter key="38" value="p25.false.real.attribute"/>
             <parameter key="39" value="-2-.false.integer.attribute"/>
             <parameter key="40" value="p1*p2.false.real.attribute"/>
             <parameter key="41" value="p1*p20.false.real.attribute"/>
             <parameter key="42" value="p1*p22.false.real.attribute"/>
             <parameter key="43" value="p1*p25.false.real.attribute"/>
             <parameter key="44" value="p2*p20.false.real.attribute"/>
             <parameter key="45" value="p2*p22.false.real.attribute"/>
             <parameter key="46" value="p2*p25.false.real.attribute"/>
             <parameter key="47" value="p20*p22.false.real.attribute"/>
             <parameter key="48" value="p20*p25.false.real.attribute"/>
             <parameter key="49" value="p22*p25.false.real.attribute"/>
             <parameter key="50" value="p1*p2*p20.false.real.attribute"/>
             <parameter key="51" value="p1*p2*p22.false.real.attribute"/>
             <parameter key="52" value="p1*p2*p25.false.real.attribute"/>
             <parameter key="53" value="p1*p20*p22.false.real.attribute"/>
             <parameter key="54" value="p1*p20*p25.false.real.attribute"/>
             <parameter key="55" value="p1*p22*p25.false.real.attribute"/>
             <parameter key="56" value="p2*p20*p22.false.real.attribute"/>
             <parameter key="57" value="p2*p20*p25.false.real.attribute"/>
             <parameter key="58" value="p2*p22*p25.false.real.attribute"/>
             <parameter key="59" value="p20*p22*p25.false.real.attribute"/>
           </list>
         </operator>
         <operator activated="true" class="provide_macro_as_log_value" compatibility="5.3.000" expanded="true" height="60" name="Provide Macro as Log Value" width="90" x="179" y="165">
           <parameter key="macro_name" value="file_name"/>
         </operator>
         <operator activated="true" class="log" compatibility="5.3.000" expanded="true" height="60" name="Log (2)" width="90" x="380" y="165">
           <list key="log">
             <parameter key="filename" value="operator.Provide Macro as Log Value.value.macro_value"/>
           </list>
         </operator>
         <operator activated="true" class="reporting:generate_report" compatibility="5.3.000" expanded="true" height="76" name="Generate Report" width="90" x="246" y="30">
           <parameter key="report_name" value="Trep"/>
           <parameter key="pdf_output_file" value="%{file_path}.pdf"/>
           <parameter key="pdf_template_file" value="D:\Program Files\Rapid-I\RapidMiner5\no file selected"/>
           <parameter key="image_template_file" value="D:\Program Files\Rapid-I\RapidMiner5\no file selected"/>
           <parameter key="section_one_font" value="courier"/>
           <parameter key="section_two_font" value="courier"/>
           <parameter key="section_three_font" value="courier"/>
           <parameter key="section_four_font" value="courier"/>
           <parameter key="section_five_font" value="courier"/>
           <parameter key="text_content_font" value="courier"/>
         </operator>
         <operator activated="true" class="reporting:report" compatibility="5.3.000" expanded="true" height="60" name="Report" width="90" x="447" y="30">
           <parameter key="report_name" value="Trep"/>
           <parameter key="specified" value="true"/>
           <parameter key="reportable_type" value="Data Table"/>
           <parameter key="renderer_name" value="Plot View"/>
           <list key="parameters">
             <parameter key="plotter" value="Scatter"/>
             <parameter key="scatter_axis_x_axis" value="Up25Mean"/>
             <parameter key="scatter_axis_x_axis_log_scale" value="false"/>
             <parameter key="scatter_axis_y_axis" value="Up25Mean-CH2"/>
             <parameter key="scatter_axis_y_axis_log_scale" value="false"/>
             <parameter key="scatter_plot_column" value="Z22"/>
             <parameter key="scatter_jitter_amount" value="0"/>
             <parameter key="scatter_rotate_labels" value="false"/>
             <parameter key="scatter_multiple_axis_x_axis_log_scale" value="false"/>
             <parameter key="scatter_multiple_jitter_amount" value="0"/>
             <parameter key="scatter_multiple_rotate_labels" value="false"/>
             <parameter key="scatter_matrix_jitter_amount" value="0"/>
             <parameter key="bubble_axis_x_axis_log_scale" value="false"/>
             <parameter key="bubble_axis_y_axis_log_scale" value="false"/>
             <parameter key="bubble_rotate_labels" value="false"/>
             <parameter key="parallel_rotate_labels" value="false"/>
             <parameter key="parallel_local_normalization" value="false"/>
             <parameter key="deviation_rotate_labels" value="false"/>
             <parameter key="deviation_local_normalization" value="false"/>
             <parameter key="series_rotate_labels" value="false"/>
             <parameter key="series_multiple_rotate_labels" value="false"/>
             <parameter key="som_jitter_amount" value="0"/>
             <parameter key="block_axis_x_axis_log_scale" value="false"/>
             <parameter key="block_axis_y_axis_log_scale" value="false"/>
             <parameter key="block_jitter_amount" value="0"/>
             <parameter key="block_rotate_labels" value="false"/>
             <parameter key="pie_absolute_values" value="false"/>
             <parameter key="pie_aggregation" value="none"/>
             <parameter key="pie_use_distinct" value="false"/>
             <parameter key="pie_explosion_amount" value="0"/>
             <parameter key="pie_3d_absolute_values" value="false"/>
             <parameter key="pie_3d_aggregation" value="none"/>
             <parameter key="pie_3d_use_distinct" value="false"/>
             <parameter key="ring_absolute_values" value="false"/>
             <parameter key="ring_aggregation" value="none"/>
             <parameter key="ring_use_distinct" value="false"/>
             <parameter key="ring_explosion_amount" value="0"/>
             <parameter key="bars_absolute_values" value="false"/>
             <parameter key="bars_rotate_labels" value="false"/>
             <parameter key="bars_aggregation" value="none"/>
             <parameter key="bars_use_distinct" value="false"/>
             <parameter key="bars_orientation" value="vertical"/>
             <parameter key="bars_stacked_absolute_values" value="false"/>
             <parameter key="bars_stacked_rotate_labels" value="false"/>
             <parameter key="bars_stacked_aggregation" value="none"/>
             <parameter key="bars_stacked_use_distinct" value="false"/>
             <parameter key="bars_stacked_orientation" value="vertical"/>
             <parameter key="pareto_rotate_labels" value="false"/>
             <parameter key="pareto_sorting_direction" value="Descending Keys"/>
             <parameter key="pareto_show_bar_labels" value="true"/>
             <parameter key="pareto_show_cumulative_labels" value="false"/>
             <parameter key="distribution_rotate_labels" value="false"/>
             <parameter key="histogram_absolute_values" value="false"/>
             <parameter key="histogram_rotate_labels" value="false"/>
             <parameter key="histogram_log_scale" value="false"/>
             <parameter key="histogram_number_of_bins" value="40"/>
             <parameter key="histogram_opaqueness" value="100"/>
             <parameter key="histogram_color_absolute_values" value="false"/>
             <parameter key="histogram_color_rotate_labels" value="false"/>
             <parameter key="histogram_color_log_scale" value="false"/>
             <parameter key="histogram_color_number_of_bins" value="40"/>
             <parameter key="histogram_color_opaqueness" value="100"/>
           </list>
           <parameter key="image_height" value="810"/>
         </operator>
         <connect from_op="Read CSV (2)" 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_file object" spacing="0"/>
         <portSpacing port="source_in 1" spacing="0"/>
         <portSpacing port="sink_out 1" spacing="0"/>
       </process>
     </operator>
     <operator activated="true" class="log_to_data" compatibility="5.3.000" expanded="true" height="76" name="Log to Data" width="90" x="380" y="30"/>
     <connect from_op="Log to Data" from_port="exampleSet" to_port="result 1"/>
     <portSpacing port="source_input 1" spacing="0"/>
     <portSpacing port="sink_result 1" spacing="0"/>
     <portSpacing port="sink_result 2" spacing="0"/>
   </process>
 </operator>
</process>
Tagged:

Answers

  • MariusHelf
    MariusHelf New Altair Community Member
    Unfortunately, the Reporting operators have a bit of an issue when used in combination with loops. We are aware of it and have an internal ticket for this problem.

    Until then, as a workaround, you could try to create only one report, but add several entries to it. I.e. move the Generate Report operator out of the loop and place it in front of it.

    Best regards,
    Marius
  • pedata
    pedata New Altair Community Member
    Thanks Marius,
    for the suggested workaround.
    It works and I can live with that.

    (I already tried it but could not manage to bring it to work. Probably my mistake was to us the %{file_name} macro in the CreateReport operator before it will be created in the LoopFile operator.)

    Thanks,
    Peter