Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Invlaid Report Source in Crystal Report.

Posted on 2011-09-19
12
Medium Priority
?
319 Views
Last Modified: 2012-05-12
dear Experts, i am using Crystal Report 11 and vb.Net 2005, please see screen short, there are 5 datatables, all are filled with proper data, but while show the report system give "Invalid Reports source" message.
Note: i am using 4 sub report in main report.
Invalid-reports-Source.JPG
0
Comment
Question by:mahmood66
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 4
12 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 36560068
Are you trying to add 4 subreorts to the report?

mlmcc
0
 

Author Comment

by:mahmood66
ID: 36564712
yes.
0
 

Author Comment

by:mahmood66
ID: 36564713
In my other applications, i have done the same thing in so many reports. but i n this application, i don't know why system gives me this error. what can be the reason?
0
Automating Terraform w Jenkins & AWS CodeCommit

How to configure Jenkins and CodeCommit to allow users to easily create and destroy infrastructure using Terraform code.

 
LVL 101

Expert Comment

by:mlmcc
ID: 36564889
I don't know.  I have never seen that done.

mlmcc
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 36564895
Can you show all the code you use for the reports?

mlmcc
0
 

Author Comment

by:mahmood66
ID: 36565027
Note: my dataset i shaving now 5 Data Table, and all Data Tables are filled perfectly but only while show system gives the Invalid Report Source.

see my attached code.
Private Sub PrintAppraisal()
        Try
            Dim iEmpId As Integer = lkEmployee.EditValue
            Dim iPeriod As Integer = lkPeriods.EditValue
            Dim iYear As Integer = cmbYear.EditValue
            Dim dsAppraisal As DataSet = objAppraisalRatingMaster.GetCompleteAppraisal(iEmpId, iPeriod, iYear)
            If dsAppraisal.Tables(0).Rows.Count > 0 Then

                Dim dPart1TotScore As Decimal = 0
                Decimal.TryParse(Convert.ToString(dsAppraisal.Tables(2).Compute("sum(RatingScore)", "")), dPart1TotScore)
                Dim iPart1Count As Integer = 0
                Integer.TryParse(Convert.ToString(dsAppraisal.Tables(2).Compute("count(RatingScore)", "RatingScore > 0")), iPart1Count)
                Dim dPart1Perc As Decimal = (dPart1TotScore * (10 / iPart1Count)) * (70 / 100)


                Dim dPart2TotScore As Decimal = 0
                Decimal.TryParse(Convert.ToString(dsAppraisal.Tables(3).Compute("sum(RatingScore)", "")), dPart2TotScore)
                Dim iPart2Count As Integer = 0
                Integer.TryParse(Convert.ToString(dsAppraisal.Tables(3).Compute("count(RatingScore)", "RatingScore > 0")), iPart2Count)
                Dim dPart2Perc As Decimal = (dPart2TotScore * (10 / iPart2Count)) * (30 / 100)

                Dim dMeritsDemeritsTotal As Decimal = 0
                Decimal.TryParse(Convert.ToString(dsAppraisal.Tables(4).Compute("sum(TotalPoints)", "")), dMeritsDemeritsTotal)

                Dim dConsolidatedRating As Decimal = (dPart1Perc + dPart2Perc + dMeritsDemeritsTotal)
                dConsolidatedRating = Decimal.Round(dConsolidatedRating, 0)

                Dim drTmpConsRating As DataRow() = dsAppraisal.Tables(1).Select("MinRange<=" + dConsolidatedRating.ToString + " AND MaxRange>=" + dConsolidatedRating.ToString)
                Dim strConsolidatedRating As String = Convert.ToString(drTmpConsRating(0)("RatingDescription"))

                Dim objRepParamInfoLsit As New List(Of ReportParamInfo)
                Dim objRepParam As New ReportParamInfo
                objRepParam.ParamName = "P_P1"
                objRepParam.Param = dPart1Perc
                Dim objRepParam1 As New ReportParamInfo
                objRepParam1.ParamName = "P_P2"
                objRepParam1.Param = dPart2Perc
                Dim objRepParam2 As New ReportParamInfo
                objRepParam2.ParamName = "P_TotMeritDemrit"
                objRepParam2.Param = dMeritsDemeritsTotal
                Dim objRepParam3 As New ReportParamInfo
                objRepParam3.ParamName = "P_ConsRating"
                objRepParam3.Param = strConsolidatedRating

                Dim objRepParam4 As New ReportParamInfo
                objRepParam4.ParamName = "P_Qtr"
                objRepParam4.Param = iPeriod.ToString

                Dim objRepParam5 As New ReportParamInfo
                objRepParam5.ParamName = "P_Year"
                objRepParam5.Param = iYear





                objRepParamInfoLsit.Add(objRepParam)
                objRepParamInfoLsit.Add(objRepParam1)
                objRepParamInfoLsit.Add(objRepParam2)
                objRepParamInfoLsit.Add(objRepParam3)
                objRepParamInfoLsit.Add(objRepParam4)
                objRepParamInfoLsit.Add(objRepParam5)


                Dim strSubRepList As New List(Of String)
                strSubRepList.Add("H1A_AppraisalRatingMaster.rpt")
                strSubRepList.Add("H1B_AppraisalKeyFactors.rpt")
                strSubRepList.Add("H1C_AppraisalDuties.rpt")
                strSubRepList.Add("H1D_AppraisalMemoPoints.rpt")

                frmPrint.printFromSp(dsAppraisal, "H1_CompleteAppraisal.rpt", strSubRepList, objRepParamInfoLsit)
                frmPrint.Show()
            End If
        Catch ex As Exception
            Throw
        End Try
    End Sub
