report.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. function ReportInfo() {
  2. this.title = "";
  3. this.reportName = "";
  4. this.width = 1024;
  5. this.height = 768;
  6. this.zoomRatio = 100;
  7. this.hideStatusBar = false;
  8. this.hideToolBar = false;
  9. this.hideStatusDlg = false;
  10. /**
  11. *
  12. */
  13. this.reportOption = "/rf";
  14. this.params = new ValueObject();
  15. this.getParams = function() { return this.params; }
  16. this.setParams = function(p_vo) { this.params = p_params; }
  17. this.set = function(p_value) {
  18. if( this.params != null )
  19. this.params.set("P_" + this.params.getSize(), p_value);
  20. }
  21. this.showPopup = function() {
  22. var inWidth = this.width;
  23. var inHeight = this.height;
  24. var x = screen.availWidth;
  25. var y = screen.availHeight;
  26. var xtop = Number((y - inHeight)/2);
  27. var xleft = Number((x - inWidth)/2);
  28. var url = "/dialog/dlgReport.screen?" + this.getParameter();
  29. window.open(url, '_blank', "top="+xtop+",left="+xleft+",width="+inWidth+",height="+inHeight+",SCROLLBARS=NO");
  30. }
  31. this.showPopupDebug = function() {
  32. var inWidth = this.width;
  33. var inHeight = this.height;
  34. var x = screen.availWidth;
  35. var y = screen.availHeight;
  36. var xtop = Number((y - inHeight)/2);
  37. var xleft = Number((x - inWidth)/2);
  38. var url = "/dialog/dlgReportDebug.screen?" + this.getParameter();
  39. window.open(url, '_blank', "top="+xtop+",left="+xleft+",width="+inWidth+",height="+inHeight+",SCROLLBARS=NO");
  40. }
  41. this.showFrame = function(frameObject) {
  42. if( frameObject == null )
  43. alert("FrameObject is null.");
  44. if( frameObject.src == null )
  45. alert("FrameObject.src is null.");
  46. frameObject.src = "/dialog/dlgReport.screen?" + this.getParameter();
  47. }
  48. this.getParameter = function() {
  49. var params_str = "&WINDOW_TITLE=" + encodeURIComponent(this.title)
  50. + "&REPORT_NAME=" + encodeURIComponent(this.reportName)
  51. + "&REPORT_OPTION=" + encodeURIComponent(this.reportOption)
  52. + "&HIDE_STATUS_BAR=" + this.hideStatusBar
  53. + "&HIDE_TOOL_BAR=" + this.hideToolBar
  54. + "&ZOOM_RATIO=" + this.zoomRatio
  55. + "&HIDE_STATUS_DLG=" + this.hideStatusDlg;
  56. for( var i = 0 ; i < this.params.getSize() ; i++ ) {
  57. params_str += "&P_" + i + "=" + encodeURIComponent(this.params.getValue(i));
  58. }
  59. params_str += "&P_SIZE=" + this.params.getSize();
  60. return params_str;
  61. }
  62. }