回复 2楼frank.zhang的帖子
前台:
<body language="javascript" onload="return window_onload()">
<form id="Form1" method="post" runat="server">
<object style="Z-INDEX: 0" id="arv" codebase="arview2.cab" classid="clsid:8569D715-FF88-44BA-8D1D-AD3E59543DDE" width="100%" height="100%" VIEWASTEXT>
<param name="_ExtentX" value="23892" />
<param name="_ExtentY" value="16880" />
</object>
</form>
</body>
后台:
DataSet myDs = new DataSet();
DataDynamics.ActiveReports.ActiveReport rep = new DataDynamics.ActiveReports.ActiveReport();
switch (Request.QueryString["RepName"].ToLower())
{
//订单
case "rptorder":
myDs = SQLServerDAL.CommonMethod.GetList("VOrderDetailPrint", "FOrderDetailId", strWhere);
rep = new WebApp.Report.NewActiveReport1();
break;
}
rep.DataSource = myDs;
rep.DataMember = "ds";
rep.Run(false);
string userName = (Session["UserInfo"] as Model.TAccountInfo).FName;
rep.Document.Save(Server.MapPath("") + "\\ReportOutput\\" + userName + Request.QueryString["RepName"] + ".rdf",DataDynamics.ActiveReports.Document.RdfFormat.AR20);
ClientScriptManager CSM = Page.ClientScript;
string ScriptName = "clientScript";
if (!CSM.IsClientScriptBlockRegistered(ScriptName))
{
StringBuilder strScript = new StringBuilder();
strScript.Append("<script id='clientEventHandlersJS' language='javascript'>");
strScript.Append("function window_onload() {");
strScript.Append("document.getElementById('arv').datapath ='ReportOutput/" + userName + Request.QueryString["RepName"] + ".rdf';");
strScript.Append("}");
strScript.Append("</script>");
CSM.RegisterStartupScript(this.GetType(), ScriptName, strScript.ToString());
}
以上代码在IE中能正常显示 在Chrome中不显示 |