'*******************************
    Public Sub printFromSP(ByVal dtSet As DataSet, ByVal strReportPath As String, ByVal strSubRepList As List(Of String), ByVal objRepParamList As List(Of ReportParamInfo))
        Dim dr As New ReportDocument

        dr.Load(strMainReportPath + strReportPath)

        dr.SetDataSource(dtSet.Tables(0))
        For i As Integer = 0 To strSubRepList.Count - 1
            dr.Subreports(strSubRepList(i)).SetDataSource(dtSet.Tables(i + 1))
        Next
        setTableLogonForReportDoc(dr)
        For i As Integer = 0 To objRepParamList.Count - 1
            If (objRepParamList(i).IsSupReportParam) Then
                dr.SetParameterValue(objRepParamList(i).ParamName, objRepParamList(i).Param, objRepParamList(i).strSubReport)
            Else
                dr.SetParameterValue(objRepParamList(i).ParamName, objRepParamList(i).Param)
            End If

        Next
        crHRMS.ReportSource = dr
        crHRMS.Show()
    End Sub
'*******************************

Open in new window

Invalid-Report-Source-error.JPG
0
 

Author Comment

by:mahmood66
ID: 36566346
i have attached the code eve, if still you have question please let me know, i check each and every line, same code i have done in in other applications, that's work very fine, but in thin application this is my first report, and it starts giving error.
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 1500 total points
ID: 36567400
Is the report is the correct location?

mlmcc
0
 

Author Comment

by:mahmood66
ID: 36571727
Dear mlmcc:
i have got the solution, i have removed the dll files related to crystal report. and i removed the crystal report viewer from my form (frmprint), then i have included the crystal report viewer in the form. so its working now. i think there was a dll version problem. anyhow thanx a lot.
0
 

Author Comment

by:mahmood66
ID: 36572848
I've requested that this question be closed as follows:

Accepted answer: 0 points for mahmood66's comment http:/Q_27315021.html#36571727

for the following reason:

i have removed old dll file from project and includes it again, than its work fine.
0
 

Author Comment

by:mahmood66
ID: 36572849
Sorry for the wrong selection  of solution.
0
 

Author Closing Comment

by:mahmood66
ID: 36572861
your this comments guide me to find the problem and problem was in the DLL file version. so I recopy the Dll file and it works after the compiling.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question