Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Ragabash
Starting Member
6 Posts |
Posted - 2008-01-29 : 03:41:32
|
I made a new crystal report that get data form the database but when I check in the report to the online server I get a ADO.NET connection error Can anyone explain it? |
|
anuksundar
Starting Member
4 Posts |
Posted - 2008-02-21 : 08:02:39
|
this is the way to prepare a Sample reportFor the given database in sql server say (book details) following are the fieldsBook details ->bookdetBook code ->bcode->intBook Name->bname->varchar(30)Book price -> bprice -> numeric(10,2)A report is prepared for the above detailsII design a formAdd a new item ->report_book.csInside the form add a crystal report viewer from tool boxIII write the following code in report_book.csUsing system.data;Using system.data.sqlclient;Namespace publisher{ Public class report_author{ //instantiate the below Conne…… conCommandbuilder…. cmdData adapter….drData table…..mtablePrivate bookreport cr = new bookreport(); // instantiate the name of the rpt fileStatic void main(){ Application.run(new report_book());}}}iV write the following code in load()private void report_book _load(){ Con.connectionstring = ….. Con.open(); Dr = …. Com = …. Dr.fill(mtable); Cr.setdatasource(mtable);Crbook . reportsource = cr; // crbook-> the name given to crystal report viewer}}}V create a standart report(*.rpt)1. go to solution explorer2. go to add new item3. select crystal report & name as (bookreport.rpt)4. select open5. press register later6. select standard7. select ok8. a standard report expert will be displayed9. go to ADO & press(+)10. select provider for sql11. select next12. select database 13. select finish14. in ado the table will be added with fields15. select bookdet16. select insert table 17. add the necessary fields18. press finish19. run the program20. & u can change the color, formula, give column headings, page header, page footer etcanuradhak |
|
|
|
|
|