如何解决“加载文件期间的问题"?错误 [英] How To fix the "Problem During Loading the file" Error

查看:168
本文介绍了如何解决“加载文件期间的问题"?错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,

我正在从数据库中提取数据到EXCEL工作表. Excel工作表可容纳4万多行90列.看一下我在网站上使用的以下代码,

Hi friends ,

I am extracting the data from database to EXCEL sheet . the excel sheet carry''s more than 40000 rows and 90 columns . look at the below code which i have used in my website ,

string fileName = "attachment;filename= ArchivalReportOn_" +  DateTime.Now.ToString("dd-MM-yyyy-hh-mm-ss") + ".xls";
                    Response.Clear();
                    Response.AddHeader("content-disposition", fileName);
                    Response.Charset = "";
                    Response.Cache.SetCacheability(HttpCacheability.NoCache);
                    Response.ContentType = "application/ms-excel";
                    GridView gridview1 = new GridView();
                    gridview1.DataSource = dt;
                    gridview1.HeaderStyle.CssClass = "gridHeader";
                    gridview1.HeaderStyle.BackColor = System.Drawing.Color.Red;
                    gridview1.HeaderStyle.ForeColor = System.Drawing.Color.White;
                    gridview1.DataBind();
                    System.IO.StringWriter stringWrite = new System.IO.StringWriter();
                    System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);                   
                    gridview1.RenderControl(htmlWrite);
                    string s_styleInfo = @"<style> td { mso-number-format:""" + "\\@" + @"""; }</style>";
                    string s_excel = stringWrite.ToString();
                    Response.Write(s_styleInfo + s_excel);                   
                    Response.End();  



在检索数据时出现错误问题,如.Css那样加载文件和丢失文件",因此任何人都可以建议我如何解决该错误.



while retrieving data i am getting the error "Problem Loading File and Missing File like .Css" , So can any one suggest me how to fix that error .

推荐答案

那里这个问题有两种可能性.

1.要么CSS文件丢失,要么系统正在处理404页面(如果已配置),则浏览器会抱怨它不是CSS文件.

2.可能是您的服务器配置出现问题.如果它是WAMP的新安装,则不太可能.

只是为了验证内容,您可以在任何浏览器中查看源代码.

在浏览CSS文件时,如果将其带到另一个文件,则意味着您未正确链接该文件.您最好使用绝对路径(来自您的webroot)而不是相对路径.
There are two possibilities for this problem.

1. Either the CSS file is missing and your system is serving up a 404 page (if you''ve configured it) so the browser is complaining that it''s not a CSS file.

2. It could be that you have a server configuration issue. If it''s a new installation of WAMP, this is pretty unlikely.

Just to validate the stuff, you can view the source in any browser.

On browsing CSS file, if it takes you to another file that means you haven''t linked it properly. You may be better off using an absolute path (from your webroot) rather than a relative path.


这篇关于如何解决“加载文件期间的问题"?错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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