⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 print.js

📁 从数据库中读取数据
💻 JS
字号:
/**
 * <p>Title: ????????????????</p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2003</p>
 * <p>Company: ????????????(????)????????</p>
 * @author Xin Xin
 * @version 1.0
 */

/**
 $Log: ExportExcel.js,v $
 Revision 1.10  2003/05/07 02:41:26  man
 no message

 Revision 1.9  2003/03/15 09:46:40  zhengjq
 no message
 
 Revision 1.8  2003/03/15 03:55:25  haozl
 no message

 Revision 1.4  2003/03/12 10:15:32  zhengjq
 no message

 Revision 1.3  2003/03/12 10:02:07  zhengjq
 no message

 Revision 1.2  2003/03/06 06:27:49  zhengjq
 no message

 Revision 1.1  2003/03/06 03:57:11  xinxin
 no message

 */

/*******************************
 * parameter:
 *        ????????????????????????????????????(????????'/'??'\\',????????'\')??
 *        ??????????????????????
 * return:
 *        True or False
 * ????Save("c:/save.xls",main.oTable)
 *    ??????main.oTable????????c:\??????????????save.xls??????
 *******************************/
function setTheResponse(theResponse)
{
	this.theResponse = theResponse;
}
function Save()
{
  	var args = Save.arguments;
	var i = 1, j = 1, k;

	ExcelApp = new ActiveXObject("Excel.Application");
	ExcelSheet = new ActiveXObject("Excel.Sheet");
	ExcelSheet.Application.Visible = false;

  	for (k = 0; k < args.length; k ++)
  	{
  		var Trows = args[k].rows.length;
  		for (var curr_row = 0; curr_row < Trows; curr_row ++)
  		{
  			var oRow = args[k].rows[curr_row];
  			for (var curr_col = 0; curr_col < oRow.cells.length; curr_col ++)
  			{
  				ExcelSheet.ActiveSheet.Cells(i,j).Value = oRow.cells[curr_col].innerText;
  				j ++;
  			}
  		 	i ++;
  		 	j = 1;
    	}
  	}
	return ExcelSheet.SaveAs(theResponse);
}
/*******************************
 * parameter:
 *       iframeid or tableid
 *
 * return:
 *******************************/

function printing()
{
    var args = printing.arguments;
    var nw=window.open ("", '_blank','top=0,left=0,width=1000,height=600,toolbar=no, menubar=no, scrollbars=yes , resizable=yes,location=no,status=no');
    nw.document.open("text/html","BIG5");
    nw.document.write("<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>");

    nw.document.write("<link href='../css/printstyle.css' type='text/css' rel=stylesheet>");

    for(i=0;i<args.length;i++)
    {
      var tb ;
      if (args[i]!=null)
      {
      	tb =args[i].outerHTML;
      	nw.document.write(tb);
      }
      else
      {
      	alert("<i18n:message key='E101097' />");
      	nw.close();
      	return ;
      }
    }
    nw.document.write('<scr'+'ipt>document.all.WebBrowser.ExecWB(8,1);document.all.WebBrowser.ExecWB(6,6);</scr'+'ipt>');
    nw.close();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -