.net microsoftreportview 怎么解决 “尚未为数据源**提供数据实例”的问题呀 谁能告诉我呀 谢谢

2024-12-15 13:40:40
推荐回答(1个)
回答1:

加上
eportViewer newViewer = new ReportViewer();
newViewer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
newViewer.Location = new System.Drawing.Point(0, 0);
int height = this.Size.Height - 40;
int width = this.Size.Width - 300;
newViewer.Size = new System.Drawing.Size(width, height);

if (coll == null)
{

coll = (ControlCollection)rv_销量统计.Parent.Controls;
oldIndex = coll.IndexOf(rv_销量统计);
coll.Add(newViewer);
coll.SetChildIndex(newViewer, oldIndex);
coll.Remove(rv_销量统计);
}
else
{
coll.Add(newViewer);
coll.SetChildIndex(newViewer, oldIndex);

}