问题描述
=====打印代码========publicpartialclassReportView:System.Web.UI.Page{privateClassDataclsData=newClassData();privateClassCommonclsCommon=newClassCommon();privateReportDocumentTmpReport;protectedvoidPage_Load(objectsender,EventArgse){stringstrRptName=Request["rpt"].ToString();if(File.Exists(Server.MapPath("~\Reports\"+strRptName))){ViewReport(strRptName);}else{Response.Write("<script>alert('报表文件["+strRptName+"]不存在!');history.back();</script>");return;}}privatevoidViewReport(stringrptName){TmpReport=newReportDocument();stringrptPath=Server.MapPath("~\Reports\"+rptName);TmpReport.FileName=rptName;TmpReport.Load(rptPath);DataSetdt=newDataSet();stringstrSql="SelectID,ItemCode,ItemName,Amount,AddDate";strSql=strSql+"FromTb_CostDetail";dt=clsData.GetDataSet(strSql);TmpReport.SetDataSource(dt);CryRptView.ReportSource=TmpReport;}}=======发生网页错误=============sys.webforms.pagerequestmanagerParserErrorException:Themessagereceivedfromtheservercouldnotbeparsed.CommoncausesforthiserrorarewhentheresponseismodifiedbycallstoResponse.Write(),responsefilters,HttpModules,orservertraceisenabled.Details:errorparsingnear'<!DOCTYPEhtmlP'.代码:0URL:http://localhost:489212/FMS/CostRecord.aspx补充:哪位大侠能解决问题或给个成功执行的打印代码,谢谢!
解决方案
解决方案二:
自己顶顶