Alright I'm taking over this cf application where there is no documentation on 500+ cfm file and 255 db tables. Complete nightmare. And I'm new to CF.
Currently I'm trying fix a 'Print All Reports' button where it prints out all reports in a query. Currently when the user clicks the 'Print All Reports' Button. A list of reports names is displayed (from the query). I took out the dialog so it prints automatically.
Next the user must click on the currently opened windo to open the next window which is an actual report and then that one will print. Then I must click that window to get the next one to come up and so on. They all come up in the same window.
I want to be able to just click the button and every report prints out.
The query is a bunch of selects, unioned together, selecting 'PrintForm = path of report'
<cfoutput>
<cfswitch expression="#ProcessType#">
<!--------------------------------------------------------------------------------------------->
<cfcase value="GetReports">
<html>
<!--------------------------------------------------------------------------------------------->
<!---some regular code---->
<cfform name="PRForm" action="#PrintReports['PrintForm'][1]#&ProcessType=PrintNextReport&IgnorePrintOption=1">
<cfloop query="PrintReports" startrow="2">
<input type="Hidden" name="PrintReportURL#CurrentRow#" value="#PrintForm#">
</cfloop>
</cfform>
<!---some more code
Here's the action
--->
<cfloop query="PrintReports">
<cfif CurrentRow LT 10> </cfif>
<b>#CurrentRow#.</b>
<CF_Out x="#ReportDate#" Date="True"> - <CF_Out x="#FormName#" MC="True"><br>
</cfloop>
<!--- close out the table then
Here's the javascript for the main page, in new window, just list all the reports and prints it automatically
--->
<script language="JavaScript">
document.onclick = nextOne;
function nextOne()
{
PRForm.submit();
}
function PRProcess()
{
document.body.insertAdjacentHTML("beforeEnd", "<object id='idWBPrint' width=0 height=0
classid='clsid:8856F961-340A-11D0-A96B-00C04FD705A2'></object>");
idWBPrint.ExecWB(6, 2);
idWBPrint.outerHTML = "";
}
setTimeout(PRProcess,1000);
</script>
</html>
</cfcase>
<!--------------------------------------------------------------------------------------------->
<!---last and only other case ---->
<cfcase value="PrintNextReport">
<cfif IsDefined("Form.FieldNames")>
<cfform name="PRForm" action="#Evaluate("Form." & ListFirst(Form.FieldNames))
#&ProcessType=PrintNextReport&IgnorePrintOption=1">
<cfloop list="#ListDeleteAt(Form.FieldNames,1)#" index="i">
<input type="Hidden" name="#i#" value="#Evaluate("Form." & i)#">
</cfloop>
</cfform>
</cfif>
<script language="JavaScript">
document.onClick = nextOne;
function nextOne()
{
<cfif IsDefined("Form.FieldNames")>
PRForm.submit();
<cfelse>
window.close();
</cfif>
}
function PRProcess()
{
document.body.insertAdjacentHTML("beforeEnd", "<object id='idWBPrint' width=0 height=0
classid='clsid:8856F961-340A-11D0-A96B-00C04FD705A2'></object>");
idWBPrint.ExecWB(6, 2);
idWBPrint.outerHTML = "";
<cfif IsDefined("Form.FieldNames") IS False>
setTimeout(nextOne,3000);
</cfif>
}
setTimeout(PRProcess,1000);
</script>
</cfcase>
</cfswitch>
</cfoutput>
I'm not even sure how PRProcess() gets called either.
Thanks for any help or suggestions,
CF Newbie
Currently I'm trying fix a 'Print All Reports' button where it prints out all reports in a query. Currently when the user clicks the 'Print All Reports' Button. A list of reports names is displayed (from the query). I took out the dialog so it prints automatically.
Next the user must click on the currently opened windo to open the next window which is an actual report and then that one will print. Then I must click that window to get the next one to come up and so on. They all come up in the same window.
I want to be able to just click the button and every report prints out.
The query is a bunch of selects, unioned together, selecting 'PrintForm = path of report'
<cfoutput>
<cfswitch expression="#ProcessType#">
<!--------------------------------------------------------------------------------------------->
<cfcase value="GetReports">
<html>
<!--------------------------------------------------------------------------------------------->
<!---some regular code---->
<cfform name="PRForm" action="#PrintReports['PrintForm'][1]#&ProcessType=PrintNextReport&IgnorePrintOption=1">
<cfloop query="PrintReports" startrow="2">
<input type="Hidden" name="PrintReportURL#CurrentRow#" value="#PrintForm#">
</cfloop>
</cfform>
<!---some more code
Here's the action
--->
<cfloop query="PrintReports">
<cfif CurrentRow LT 10> </cfif>
<b>#CurrentRow#.</b>
<CF_Out x="#ReportDate#" Date="True"> - <CF_Out x="#FormName#" MC="True"><br>
</cfloop>
<!--- close out the table then
Here's the javascript for the main page, in new window, just list all the reports and prints it automatically
--->
<script language="JavaScript">
document.onclick = nextOne;
function nextOne()
{
PRForm.submit();
}
function PRProcess()
{
document.body.insertAdjacentHTML("beforeEnd", "<object id='idWBPrint' width=0 height=0
classid='clsid:8856F961-340A-11D0-A96B-00C04FD705A2'></object>");
idWBPrint.ExecWB(6, 2);
idWBPrint.outerHTML = "";
}
setTimeout(PRProcess,1000);
</script>
</html>
</cfcase>
<!--------------------------------------------------------------------------------------------->
<!---last and only other case ---->
<cfcase value="PrintNextReport">
<cfif IsDefined("Form.FieldNames")>
<cfform name="PRForm" action="#Evaluate("Form." & ListFirst(Form.FieldNames))
#&ProcessType=PrintNextReport&IgnorePrintOption=1">
<cfloop list="#ListDeleteAt(Form.FieldNames,1)#" index="i">
<input type="Hidden" name="#i#" value="#Evaluate("Form." & i)#">
</cfloop>
</cfform>
</cfif>
<script language="JavaScript">
document.onClick = nextOne;
function nextOne()
{
<cfif IsDefined("Form.FieldNames")>
PRForm.submit();
<cfelse>
window.close();
</cfif>
}
function PRProcess()
{
document.body.insertAdjacentHTML("beforeEnd", "<object id='idWBPrint' width=0 height=0
classid='clsid:8856F961-340A-11D0-A96B-00C04FD705A2'></object>");
idWBPrint.ExecWB(6, 2);
idWBPrint.outerHTML = "";
<cfif IsDefined("Form.FieldNames") IS False>
setTimeout(nextOne,3000);
</cfif>
}
setTimeout(PRProcess,1000);
</script>
</cfcase>
</cfswitch>
</cfoutput>
I'm not even sure how PRProcess() gets called either.
Thanks for any help or suggestions,
CF Newbie