/beta/include_UtilFunctions.asp
ASP | 45 lines | 33 code | 6 blank | 6 comment | 1 complexity | f07d22bf03771e071a368a29bcff1dec MD5 | raw file
1<% 2'IMPORTANT NOTE: 3' This include file needs "include_farsiDateHandling.asp" to be included beforehand. 4' Because it uses shamsiToday() function. 5 6'--------------------------------------------- 7'------------- Prepare a Crystal Report to be printed / viewed 8'--------------------------------------------- 9function PrepareReport (ReportFileName, ReportParameterNames, ReportParameterValues, ReturnURL) 10 dim NewInvoicePrintForm 11 printDate= shamsiToday() 12 printTime= currentTime10() 13 clientIP= Request.ServerVariables("REMOTE_ADDR") 14 15 mySQL="INSERT INTO ReportLog (PrintedBy, PrintDate, PrintTime, clientIP, ReportFileName, ReportParameterNames, ReportParameterValues, ReturnURL) VALUES('"& session("ID") & "',N'"& printDate & "', N'"& printTime & "', N'"& clientIP & "', N'"& ReportFileName & "', N'"& ReportParameterNames & "', N'"& ReportParameterValues & "', N'"& ReturnURL & "' ); SELECT @@Identity AS NewInvoicePrintForm" 16 17 Set RS_ReportLog = conn.Execute(mySQL).NextRecordSet 18 NewInvoicePrintForm = RS_ReportLog("NewInvoicePrintForm") 19 20 RS_ReportLog.close 21 Set RS_ReportLog=Nothing 22 PrepareReport=NewInvoicePrintForm 23end function 24 25%> 26<SCRIPT LANGUAGE="JavaScript"> 27<!-- 28function printThisReport(src,id){ 29 if (document.getElementById("f1")){ 30 //alert("?"); 31 window.frames['f1'].document.getElementsByName("ReportViewer1$CrystalReportViewer1$ctl02$ctl01")[0].click(); 32 33 } 34 else{ 35 tempIframe=document.createElement("iframe"); 36 tempIframe.style.visibility="hidden"; 37 tempIframe.id="f1"; 38 tempIframe.width="10"; 39 tempIframe.height="10"; 40 tempIframe.src="/CRReports/?Id="+id+"&P=1"; 41 document.getElementsByTagName("Body")[0].appendChild(tempIframe); 42 } 43} 44//--> 45</SCRIPT>