We're going to need to see the details. Please provide the query you're getting the data with, a sample of the data being returned and the designer code you're using to render the data.
Data from integer column not displayed in SSRS report but data from string columns displayed.
Hello All,
I Have a SSRS report that pulls data from and embedded query in a dataset. The query receives a date parameter and runs okay in SSMS.
The query refreshes okay in and generates the fields. However when I click preview report it displays all columns with string datatype but not field with integer datatype.
My query script in the dataset contains a temp table and the integer column comes from the temp table in the dataset. I have deleted the rdl data files but no change.
Please advice.
SQL Server Reporting Services
4 answers
Sort by: Most helpful
-
Michael Taylor 86 Reputation points
2024-07-10T15:32:59.0866667+00:00 -
Olutimi 5 Reputation points
2024-07-10T15:47:51.58+00:00 Hello Michael,
Please find below the code.
IF (1=0)
BEGIN
SELECT 'Procedurename' as [ProcedureName], 'RowCNT' as [RowCnt], 'MissingProc' as [MissingProc], 'MissingTbl' as [MissingTbl]
END
IF OBJECT_ID('tempdb..#tblchk') IS NOT NULL DROP TABLE #tblchk SELECT DISTINCT s.procedurename, s.RowCNT
INTO #tblchk FROM GlossMetadata.LoadSPStatus s JOIN (SELECT DISTINCT ProcedureName, min(s.CreateDT) maxCreateDT, MAX(s.BusinessDate) maxBusinessdate /*INTO #TblChk */ FROM GlossMetadata.LoadSPStatus s WHERE (ProcedureName IN (SELECT DISTINCT SPECIFIC_CATALOG + '.' + SPECIFIC_SCHEMA + '.' + SPECIFIC_NAME FROM cmdw.information_schema.routines WHERE routine_type = 'PROCEDURE' AND SPECIFIC_SCHEMA = 'Transform' AND SPECIFIC_NAME LIKE '%Loadgloss%') OR s.ProcedureName = 'SpLoadGlossFactTrade') AND BusinessDate = @COB GROUP BY s.ProcedureName) ss ON s.ProcedureName = s.ProcedureName AND s.CreateDT = ss.maxCreateDT AND s.BusinessDate = ss.maxBusinessdate UPDATE #tblchk SET RowCNT = (SELECT COUNT(*) FROM cmdw.gloss.DimTrade WHERE DWInsertDT >= @COB) WHERE ProcedureName = 'CMDW.Transform.SpLoadGlossDimTrade' UPDATE #tblchk SET ProcedureName = 'CMDW.Transform.SpLoadGlossFactTrade' WHERE ProcedureName = 'SpLoadGlossFactTrade' BEGIN WITH cte AS (SELECT DISTINCT SPECIFIC_CATALOG + '.' + SPECIFIC_SCHEMA + '.' + SPECIFIC_NAME AS procedurename FROM cmdw.information_schema.routines WHERE routine_type = 'PROCEDURE' AND SPECIFIC_SCHEMA = 'Transform' AND SPECIFIC_NAME LIKE '%Loadgloss%') SELECT CASE WHEN (c.ProcedureName IS NOT NULL AND t .ProcedureName IS NULL) /*OR (t.ProcedureName IS NOT null AND t.RowCNT=0)*/ THEN REPLACE(c.procedurename, 'CMDW.Transform.SpLoadGloss', '') + ' is not loaded' ELSE '' END MissingProc, REPLACE(c.procedurename, 'CMDW.Transform.SpLoadGloss', '') MissingTbl, t .RowCNT, c.ProcedureName FROM cte c LEFT JOIN #TblChk t ON t .ProcedureName = c.ProcedureName WHERE c.procedurename NOT IN ('CMDW.Transform.SpLoadGlossTrade', 'CMDW.Transform.SpLoadGlossTradeExternalRef', 'CMDW.Transform.SpLoadGlossPrsimClientStartDate', 'CMDW.Transform.SpLoadGlossPartyApprovedDepartment',
-
Olutimi 5 Reputation points
2024-07-10T15:49:43.5133333+00:00
Sign in to comment -
-
ZoeHui-MSFT 37,671 Reputation points
2024-07-11T02:31:08.0133333+00:00 Hi @Olutimi,
It seems there is something wrong with the code you comment, please have a double check, i can only see the code as below.
IF (1=0) BEGIN SELECT 'Procedurename' as [ProcedureName], 'RowCNT' as [RowCnt], 'MissingProc' as [MissingProc], 'MissingTbl' as [MissingTbl] END IF OBJECT_ID('tempdb..#tblchk') IS NOT NULL DROP TABLE #tblchk SELECT DISTINCT s.procedurename, s.RowCNT
-
Olutimi 5 Reputation points
2024-07-11T07:17:33.0133333+00:00 Please look to the right.
-
Olutimi 5 Reputation points
2024-07-11T07:17:48.5233333+00:00 SELECT 'Procedurename' as [ProcedureName], 'RowCNT' as [RowCnt], 'MissingProc' as [MissingProc], 'MissingTbl' as [MissingTbl]
END
IF OBJECT_ID('tempdb..#tblchk') IS NOT NULL DROP TABLE #tblchk SELECT DISTINCT s.procedurename, s.RowCNT
Copy
INTO #tblchk FROM GlossMetadata.LoadSPStatus s JOIN (SELECT DISTINCT ProcedureName, min(s.CreateDT) maxCreateDT, MAX(s.BusinessDate) maxBusinessdate /*INTO #TblChk */ FROM GlossMetadata.LoadSPStatus s WHERE (ProcedureName IN (SELECT DISTINCT SPECIFIC_CATALOG + '.' + SPECIFIC_SCHEMA + '.' + SPECIFIC_NAME FROM cmdw.information_schema.routines WHERE routine_type = 'PROCEDURE' AND SPECIFIC_SCHEMA = 'Transform' AND SPECIFIC_NAME LIKE '%Loadgloss%') OR s.ProcedureName = 'SpLoadGlossFactTrade') AND BusinessDate = @COB GROUP BY s.ProcedureName) ss ON s.ProcedureName = s.ProcedureName AND s.CreateDT = ss.maxCreateDT AND s.BusinessDate = ss.maxBusinessdate UPDATE #tblchk SET RowCNT = (SELECT COUNT(*) FROM cmdw.gloss.DimTrade WHERE DWInsertDT >= @COB) WHERE ProcedureName = 'CMDW.Transform.SpLoadGlossDimTrade' UPDATE #tblchk SET ProcedureName = 'CMDW.Transform.SpLoadGlossFactTrade' WHERE ProcedureName = 'SpLoadGlossFactTrade' BEGIN WITH cte AS (SELECT DISTINCT SPECIFIC_CATALOG + '.' + SPECIFIC_SCHEMA + '.' + SPECIFIC_NAME AS procedurename FROM cmdw.information_schema.routines WHERE routine_type = 'PROCEDURE' AND SPECIFIC_SCHEMA = 'Transform' AND SPECIFIC_NAME LIKE '%Loadgloss%') SELECT CASE WHEN (c.ProcedureName IS NOT NULL AND t .ProcedureName IS NULL) /*OR (t.ProcedureName IS NOT null AND t.RowCNT=0)*/ THEN REPLACE(c.procedurename, 'CMDW.Transform.SpLoadGloss', '') + ' is not loaded' ELSE '' END MissingProc, REPLACE(c.procedurename, 'CMDW.Transform.SpLoadGloss', '') MissingTbl, t .RowCNT, c.ProcedureName FROM cte c LEFT JOIN #TblChk t ON t .ProcedureName = c.ProcedureName WHERE c.procedurename NOT IN ('CMDW.Transform.SpLoadGlossTrade', 'CMDW.Transform.SpLoadGlossTradeExternalRef', 'CMDW.Transform.SpLoadGlossPrsimClientStartDate', 'CMDW.Transform.SpLoadGlossPartyApprovedDepartment',
-
Olutimi 5 Reputation points
2024-07-11T07:23:40.2233333+00:00 BEGIN
SELECT
'Procedurename' as [ProcedureName],
'RowCNT' as [RowCnt],
'MissingProc' as [MissingProc],
'MissingTbl' as [MissingTbl]
END
IF OBJECT_ID('tempdb..#tblchk') IS NOT NULL DROP TABLE #tblchk
SELECT DISTINCT s.procedurename,s.RowCNT INTO #tblchk FROM GlossMetadata.LoadSPStatus s JOIN(
SELECT distinct ProcedureName,min(s.CreateDT)maxCreateDT, MAX(s.BusinessDate)maxBusinessdate --INTO #TblChk
FROM GlossMetadata.LoadSPStatus s WHERE (ProcedureName IN
(
SELECT DISTINCT SPECIFIC_CATALOG+'.'+SPECIFIC_SCHEMA+'.'+SPECIFIC_NAME
from cmdw.information_schema.routines
where routine_type = 'PROCEDURE'
AND SPECIFIC_SCHEMA='Transform'
AND SPECIFIC_NAME LIKE '%Loadgloss%'
)OR s.ProcedureName='SpLoadGlossFactTrade' )
AND BusinessDate=@COB GROUP BY s.ProcedureName) ss ON
s.ProcedureName=s.ProcedureName AND s.CreateDT=ss.maxCreateDT AND s.BusinessDate=ss.maxBusinessdate
UPDATE #tblchk SET RowCNT=
(SELECT COUNT(*) FROM cmdw.gloss.DimTrade WHERE DWInsertDT>=@COB)
WHERE ProcedureName='CMDW.Transform.SpLoadGlossDimTrade'
UPDATE #tblchk SET ProcedureName='CMDW.Transform.SpLoadGlossFactTrade'
WHERE ProcedureName='SpLoadGlossFactTrade'
BEGIN
WITH cte as(
SELECT DISTINCT SPECIFIC_CATALOG+'.'+SPECIFIC_SCHEMA+'.'+SPECIFIC_NAME AS procedurename
from cmdw.information_schema.routines
where routine_type = 'PROCEDURE'
AND SPECIFIC_SCHEMA='Transform'
AND SPECIFIC_NAME LIKE '%Loadgloss%'
)
SELECT
CASE WHEN (c.ProcedureName IS NOT null AND t.ProcedureName IS null) --OR (t.ProcedureName IS NOT null AND t.RowCNT=0)
THEN REPLACE(c.procedurename,'CMDW.Transform.SpLoadGloss','')+' is not loaded' ELSE '' end
MissingProc, REPLACE(c.procedurename,'CMDW.Transform.SpLoadGloss','')MissingTbl,t.RowCNT , c.ProcedureName
FROM cte c LEFT JOIN #TblChk t ON t.ProcedureName=c.ProcedureName
WHERE c.procedurename NOT IN
(
'CMDW.Transform.SpLoadGlossTrade',
'CMDW.Transform.SpLoadGlossTradeExternalRef',
'CMDW.Transform.SpLoadGlossPrsimClientStartDate',
'CMDW.Transform.SpLoadGlossPartyApprovedDepartment',
'CMDW.Transform.SpLoadGlossTradePartyRef'
)
END
-
ZoeHui-MSFT 37,671 Reputation points
2024-07-11T07:39:40.93+00:00 Hi @Olutimi,
Could you please copy the code and paste it into a text file and then upload to Q&A?
If possible, please also post CREATE TABLE statements for your tables together with INSERT statements with sample data.
-
Olutimi 5 Reputation points
2024-07-11T08:20:27.7066667+00:00 Script attached.
Sign in to comment -
-
Olutimi 5 Reputation points
2024-07-11T08:21:47.26+00:00 Script attached.
-
Olutimi 5 Reputation points
2024-07-11T10:15:29.64+00:00 IF (1=0)
BEGIN
SELECT 'Procedurename' as [ProcedureName], 'RowCNT' as [RowCnt], 'MissingProc' as [MissingProc], 'MissingTbl' as [MissingTbl]
END
IF OBJECT_ID('tempdb..#tblchk') IS NOT NULL DROP TABLE #tblchk
SELECT DISTINCT s.procedurename, s.RowCNT
INTO #tblchk FROM GlossMetadata.LoadSPStatus s JOIN (SELECT DISTINCT ProcedureName, min(s.CreateDT) maxCreateDT, MAX(s.BusinessDate) maxBusinessdate FROM GlossMetadata.LoadSPStatus s WHERE (ProcedureName IN (SELECT DISTINCT SPECIFIC_CATALOG + '.' + SPECIFIC_SCHEMA + '.' + SPECIFIC_NAME FROM cmdw.information_schema.routines WHERE routine_type = 'PROCEDURE' AND SPECIFIC_SCHEMA = 'Transform' AND SPECIFIC_NAME LIKE '%Loadgloss%') OR s.ProcedureName = 'SpLoadGlossFactTrade') AND BusinessDate = @COB GROUP BY s.ProcedureName) ss ON s.ProcedureName = s.ProcedureName AND s.CreateDT = ss.maxCreateDT AND s.BusinessDate = ss.maxBusinessdate
UPDATE #tblchk
SET RowCNT = (SELECT COUNT(*) FROM cmdw.gloss.DimTrade WHERE DWInsertDT >= @COB)
WHERE ProcedureName = 'CMDW.Transform.SpLoadGlossDimTrade'
UPDATE #tblchk
SET ProcedureName = 'CMDW.Transform.SpLoadGlossFactTrade'
WHERE ProcedureName = 'SpLoadGlossFactTrade'
BEGIN
WITH cte AS
(SELECT DISTINCT SPECIFIC_CATALOG + '.' + SPECIFIC_SCHEMA + '.' + SPECIFIC_NAME AS procedurename FROM cmdw.information_schema.routines WHERE routine_type = 'PROCEDURE' AND SPECIFIC_SCHEMA = 'Transform' AND SPECIFIC_NAME LIKE '%Loadgloss%')
SELECT CASE WHEN (c.ProcedureName IS NOT NULL AND t .ProcedureName IS NULL)
THEN REPLACE(c.procedurename,'CMDW.Transform.SpLoadGloss', '') + ' is not loaded' ELSE '' END MissingProc, REPLACE(c.procedurename,'CMDW.Transform.SpLoadGloss', '') MissingTbl, t .RowCNT, c.ProcedureName FROM cte c LEFT JOIN #TblChk t ON t .ProcedureName = c.ProcedureName WHERE c.procedurename NOT IN ('CMDW.Transform.SpLoadGlossTrade', 'CMDW.Transform.SpLoadGlossTradeExternalRef', 'CMDW.Transform.SpLoadGlossPrsimClientStartDate', 'CMDW.Transform.SpLoadGlossPartyApprovedDepartment', 'CMDW.Transform.SpLoadGlossTradePartyRef')
END
Sign in to comment -
-
Olutimi 5 Reputation points
2024-07-11T12:53:44.1633333+00:00 Script attached.