Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

Subreport Duplicated Multiple Times

$
0
0
I have a report that querys 5 data tables with unions and performs counts for each listkey. I runs fine in the Report designer "Execute Query". But when I run it in the report viewer if it has 23 rows it returns the report 23 times. Not sure from the above post how the repair?  Please
SELECT
    IPTReferralFromDropDown.ListValue,
        1 ASorderKey,
    COUNT(IPTAllStatsMain.ReferralFromKey) ASReferralFrom   
FROM
    IPTReferralFromDropDown
    INNERJOINIPTAllStatsMain
ON(IPTAllStatsMain.ReferralFromKey = IPTReferralFromDropDown.ListKey)
AND
    year(IPTAllStatsMain.CreatedOn) = year(getdate())
    --IPTAllStatsMain.CreatedOn BETWEEN @startDate AND @endDate   
GROUPBY
IPTReferralFromDropDown.ListValue
 
UNION
 
--Caller Relation
SELECT
    IPTCallerRelationDropDown.ListValue,
        2 ASorderKey,
    COUNT(IPTAllStatsMain.CallerRelationKey) ASCallerRelation   
FROM
    IPTCallerRelationDropDown
    INNERJOINIPTAllStatsMain
ON(IPTAllStatsMain.CallerRelationKey = IPTCallerRelationDropDown.ListKey)
AND
    year(IPTAllStatsMain.CreatedOn) = year(getdate())
    --IPTAllStatsMain.CreatedOn BETWEEN @startDate AND @endDate   
GROUPBY
    IPTCallerRelationDropDown.ListValue
 
UNION
 
--Marital Status
SELECT
    IPTMaritalStatusDropDown.ListValue,
        3 ASorderKey,
    COUNT(IPTAllStatsMain.MaritalStatusKey) ASMaritalStatus   
FROM
    IPTMaritalStatusDropDown
    INNERJOINIPTAllStatsMain
ON(IPTAllStatsMain.MaritalStatusKey = IPTMaritalStatusDropDown.ListKey)
AND
    year(IPTAllStatsMain.CreatedOn) = year(getdate())
    --IPTAllStatsMain.CreatedOn BETWEEN @startDate  AND @endDate   
GROUPBY
    IPTMaritalStatusDropDown.ListValue
 
UNION
 
--Ethnicity
SELECT
    IPTEthnicityDropDown.ListValue,
        4 ASorderKey,
    COUNT(IPTAllStatsMain.EthnicityKey) ASEthnicity   
FROM
    IPTEthnicityDropDown
    INNERJOINIPTAllStatsMain
ON(IPTAllStatsMain.EthnicityKey = IPTEthnicityDropDown.ListKey)
AND
    year(IPTAllStatsMain.CreatedOn) = year(getdate())
    --IPTAllStatsMain.CreatedOn BETWEEN @startDate  AND @endDate   
GROUPBY
    IPTEthnicityDropDown.ListValue
 
UNION
 
--Annual Income
SELECT
    IPTAnnualIncomeDropDown.ListValue,
        5 ASorderKey,
    COUNT(IPTAllStatsMain.AnnualIncomeKey) ASAnnualIncome   
FROM
    IPTAnnualIncomeDropDown
    INNERJOINIPTAllStatsMain
ON(IPTAllStatsMain.AnnualIncomeKey = IPTAnnualIncomeDropDown.ListKey)
AND
    year(IPTAllStatsMain.CreatedOn) = year(getdate())
    --IPTAllStatsMain.CreatedOn BETWEEN @startDate  AND @endDate   
GROUPBY
    IPTAnnualIncomeDropDown.ListValue
ORDERBY
    orderKey

Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>