locked
Crystal Report doesn't show data when generated RRS feed

  • Question

  • User-1565161437 posted

    Hi! I have a problem with crystal report. When I generate it on runtime, it doesn't show any data. But it does when I check on the 'Main Report Preview' of VS 2010. I have also checked my stored procedure, it does produce data when I execute it. What seems to be the problem?

    The are no errors showing up. The crystal report just doesn;t show anyhting, only my headers. Please help, thanks! :)

    Here is my stored procedure:

    ALTER PROCEDURE [dbo].[GenerateOrgPlanningReport]
    (
    
    	  @HP VARCHAR(100) = NULL
    	, @FTW VARCHAR(100) = NULL
    	, @LocalSupervisor VARCHAR(100) = NULL
    	, @JobLevel VARCHAR(100) = NULL
    	, @JobType VARCHAR(100) = NULL
    	, @Positions VARCHAR(100) = NULL
    	, @Divisions VARCHAR(100) = NULL
    	, @Gender VARCHAR(100) = NULL
    	, @YrOfUpdateFROM VARCHAR(100) = NULL
    	, @YrOfUpdateTO VARCHAR(100) = NULL
    	, @EmployeeName VARCHAR(100) = NULL
    	
    )
    AS BEGIN
    SELECT
    	Emp.FirstName + ' ' + Emp.LastName AS EmployeeName,
    	CAST (Cmg.OverallPARating as VARCHAR(50)) AS OverallPARating,
    	Pos.PositionName,
    	Emp.ReportingToName,
    	Emp.DateJoined,
    	YEAR (GETDATE()) - CAST (SUBSTRING(emp.CurrentPositionDate, 4, 4) AS INT)AS IncumbentYearsInCurrentPosition ,
    	YEAR (GETDATE()) - CAST (SUBSTRING(emp.DateJoined, 4, 4) AS INT) AS IncumbentYearsInService,
    	Cmg.MonthlySalary,
    	Cmg.Performance,
    	Cmg.Collaboration,
    	Cmg.Potential,
    	Rep.ReplacementName,
    	Rep.DegOfReadinessID,
    	Rep.ReplacementCompensation,
    	(SELECT TOP (1)YEAR (GETDATE()) - CAST (SUBSTRING(emp.DateJoined, 4, 4) AS INT) FROM Employees Emp WHERE Rep.ReplacementEmployeeID=Emp.EmployeeID) AS ReplacementYrsInService 
    --(SELECT TOP (1) Cmg.MonthlySalary FROM ColorMeGreens Cmg WHERE Cmg.EmployeeID = Rep.ReplacementEmployeeID) AS ReplacementCompensation
    	
    	
    FROM Employees Emp
    
    LEFT JOIN ColorMeGreens Cmg
    ON Cmg.EmployeeID = Emp.EmployeeID
    
    LEFT JOIN Positions Pos
    ON Pos.PositionID = Emp.PositionID
    
    LEFT JOIN Replacements Rep
    ON Rep.EmployeeID = emp.EmployeeID
    
    
    WHERE
    	Cmg.YearOfUpdate BETWEEN @YrOfUpdateFROM AND @YrOfUpdateTO
    	 AND ((@FTW IS NULL) OR (Cmg.FTW = @FTW))
    	 AND ((@HP IS NULL) OR (Cmg.HP = @HP))
    	 AND ((@LocalSupervisor IS NULL) OR (Emp.ReportingToName = @LocalSupervisor))
    	 AND ((@JobLevel IS NULL) OR (Emp.JobLevelID = @JobLevel))
    	 AND ((@JobType IS NULL) OR (Emp.JobTypeID = @JobType))
    	 AND ((@Positions IS NULL) OR (Emp.PositionID = @Positions))
    	 AND  ((@Divisions IS NULL) OR (Emp.DivisionID = @Divisions))
    	 AND ((@Gender IS NULL) OR (Emp.Gender = @Gender))
    	 AND ((@EmployeeName IS NULL) OR (Emp.FirstName + ' ' + Emp.LastName = @EmployeeName))
    
    ORDER BY Emp.EmployeeID
    		
    	
    END



    My code for the passing of the parameters:
     protected void Page_Load(object sender, EventArgs e)
            {
              
                string  LocalSupervisor, JobLevel, JobType, Positions, Divisions, Gender, FiscalYrFROM, FiscalYrTO, EmployeeName, HP, FTW;
                HP = Convert.ToString(Session["orpHP"]);
                FTW = Convert.ToString(Session["orpFTW"]);
                JobLevel = Convert.ToString(Session["orpJobLevel"]);
                JobType = Convert.ToString(Session["orpJobType"]);
                Positions = Convert.ToString(Session["orpPositions"]);
                Divisions = Convert.ToString(Session["orpDivisions"]);
                Gender = Convert.ToString(Session["orpGender"]);
                FiscalYrFROM = Convert.ToString(Session["orpYearFrom"]);
                FiscalYrTO = Convert.ToString(Session["orpYearTo"]);
                EmployeeName = Convert.ToString(Session["orpEmployeeName"]);
                LocalSupervisor = Convert.ToString(Session["orpLocalSupervisor"]);
    
                OrganizationalPlanningReport rpt_OSW1 = new OrganizationalPlanningReport();
    
             
    
                rpt_OSW1.SetParameterValue("@HP", HP);
                rpt_OSW1.SetParameterValue("@FTW", FTW);
                rpt_OSW1.SetParameterValue("@LocalSupervisor", LocalSupervisor);
                rpt_OSW1.SetParameterValue("@JobLevel", JobLevel);
                rpt_OSW1.SetParameterValue("@JobType", JobType);
                rpt_OSW1.SetParameterValue("@Positions", Positions);
                rpt_OSW1.SetParameterValue("@Divisions", Divisions);
                rpt_OSW1.SetParameterValue("@Gender", Gender);
                rpt_OSW1.SetParameterValue("@YrOfUpdateFROM", FiscalYrFROM);
                rpt_OSW1.SetParameterValue("@YrOfUpdateFROM", FiscalYrTO);
                rpt_OSW1.SetParameterValue("@EmployeeName", EmployeeName);
    
                CrystalReportViewer1.ReportSource = rpt_OSW1;
            }




    Thursday, September 20, 2012 11:52 PM

All replies

  • User1196771204 posted

    hi there,

    have you tried it using different browsers? 

    Saturday, September 22, 2012 12:16 AM
  • User-1565161437 posted

    Hi. Thanks for the reply necro_mancer! Yeah, but still doesn't show up because the problem is really on the stored procedure. :)

    Wednesday, September 26, 2012 11:15 PM
  • User-162657812 posted

    i think the problem here is the binding of your data to the report, can you post here the code of your

    rpt_OSW1?

     

     

    Wednesday, October 3, 2012 1:05 AM