rdlc砖取出现尚未为数据源“ModelProCity_ModelProvCity”提供数据源实例。

zhoulihong_1986 2009-12-14 04:40:03
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using BLL;
using Microsoft.Reporting.WebForms;
namespace Web
{
public partial class ModelProvinceResult : System.Web.UI.Page
{
public DataSet dDs = new DataSet();
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack == false)
{
ModelProvince();
this.lbl_datetime.Text = "从" + Request["sStarttime"].ToString() + "到" + Request["sEndtime"].ToString();
}
}

public DataSet ModelProDataSet()
{
string sStarttime = Request["sStarttime"].ToString();
string sEndtime = Request["sEndtime"].ToString();
string sProvince = Request["sProvince"].ToString();
string sModeName = Request["sModeName"].ToString();
B_Sms bSms = new B_Sms();

dDs = bSms.ModelProvince(sStarttime, sEndtime, sProvince, sModeName);
return dDs;
}
/// <summary>
/// 按时间机型省份查询出来的结果
/// </summary>
public void ModelProvince()
{
ModelProDataSet();
if (dDs.Tables[0].Rows.Count != 0)
{
this.ReportViewer1.LocalReport.ReportPath = "ReportOperator/ModelProvince.rdlc";
this.ReportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("modpromyds",
this.dDs.Tables[0]));
this.ReportViewer1.DataBind();
this.lbl_dataMess.Text = "";
}
else
{
this.ReportViewer1.Visible = false;
this.lbl_dataMess.Text = "没有记录!";
}
}

protected void btn_TotalImage_Click(object sender, EventArgs e)
{
///统计图形
this.btn_TotalImage.Visible = true;

this.btn_PrintReport.Visible = true;
this.btn_cancle.Visible = true;
this.btn_windowclose.Visible = true;
this.DrpDown_Image.Visible = true;
this.ReportViewer1.Reset();
ModelProDataSet();
this.ReportViewer1.LocalReport.ReportPath = "ReportOperator/ModProColumn.rdlc";
this.ReportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("myds",
this.dDs.Tables[0]));
this.ReportViewer1.DataBind();

}

protected void btn_cancle_Click(object sender, EventArgs e)
{
///取消
Response.Redirect("ModelProvince.aspx");

}

protected void DrpDown_Image_SelectedIndexChanged(object sender, EventArgs e)
{
///下拉列表变化图表变化
ModelProDataSet();
this.ReportViewer1.Reset();
string stype = this.DrpDown_Image.SelectedItem.Text;
if (stype.Equals("柱状累积图"))
{
this.ReportViewer1.LocalReport.ReportPath = "ReportOperator/ModProColumn.rdlc";
}
else if (stype.Equals("柱状比较图"))
{
this.ReportViewer1.LocalReport.ReportPath = "ReportOperator/ModProColCompare.rdlc";
}
else if (stype.Equals("折线图"))
{
this.ReportViewer1.LocalReport.ReportPath = "ReportOperator/ModProLine.rdlc";
}
else if (stype.Equals("曲线图"))
{
this.ReportViewer1.LocalReport.ReportPath = "ReportOperator/ModProCurve.rdlc";
}
else if (stype.Equals("面积图"))
{
this.ReportViewer1.LocalReport.ReportPath = "ReportOperator/ModProArea.rdlc";
}
else if (stype.Equals("面积比例图"))
{
this.ReportViewer1.LocalReport.ReportPath = "ReportOperator/ModProArearat.rdlc";
}

this.ReportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("myds",
this.dDs.Tables[0]));
this.ReportViewer1.DataBind();
}

protected void btn_PrintReport_Click1(object sender, EventArgs e)
{
///打印报表
this.DrpDown_Image.Visible = false;
this.btn_cancle.Visible = false;
this.btn_PrintReport.Visible = false;
this.btn_TotalImage.Visible = false;
this.btn_windowclose.Visible = true;

this.ReportViewer1.Reset();
ModelProvince();
}

protected void btn_windowclose_Click(object sender, EventArgs e)
{
///关闭窗口
this.btn_windowclose.Visible = false;
this.btn_cancle.Visible = true;
this.btn_PrintReport.Visible = true;
this.btn_TotalImage.Visible = true;
this.DrpDown_Image.Visible = true;
this.DrpDown_Image.Visible = false;
this.ReportViewer1.Reset();
ModelProvince();
}

