首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >rdlc报告未显示报告

rdlc报告未显示报告
EN

Stack Overflow用户
提问于 2015-06-04 20:34:04
回答 1查看 301关注 0票数 0

我正在显示rdlc报告,但它给出了错误(未指定"RptAttendence.rdlc“报告的报告定义)。这是我的代码,我用它做了什么?提前谢谢。

代码语言:javascript
复制
private void RptAttendence_Load(object sender, EventArgs e)
        {
            try
            {
                OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\jani\Documents\saloo.accdb");
                OleDbCommand cmd = new OleDbCommand();
                cmd.CommandText = "SELECT Student.Name, Student.FName,Class.Name As Class, [Section].Name As [Section], Attendence.Attendence, Attendence.Dat As [Date] From " +
                    "(((Attendence Inner join Student on Attendence.StudentID =Student.ID) inner join Class on Attendence.ClassID= Class.ID) inner join [Section] ON Attendence.SectionID = [Section].ID)";
                OleDbDataAdapter adapter = new OleDbDataAdapter();
                DataTable table = new DataTable();
                cmd.Connection = con;
                con.Open();
                adapter.SelectCommand = cmd;
                adapter.Fill(table);

                reportViewer1.LocalReport.ReportEmbeddedResource = "Attendence.RptAttendence.rdlc";

                ReportDataSource source = new ReportDataSource("Dataset1", table);
                reportViewer1.LocalReport.DataSources.Clear();
                reportViewer1.LocalReport.DataSources.Add(source);
                reportViewer1.LocalReport.Refresh();
                this.reportViewer1.RefreshReport();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
EN

回答 1

Stack Overflow用户

发布于 2015-06-04 20:51:05

假设您使用的是Visual Studio -我认为您的问题可以通过在解决方案资源管理器中右键单击您的报告并进入属性来解决。

在属性中,将生成操作更改为Embedded Resource,然后再次运行项目

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30643992

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档