0
我無法通過此過程創建rdlc報告,我使用的是報告查看器,但是當我選擇該過程時,它不顯示任何列名稱,但是我的過程返回7列。我如何創建報告請幫助?我在vb.net如何在SQL Server Express中通過動態查詢創建RDLC報告
ALTER PROCEDURE Pr_getAcceptedOnDateReport
@date date
AS
SET FMTONLY OFF
DECLARE @SQL varchar(MAX)
DECLARE @antiHIV bit
DECLARE @HBsAg bit
DECLARE @IGMHBCore bit
DECLARE @NAT bit
DECLARE @Malaria bit
DECLARE @TotalHBCore bit
DECLARE @Syphilis bit
DECLARE @HCV bit
DECLARE @ICT bit
DECLARE @DCT bit
DECLARE @Antibody bit
Select @antiHIV=[HIV1/2 screen Reactive],
@IGMHBCore=[IgM HBcore Reactive],
@HBsAg=[HBsAg Screen Reactive],
@NAT= [NAT Reactive],
@Malaria=[Malaria Screen Reactive],
@TotalHBCore=[Total HBcore Reactive],
@Syphilis=[Syphilis Screen Reactive],
@HCV=[HCV screen Reactive],
@ICT=[ICT Positive],
@DCT= [DCT Positive],
@Antibody= [Antibody Screen Positive]
from m_rejectionRules where deleted=0
DECLARE @sql1 nvarchar(4000)
Select @sql1='Select t.donorid, t.donorname, t.sampleid, t.customid,t.bagtype,t.bagnumber, t.segmentno from ttidetail t, m_donor m
where t.donorid=m.donorid
AND CONVERT(date, m.RDate) =''' + cast(@date as varchar(100)) + ''''
IF @antiHIV='True'
BEGIN
SELECT @sql1 = @sql1 + ' AND t.antiHIV like ' + ''''+ 'Non%Reactive'+''''
END
IF @HBsAg='True'
BEGIN
SELECT @sql1 = @sql1 + ' AND t.HBsAg like '+ ''''+ 'Non%Reactive'+''''
END
IF @IGMHBCore='True'
BEGIN
SELECT @sql1 = @sql1 + ' AND t.IGM_antiHBC like '+ ''''+ 'Non%Reactive'+''''
END
IF @NAT='True'
BEGIN
SELECT @sql1 = @sql1 + ' AND t.NAT_HIV1 like '+ ''''+ 'Non%Reactive'+''''
END
IF @Malaria='True'
BEGIN
SELECT @sql1 = @sql1 + ' AND t.malariaScreen like '+ ''''+ 'Non%Reactive'+''''
END
IF @TotalHBCore='True'
BEGIN
SELECT @sql1 = @sql1 + ' AND t.totalAnti_HBC like '+ ''''+ 'Non%Reactive'+''''
END
IF @Syphilis='True'
BEGIN
SELECT @sql1 = @sql1 + ' AND t.SyphilisScreen like '+ ''''+ 'Non%Reactive'+''''
END
EXEC sp_executesql @sql1