我用datareader导出数据到word中,在VS2005中调试一切正常,可是把程序放到服务器上,我一运行就在服务器上显示word,而不在客户端显示,为什么啊?
还有就是我用test.Quit();一关就出错为什么?导出word程序代码如下:try
{
test = new CCWordApp();
test.Open(); Assess assess = new Assess();
SqlDataReader dr = assess.GetMorePoint(); test.SetFontName("宋体");
test.SetFontSize(14);
test.SetAlignment("Center");
test.InsertText("详细考核结果清单");
test.InsertText("\r");
test.SetFont("nothing"); test.SetFontName("仿宋_GB2312");
test.SetAlignment("Left");
test.InsertLineBreak(1);
test.SetFontSize(10); while (dr.Read())
{
test.InsertText("高管姓名:");
test.InsertText(dr["ManagerName"].ToString());
test.InsertText("\r");
}
test.SaveAs(ConfigurationSettings.AppSettings["WordDoc"] + "temp.doc");
test.Open(ConfigurationSettings.AppSettings["WordDoc"] + "temp.doc");
dr.Close();
}
catch (Exception exc)
{
Response.Write(exc.Message);
}
还有就是我用test.Quit();一关就出错为什么?导出word程序代码如下:try
{
test = new CCWordApp();
test.Open(); Assess assess = new Assess();
SqlDataReader dr = assess.GetMorePoint(); test.SetFontName("宋体");
test.SetFontSize(14);
test.SetAlignment("Center");
test.InsertText("详细考核结果清单");
test.InsertText("\r");
test.SetFont("nothing"); test.SetFontName("仿宋_GB2312");
test.SetAlignment("Left");
test.InsertLineBreak(1);
test.SetFontSize(10); while (dr.Read())
{
test.InsertText("高管姓名:");
test.InsertText(dr["ManagerName"].ToString());
test.InsertText("\r");
}
test.SaveAs(ConfigurationSettings.AppSettings["WordDoc"] + "temp.doc");
test.Open(ConfigurationSettings.AppSettings["WordDoc"] + "temp.doc");
dr.Close();
}
catch (Exception exc)
{
Response.Write(exc.Message);
}
解决方案 »
- Gridview实现删除一行?!!!
- 未能加载文件或程序集“CNBlogs.DCT”或它的某一个依赖项。系统找不到指定的路径。
- 当在text1输入P按下键后如何让TextBox2自动显示main
- ASP.NET(C#)中使用FusionCharts的一些疑惑
- 关于做好的程序发布的问题,产生错误信息
- 谁能帮我解决这个问题?
- 无法从“object”转换为“ref object”
- 我做了一个webcustomcontrol控件在aspx运行后为什么在网页中显示不出来?(在线)
- 数据绑定问题
- insert语句和外键冲突的问题
- web页面如何一次性插入5W条左右的记录,不超时?
- 新手上路,多指点!50分求会员审核方法!
之后加上
Response.WriteFile(ConfigurationSettings.AppSettings["WordDoc"] + "temp.doc");
要在客户端,应该用ActiveX控件,或者下载
你急着用,再去摸索activex肯定来不及了
b/s模式lz再看看