Hi, I have been working to create a PDF report for the creator record, I know I can do that using record template but in that particular template, I have to add every single field in order to get the report. Now no matter which field has input and which are empty, the same template is gonna show every field added and there is no point in changing the template again and again according to field inputs.
Now, I found a solution to create a page using HTML snippets to get the pdf report but that's not working as expected.
Below is the code and it's output for your better understanding.
<%{
val1 = Final_Mold_Checklist1[JG_Number.JG_Number == "JG21184"];
%>
<h1 style="text-align:Center">Final Mold Checklist</h1>
<table border="1px" width="700px" style="margin-left: auto; margin-right: auto;">
<div style="text-align:Center">
<tr>
<th>JG Number</th>
<td style="text-align:Center"><%=val1.JG_Number.JG_Number%></td>
</tr>
if(val1.Is_this_section_applicable_to_this_mold == "Yes")
{
<tr>
<th>57. Is any positive mechanism Provided in design to ensure 1st opening of mold from runner half? 流道侧开模</th>
<td style="text-align:Center"><%=val1.Is_any_positive_mechinsm_Provided_in_design_to_ensure_1st_opening_of_mold_from_runner_half%></td>
</tr>
<tr>
<th>58. Is sufficient gap provided for feed ejection(min. 20 mm more then feed system)? 至少超出进胶20mm</th>
<td style="text-align:Center"><%=val1.Is_sufficient_gap_provided_for_feed_ejection_min_20_mm_more_then_feed_system_20mm%></td>
</tr>
<tr>
<th>59. Is guide pillar length is sufficient for mold? 导柱深度是否够</th>
<td style="text-align:Center"><%=val1.Is_guide_pillar_length_is_sufficient_for_mold%></td>
</tr>
<tr>
<th>60. Is limit bolt/latch provided to restrict opening of cavity and runner stripper plate? 扣机</th>
<td style="text-align:Center"><%=val1.Radio1%></td>
</tr>
<tr>
<th>61. Are runner pullar pin provided? 流道针</th>
<td style="text-align:Center"><%=val1.Are_runner_pullar_pin_provided%></td>
</tr>
<tr>
<th>62. Is mechanism provided for sprue pullar opening, with sufficient opening? 是否有机构</th>
<td style="text-align:Center"><%=val1.Is_mechanism_provided_for_sprue_pullar_opening_with_sufficient_opening%></td>
</tr>
<tr>
<th>63. Ensure that sprue bush have taper fitting with runner stripper plate and should not come out during mold opening? 浇口套固定</th>
<td style="text-align:Center"><%=val1.Ensure_that_sprue_bush_have_taper_fitting_with_runner_stripper_palte_and_should_not_come_out_durin%></td>
</tr>
<tr>
<th>QC Problems. (If Any) 此处输入检查问题点 </th>
<td style="text-align:Center"><%=val1.Other_Comments%></td>
</tr>
}
</table>
<%
}%>
If you see, the if condition is not working and it's showing as a text in the page.
What are the solutions to make this work.
The form is divided into sections and sometimes a couple of sections does not apply to the project and there is no point in adding N/A answer for 30 irrelevant fields rather than just add one more field which will say, this section does not apply to the project and the other fields will be hidden accordingly.
The same I'm trying to add in the HTML page but the conditions are not working.
Please let me know what is missing in my code.