Quantcast
Channel: Crystal Reports
Viewing all articles
Browse latest Browse all 1507

Passing Stored Procedure parameter to crystal reports 12, Report showing empty

$
0
0

Hi... am using cyrstal 12, now am developing ASP + SQL with VB based reports,

This is my Stored Procedure,

ALTER PROCEDURE [dbo].[MIS_R_Master_CrTab_Pillar_Locations]
			(
			 @i_ReportAttributesId  AS INT
			,@i_PillarId  AS INT
			,@i_RegionId  AS INT
			,@i_BranchId  AS INT
			,@i_ProjectId  AS INT
			,@i_ClusterId  AS INT
			,@i_VillageWardId  AS INT
			,@i_ReportingPeriod  AS date
			)
         AS
			BEGIN ..................
......................................................................
......................................................................


This is my ASPx (code behind) 

  Private Sub SetSource()
        Dim cryRpt As New ReportDocument
        Dim crtableLogoninfos As New TableLogOnInfos
        Dim crtableLogoninfo As New TableLogOnInfo
        Dim crConnectionInfo As New ConnectionInfo
        Dim CrTables As Tables
        Dim CrTable As Table

       

        cryRpt.Load(ReportLocation)

        With crConnectionInfo
            .ServerName = ServerName
            .DatabaseName = DBName
            .UserID = UserID
            .Password = Password
        End With

        CrTables = cryRpt.Database.Tables

        For Each CrTable In CrTables
            crtableLogoninfo = CrTable.LogOnInfo
            crtableLogoninfo.ConnectionInfo = crConnectionInfo
            CrTable.ApplyLogOnInfo(crtableLogoninfo)
        Next
        Dim toolbarStyle As New CrystalDecisions.Shared.ToolbarStyle()
        toolbarStyle.BackColor = System.Drawing.Color.LightGray
        CrystalReportViewer1.ParameterFieldInfo.Clear()

        CrystalReportViewer1.ToolbarStyle = toolbarStyle

        cryRpt.SetParameterValue("@i_ReportAttributesId", 1)
        cryRpt.SetParameterValue("@i_PillarId", 2)
        cryRpt.SetParameterValue("@i_RegionId", 31)
        cryRpt.SetParameterValue("@i_BranchId", 3)
        cryRpt.SetParameterValue("@i_ProjectId", 2)
        cryRpt.SetParameterValue("@i_ClusterId", 24)
        cryRpt.SetParameterValue("@i_VillageWardId", 15)
        cryRpt.SetParameterValue("@i_ReportingPeriod", "(2013/08/30)")

        CrystalReportViewer1.ReportSource = cryRpt
        CrystalReportViewer1.RefreshReport()

    End Sub

Trouble: When I pass parameters thro SP, my reports shows empty, let me know is it correct way ? pl help me

Regards,


Viewing all articles
Browse latest Browse all 1507

Trending Articles



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