dataset - .rdlc report in c# does not display any output data? -
my friends im using visual studio 2008,and develop small project in c# , want add reports in ,(.rdlc reports) . here code
try { reportviewer1.reset(); con.open(); command.connection = con; command.commandtype = commandtype.storedprocedure; command.commandtext = "select_book_specific"; param = new sqlparameter("@isbn", "isbn1"); param.direction = parameterdirection.input; param.dbtype = dbtype.string; command.parameters.add(param); adapter = new sqldataadapter(command); adapter.fill(ds); // (int = 0; <= ds.tables[0].columns.count - 1; i++) // { // messagebox.show(ds.tables[0].rows[0][i].tostring()); //} testing purpose this.reportviewer1.localreport.reportpath = @"c:\documents , settings\administrator\my documents\visual studio 2008\projects\windowsformsapplication1\windowsformsapplication1\report1.rdlc"; this.reportviewer1.localreport.datasources.add(newreportdatasource("books",ds.tables[0].tablename.tostring())); this.reportviewer1.refreshreport(); } catch(exception ex){messagebox.show(ex.message);}
try with
try { reportviewer1.reset(); con.open(); command.connection = con; command.commandtype = commandtype.storedprocedure; command.commandtext = "select_book_specific"; param = new sqlparameter("@isbn", "isbn1"); param.direction = parameterdirection.input; param.dbtype = dbtype.string; command.parameters.add(param); adapter = new sqldataadapter(command); adapter.fill(ds); this.reportviewer1.localreport.reportpath = @"c:\documents , settings\administrator\my documents\visual studio 2008\projects\windowsformsapplication1\windowsformsapplication1\report1.rdlc"; this.reportviewer1.localreport.datasources.clear(); this.reportviewer1.localreport.datasources.add( new reportdatasource(ds.datasetname + "_" + ds.tablename, ds.tables[0])); this.reportviewer1.localreport.refresh(); }catch(exception ex) { messagebox.show(ex.message); }
Comments
Post a Comment