protected void ReportViewer1_Drillthrough(object sender, DrillthroughEventArgs e)
{

LocalReport lp = (LocalReport)e.Report;
string province = lp.GetParameters()["prov"].Values[0].Trim();
string types = lp.GetParameters()["types"].Values[0].Trim();

if (types == "省份")
{
lp.DataSources.Clear();
this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ModelProCity_ModelProvCity", ModelProvCityDataTable(province)));

}
else
{

lp.DataSources.Clear();
this.ReportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("ModelProvRound_ModelProvRound", ModelProvRoundDataTable(province)));

}


}
public DataTable ModelProvRoundDataTable(string Province)
{
B_Sms bSms = new B_Sms();
return bSms.ModeProvinceRound(Province).Tables[0];
}
public DataTable ModelProvCityDataTable(string Province)
{

B_Sms bSms = new B_Sms();
return bSms.ModeProvinceCity(Province).Tables[0];
}



}
}



其中报错
protected void ReportViewer1_Drillthrough(object sender, DrillthroughEventArgs e)
{

LocalReport lp = (LocalReport)e.Report;
string province = lp.GetParameters()["prov"].Values[0].Trim();
string types = lp.GetParameters()["types"].Values[0].Trim();

if (types == "省份")
{
lp.DataSources.Clear();
this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ModelProCity_ModelProvCity", ModelProvCityDataTable(province)));

}
else
{

lp.DataSources.Clear();
this.ReportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("ModelProvRound_ModelProvRound", ModelProvRoundDataTable(province)));

}这里保存报“尚未为数据源“ModelProCity_ModelProvCity”提供数据源实例。”
...全文
751 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq4004229 2011-02-21
  • 打赏
  • 举报
回复
楼主是个不厚道的人
jervisbubu 2010-08-24
  • 打赏
  • 举报
回复
解决了不说怎么解决的
zhoulihong_1986 2009-12-16
  • 打赏
  • 举报
回复
问题解决了
「已注销」 2009-12-16
  • 打赏
  • 举报
回复
解决了,记得结贴啊
wuyq11 2009-12-15
  • 打赏
  • 举报
回复
名称和rdlc报表设计时的名称不一样造成
「已注销」 2009-12-15
  • 打赏
  • 举报
回复
你的前台注册这个钻取事件没有
lyboyc 2009-12-15
  • 打赏
  • 举报
回复
ModelProvince() 方法里要给ModelProCity_ModelProvCity绑顶数据源。
用了几个数据源,后台就要绑几个,不管是在ModelProvince()方法里还是钻取事件ReportViewer1_Drillthrough里
内容概要:本文档围绕基于MATLAB/Simulink平台的直流无刷电机速度控制系统展开,重点介绍利用Simulink搭建电机控制模型,实现直流无刷电机的速度开环控制仿真。文档详细阐述了系统建模、关键模块设计与参数配置过程,帮助读者深入理解电机控制的基本原理与仿真流程。同时,文档还列举了涵盖电力电子、新能源系统、路径规划、智能优化算法等多个领域的丰富仿真案例,充分展示了MATLAB/Simulink在多学科交叉科研仿真中的强大功能与广泛应用前景。; 适合人群:具备一定自动控制理论基础和MATLAB/Simulink使用经验的高校学生、科研人员及工程技术人员,特别适用于从事电机控制、电力电子、新能源系统、智能优化等方向的研究者。; 使用场景及目标:①学习直流无刷电机的工作原理及其速度开环控制方法;②掌握使用Simulink进行电机控制系统建模与仿真的核心技能;③为后续开展更高级的闭环控制、矢量控制或结合智能优化算法的电机控制研究奠定坚实的技术基础并提供实用的参考实例。; 阅读建议:建议读者结合文档提供的仿真模型与代码资源,亲自动手实践Simulink建模全过程,逐步理解各功能模块的作用与参数整定方法,并充分利用网盘中的配套资料进行复现与深入学习,从而有效提升科研仿真与工程实践能力。

4,818

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 图表区
社区管理员
  • 图表区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