For the first request, you can create an Output Document, and assign it after the second dynaform. Edt your Output document with the HTML editor and include the below code to display the grid along with the values:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<p align="center">SAP Report</p>
<p align="center"><span>@#creator_name @#employee_code </span></p>
<table cellspacing="0" border="1">
<tr><th>SAP Material Code</th><th>Material Description</th><th>Quantity</th><th>Unit</th><th>Building Name</th><th>Site</th><th>Parts</th><th>Floor</th><th>Note</th><th>Status</th></tr>
In the settings of your Output Document, set the Properties according to your requirement, for example select .pdf
if you want your Output document only in PDF format.
For your second requirement, it is better to create a separate PMT table in the database to store the grid values than using a Report table. Since grids contain multiple values, it is not easy to directly store grids in Report tables. The workaround for this would be to create a table PMT_SAPREPORT containing the fields of the grid along with the APP_UID which would store the Case Id. Then create the following trigger in your process, and set it to fire after the second task to store the values in database:
Code: Select all
$grid = @=gridVar;
foreach($grid as $row)
$app = @@APPLICATION;
$sapmc = $row['sapmc'];
$material = $row['materialdesc'];
$quantity = $row['Quantity'];
$unit = $row['unit'];
$building = $row['buildingname'];
$site = $row['Site'];
$parts = $row['Parts'];
$floor = $row['Floor'];
$note = $row['Note'];
$status = $row['dropdown0000000001_label'];
@@insert = executeQuery("INSERT INTO PMT_SAP(APP_UID,SAP,MATERIAL,QUANTITY,UNIT,BUILDING,SITE,PARTS,FLOOR,NOTE,STATUS) VALUES ('$app','$sapmc','$material','$quantity','$unit','$building','$site','$parts','$floor','$note','$status')");
If you want to store data from other fields, you can include them as well.
Please let us know if you have further doubts.
Hope this helps.