c# - rdlc report not showing the report -
i showing rdlc report gives me error (the report definition "rptattendence.rdlc" report not specified). here code doing wron it? in advance.
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 class, [section].name [section], attendence.attendence, attendence.dat [date] " + "(((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); } }
assuming using visual studio - think problem solved right clicking report in solution explorer , going properties.
in properties change build action embedded resource
, run project again
Comments
Post a Comment