This is a migrated thread and some comments may be shown as answers.

Teleric ReportViewer

1 Answer 44 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
venkateswararao ch
Top achievements
Rank 1
venkateswararao ch asked on 25 Dec 2009, 01:41 PM
Hi to all,

I am new to Generate  TelericReports.  I want to display Report for Selected Item in Dropdownlist  programmatic ally.
My dropdownlist  items are 'ProductName, CategoryName,Manufacturer. When I select  Product(dropdownlist Item) it should display product related  report.  I created a store procedure like this .. 

if(@Filter='ProductName')
SELECT d.ProductID as 'Product ID',S.ProductName as 'Product Name',Count(d.ProductID) as Sold from S2Commerce_StoreOrders o
inner join S2Commerce_StoreOrderDetails d on d.OrderID=o. OrderID
--inner join S2Commerce_PayHist p on p.OrderID=o.OrderID
inner join S2Commerce_Products s on s.ProductID=d.ProductID  where  convert(varchar(10),OrderDate,101) >= @fromdate and  convert(varchar(10),OrderDate,101) <= @todate  group by d.ProductId,S.ProductName
else if(@Filter='CategoryName')                                    
SELECT S.CategoryID as 'Category ID' ,C.CategoryName as 'Category Name',Count(s.ProductID) as Sold  from S2Commerce_StoreOrders o
 inner join S2Commerce_StoreOrderDetails d on d.OrderID=o. OrderID
 --inner join S2Commerce_PayHist p on p.OrderID=o.OrderID
 inner join S2Commerce_ProductCategories s on s.ProductID=d.ProductID
 inner join S2Commerce_Category c on c.CategoryID=s.CategoryID where  convert(varchar(10),OrderDate,101) >= @fromdate and  convert(varchar(10),OrderDate,101) <= @todate group by  S.CategoryID,C.CategoryName
else if(@Filter='Manufacturer')  
SELECT  s.ManufacturerID as 'Manufacturer ID',m.ManufacturerName,count(s.ManufacturerID) as Sold from S2Commerce_StoreOrders o
 inner join S2Commerce_StoreOrderDetails d on d.OrderID=o. OrderID
 --inner join S2Commerce_PayHist p on p.OrderID=o.OrderID
 inner join S2Commerce_Products s on s.ProductID=d.ProductID
 inner join S2Commerce_Manufacturer m on m.ManufacturerID=s.ManufacturerID where   convert(varchar(10),OrderDate,101) >= @fromdate and  convert(varchar(10),OrderDate,101) <= @todate  group by s.ManufacturerID,m.ManufacturerName
else if(@Filter='Day') 
SELECT convert(varchar(10),OrderDate,101) as 'Day',count(o.OrderID) as #Orders,sum(d.UnitCost * d.Quantity) as TotalAmount,sum(ShippingTotal)  as TotalShipping,sum(DiscountAmount) as DiscountAmount,sum(TaxAmount) as TotalTax from S2Commerce_StoreOrders o
 inner join S2Commerce_StoreOrderDetails d on d.OrderID=o. OrderID
 --inner join S2Commerce_PayHist p on p.OrderID=o.OrderID
 inner join S2Commerce_Products s on s.ProductID=d.ProductID where   convert(varchar(10),OrderDate,101) >= @fromdate and  convert(varchar(10),OrderDate,101) <= @todate  group by convert(varchar(10),OrderDate,101)
else if(@Filter='Month') 
SELECT DateAdd(Month, DateDiff(Month, 0, OrderDate), 0)  as 'Month',count(o.OrderID) as #Orders,sum(d.UnitCost * d.Quantity) as TotalAmount,sum(ShippingTotal)  as TotalShipping,sum(DiscountAmount) as DiscountAmount,sum(TaxAmount) as TotalTax from S2Commerce_StoreOrders o
 inner join S2Commerce_StoreOrderDetails d on d.OrderID=o. OrderID
 --inner join S2Commerce_PayHist p on p.OrderID=o.OrderID
 inner join S2Commerce_Products s on s.ProductID=d.ProductID where   convert(varchar(10),OrderDate,101) >= @fromdate and  convert(varchar(10),OrderDate,101) <= @todate  group by  DateAdd(Month, DateDiff(Month, 0, OrderDate), 0) 

Regards,
Venkateswararao


1 Answer, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 29 Dec 2009, 08:30 PM
From what I understand I think the best thing to do would be to design your Report and use Report Parameters. For more information you can read through the following links and demos to see if they fit what you're looking for:


Don't forget that with your Reporting installation there should be a .sln file for all of the demos so you have something to actually play around with when you find a demo that fits your description.
Tags
General Discussions
Asked by
venkateswararao ch
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
Share this question
or