I'm triying to do a report based on 2 tables:
Batch: batch_id, batch_code, batch_user, batch_date, batch_size, batch_smp, batch_maf, batch_mif, batch_status
Jobs: jobs_id, batch_id, j_fault_id, jobs_code, jobs_num, jobs_sampled, jobs_imei, jobs_results, jobs_fname, jobs_fmaj, jobs_fmin
"Batch" is used in a form and "Jobs" is used in a subform of "Batch".
The ideia is to have a report for every Batch_Code. I'm trying to use this code on the report but seeems it is not working:
Code: Select all
$transaction = $formValue['hidden_batch_code'];
$sql = "CREATE TABLE $dataTable"."details SELECT batch_id, batch_code, batch_user, batch_date, batch_size, batch_smp_size, batch_maf, batch_mif, batch_status";
$sql = $sql." FROM batch";
$sql = $sql." WHERE batch_code = '$transaction'";
nuRunQuery($sql);
$printHTML = '
<object id=factory style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
viewastext codebase="ScriptX.cab#Version=5,0,5,35">
</object>
<script defer>
function window.onload() {
factory.printing.header = "HELLO WORLD!"
factory.printing.footer = "Printing by ScriptX 5.0"
factory.printing.portrait = false
idPrint.disabled = false;
}
</script>
<p><input disabled name=idPrint type=button value="Print the page"
onclick="factory.printing.Print(0)">
';
$sql = "UPDATE $dataTable SET printButton = '$printHTML' ";
nuRunQuery($sql);
Regards,
Rui