首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 编程语言 > .NET > C#.NET > The report you requested requires further information. 一种解决方案
【标  题】:The report you requested requires further information. 一种解决方案
【关键字】:The,report,you,requested,requires,further,information.
【来  源】:http://blog.csdn.net/silentwater/archive/2007/04/16/1567035.aspx

The report you requested requires further information. 一种解决方案

这个问题折磨了我一天,坐的我屁股疼。

问这个问题的人很多,不知道是否适用,仅供参考哈。

 

public partial class _Default : System.Web.UI.Page
    
{
        DataSet1 ds 
= new DataSet1();
       
private ReportDocument myreport;
        
protected void Page_Load(object sender, EventArgs e)
        
{
            Button1_Click(sender, e);
        }

        
protected void Button1_Click(object sender, EventArgs e)
        
{
            myreport 
= new ReportDocument();
            
string reportPath = Server.MapPath("CrystalReport.rpt");
            myreport.Load(reportPath);
            

            
string strProvider = "server=localhost;packet size=4096;user id=XXX;initial catalog=XXX;persist security info=True;password=XXXX";
            SqlConnection MyConn 
= new SqlConnection(strProvider);
            MyConn.Open();
            
string strSel = "Select a.bookno,a.cname,b.gname from [order] a,orderdetail b where a.bookno = b.bookno";
            SqlDataAdapter MyAdapter 
= new SqlDataAdapter(strSel, MyConn);
            DataSet ds 
= new DataSet();
            MyAdapter.Fill(ds, 
"DataTable1");
            myreport.SetDataSource(ds);

            Viewer.ReportSource 
= myreport;
        }


}

 

注意MyAdapter.Fill(ds, "DataTable1"); 这里的DataTable1必须与创建的Dataset1中的表名相同,否则会出现

The report you requested requires further information 信息。写成MyAdapter.Fill(ds);也不行。

祝好运! 

SSIS与开发:【上一篇】
《给初学者的Windows Vista的补遗手册》之074:【下一篇】
【相关文章】
  • The Matrix-1 Transcript
  • JasperReport介绍
  • 关于翻译《CSS - The Missing Manual》术语表的讨论与建议
  • The USB Webcam driver in Windows CE
  • ActiveReport for net WebViewer 设置zoom
  • .net托管环境下struct实例字段的内存布局(Layout)和大小(Size)
  • CrystalReport与ASP.net的集成
  • ireport + jasper使用笔记
  • Effective Code Reviews Without the Pain
  • Finally, I resolved the python-devel dependence issue
  • 【随机文章】
  • 维护Sql Server中表的索引
  • EJB的示例(希望那些和我一样曾经被跑一个EJB难住的朋友不再走弯道)
  • 时间和性能
  • NAT原理简介、各种 ADSL Modem 及路由器的端口映射方法
  • 计算机病毒的发展趋势及其防治
  • 双模式系统:移动通信发展新模式
  • 《魔兽世界》教你做人的11条哲理
  • Painter 实例教程-写实人物绘画(2)
  • 1999年9月全国计算机等级考试二级FoxBASE试卷(含答案)
  • 关于setuid的分析(6)
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 软讯网络 All Rigths Reserved.