Single Report from different tables in crystal report

1.7k Views Asked by At

I'm doing an assignment.It's called rate analysis.I successfully coded the project on vb.net. Now i wanted to move on the reporting phase.

Now i have totally 8 tables in the db,and out of the 8 i wanted 5 tables for the report.

I got the project,work item,work_item_material,work_item_labor and work_item_equipment tables.enter image description here The other 3 that i don't want (for the report) are material,equipment and labor tables.

How do i do the reporting since i never did the report from multiple tables.I there a way to merge the tables,since i want to pull information for a certain project.enter image description here

1

There are 1 best solutions below

2
On

Create procedure and use it with dataset,then call that dataset into your report.

CREATE PROCEDURE GetMultipleTableData
AS
BEGIN

    SET NOCOUNT ON;
    SELECT     AccTrn.TrnKy, AccMas.AccKy, EmpMas.EmpKy, Address.AdrCd, ItmMas.ItmCd, AccTrn.TrnNo, EmpMas.EmpNo, ItmMas.fInAct, ItmMas.fApr
FROM         EmpMas INNER JOIN
                      Address INNER JOIN
                      AccTrn ON Address.AdrKy = AccTrn.AdrKy INNER JOIN
                      ItmMas ON AccTrn.TrnKy = ItmMas.ItmKy INNER JOIN
                      AccMas ON AccTrn.AccTrnKy = AccMas.AccKy ON EmpMas.EmpKy = Address.AdrKy
END
GO