/beta/include_UtilFunctions.asp

https://github.com/khaneh/Orders · 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. '------------- Prepare a Crystal Report to be printed / viewed
  7. '---------------------------------------------
  8. function PrepareReport (ReportFileName, ReportParameterNames, ReportParameterValues, ReturnURL)
  9. dim NewInvoicePrintForm
  10. printDate= shamsiToday()
  11. printTime= currentTime10()
  12. clientIP= Request.ServerVariables("REMOTE_ADDR")
  13. 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"
  14. Set RS_ReportLog = conn.Execute(mySQL).NextRecordSet
  15. NewInvoicePrintForm = RS_ReportLog("NewInvoicePrintForm")
  16. RS_ReportLog.close
  17. Set RS_ReportLog=Nothing
  18. PrepareReport=NewInvoicePrintForm
  19. end function
  20. %>
  21. <SCRIPT LANGUAGE="JavaScript">
  22. <!--
  23. function printThisReport(src,id){
  24. if (document.getElementById("f1")){
  25. //alert("?");
  26. window.frames['f1'].document.getElementsByName("ReportViewer1$CrystalReportViewer1$ctl02$ctl01")[0].click();
  27. }
  28. else{
  29. tempIframe=document.createElement("iframe");
  30. tempIframe.style.visibility="hidden";
  31. tempIframe.id="f1";
  32. tempIframe.width="10";
  33. tempIframe.height="10";
  34. tempIframe.src="/CRReports/?Id="+id+"&P=1";
  35. document.getElementsByTagName("Body")[0].appendChild(tempIframe);
  36. }
  37. }
  38. //-->
  39. </SCRIPT>