Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I work on N-Tier application that consists of Dal project and UI project , i have a crystal report in UI project, i want to bind a class in Dal project to the crystal report in the UI project, i do not know how

thanks
Posted
Updated 10-Dec-13 7:30am
v2
Comments
bowlturner 10-Dec-13 13:42pm    
That seems backwards to me. Or do you mean you want the Crystal report to bind (get it's data) from the DAL class?
fgeaiessah 10-Dec-13 14:30pm    
I mean the crystal report gets its data from a class in the Dal project which i created by drag and drop a table from the server explorer on the datacontext.dbml, in other words
i have a table tbl1 on server explorer , i created a linq to sql item data1.dbml in the Dal project, i drage tbl1 to data1.dbml to create a class for tbl1 , i want the Crystal report to get its data from the class tbl1, the problem is that the crystal report on UI project and the class tbl1 is on Dal project, thanks

1 solution

As long as the DAL has a reference in the UI (I am assuming it does) I would think the code should be something like this

C#
DAL dal = new DAL();
crystalReportViewer1.ReportSource = dal.tbl1;
crystalReportViewer1.RefreshReport();


You'll have to make sure the tbl1 is filled correctly and the report expects the data coming in.
 
Share this answer
 
Comments
fgeaiessah 11-Dec-13 1:19am    
Good answer but i still need to prepare the design of the report, i have to connect the report to dal.tbl1 using wizard to drag fields of tbl1 from Datasources window, then i design the report, then i use code
i mean if i start connecting the report using code how to design the report
i have tried connect the report to the base tbl1 using database expert and choose OLEDB then sql server provider then the database then tbl1, i prepared the design of the report using tbl1 fields, but when i used code to connect the report to a linq query for the class tbl1 , in running the report i get an expection says " DataSets doesnot support system Nullable ", i thought that error is caused by the way i connect the report to the table tbl1 by wizared and after i connect the report to a query of the class tbl1 by code
thank you very much.
bowlturner 11-Dec-13 13:12pm    
Sorry the question wasn't clear. But the error message suggests you didn't set up the dataset correctly.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900