带excel导出的弹出窗口 [英] Popup window with excel export

查看:128
本文介绍了带excel导出的弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用弹出窗口生成报告我正在使用

Hi,

I am generating a report using a popup window i am opening the popup window using

window.open("Reports.aspx", "", "fullscreen=no, width=925,height=700,top=5,left=30", false);


在该窗口的代码后面我正在使用此代码打印报告


In that window's code behind i am printing report using this code

CrystalDecisions.Shared.ExportOptions expOp=crDocument.ExportOptions;				
CrystalDecisions.Shared.DiskFileDestinationOptions destOp=new CrystalDecisions.Shared.DiskFileDestinationOptions();
Response.ClearContent();
Response.ClearHeaders();
destOp.DiskFileName=Server.MapPath("..\\Reports\\")+Session.SessionID.ToString() + ".xls";
expOp.ExportFormatType=CrystalDecisions.Shared.ExportFormatType.Excel;
ExcelFormatOptions options = new ExcelFormatOptions();
options.ExcelUseConstantColumnWidth = false;
expOp.FormatOptions = options;
Response.ContentType = "application/vnd.ms-excel";
expOp.DestinationOptions=destOp;
expOp.ExportDestinationType=CrystalDecisions.Shared.ExportDestinationType.DiskFile;
crDocument.Export();
Response.WriteFile(destOp.DiskFileName);
Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1));
Response.Flush();
Response.Close();
System.IO.File.Delete(destOp.DiskFileName);
Response.End();


问题是我点击openi的按钮ng窗口两次秒窗口取第一个窗口的报告,第一个窗口显示空白。我想要两份报告都显示出来。我在这里做错了什么?


problem is when i click the button for opening window twice second window takes the report of first window and first window shows blank. I want both reports to show. am i doing some thing wrong here??

推荐答案

你可以尝试的一件事是转到Windows资源管理器,工具文件夹选项,文件类型,转到XLS类型,高级,并取消选中"在浏览器中打开"框。或类似的东西...然后它会尝试在Internet Explorer之外打开XLS文档,你不应该有浏览器问题
one thing you could try is going to windows explorer, tools folder options, file types, goto the XLS type, advanced, and uncheck the box that says "open in browser" or something like that ... then it'll try to open the XLS doc outside of internet explorer and you should not have a browser problem


这篇关于带excel导出的弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