Last post Mar 16, 2012 07:10 AM by Philip1914
Mar 16, 2012 04:39 AM|Philip1914|LINK
Iam using VS2008
i have developed a software in that i have to print a billing report
i have designed the report
the problem is, in that report i have to use two different tables
one table is Sales entity(Grand Total) and other is SalesItem entity(Item name) i have a primary key Invoice_no used as foreign key in SalesItem
I have writen a query
select Sales.Grand_Total,SalesItem.Item_name from Sales,SalesItem where Sales.Invoice_no=SalesItem.Invoice_no where Invoice_no=100;
the problem is when i run the report on button click only one table date is displaying and not other.
i run the query in MSAcess no error works perfectly i need a solution for it.
One thing i saw is in crysatl report while using database expert if i import sales table first and then salesitem table then on running project sales table
data is shown and not other and vice vers
Mar 16, 2012 04:42 AM|Sandeep Shenoy|LINK
select s.Grand_Total,si.Item_name from Sales s JOIN SalesItem si ON(Sales.Invoice_no=SalesItem.Invoice_no) where s.Invoice_no=100;
Mar 16, 2012 05:06 AM|amit.jain|LINK
crystal reports in asp.net
Mar 16, 2012 05:47 AM|Philip1914|LINK
i tried ur query but it give an error
"Synatx error in FROM clause"
Mar 16, 2012 06:01 AM|Sandeep Shenoy|LINK
hi please try this..
select s.Grand_Total,si.Item_name from Sales as s JOIN SalesItem as si
Mar 16, 2012 06:20 AM|Philip1914|LINK
its showing the same error
i removed the aliases and tried but same error
i tried using inner join,left and right join but it says "join expression not supported"
Mar 16, 2012 06:23 AM|Sandeep Shenoy|LINK
are you sure about the columns and the primary key connections ?
change the fields name according to the need, the code is for joining two tables with a common field in both table,and to check a condition.
Mar 16, 2012 06:23 AM|Philip1914|LINK
i refered crystal report in asp.net
that showed me how to use 2 tables in crytal report but not how to display data from 2 tables
we need to write query
Mar 16, 2012 06:33 AM|Philip1914|LINK
i checked its fine
invoiceno is primary key in sales and foreign key in salesitem
Mar 16, 2012 06:40 AM|Sandeep Shenoy|LINK
Please check this code too.
select s.Grand_Total,si.Item_name from Sales as s,SalesItem as si
where s.Invoice_no=si.Invoice_no AND s.Invoice_no=100;
Mar 16, 2012 07:10 AM|Philip1914|LINK
query is working fine but my problem is not solved
on running crystal report it displays only Grand total and not itemname
in crystal report while importing table using database expert i imported first sales and then salesitem so it displayes only sales data vice vera