Dear colleagues, i faced with problem.
May be someone can helped me.
This line in code bellow
"crSubReport.Database.Tables(0).SetDataSource(dsReport) "
is reset my "main" object, i mean all values for parameters after this line equals null.
WHY!!!???
Thank you in advance.
my scype: conspiratus1
Dim main As New Object
Select Case _reportType
Case 0
main = New CRCheckConsistency2
posCollection.Add("CPOSWITHSALES")
posCollection.Add("CPOSWITHOUTSALES")
posCollection.Add("CPOSMODIF")
posCollection.Add("CPOSABNORMALTREND")
posCollection.Add("EANWITHSALES")
posCollection.Add("EANWITHOUTSALES")
posCollection.Add("EANABNORMALTREND")
posCollection.Add("EANMODIF")
posCollection.Add("CPOSUNKNOWN")
posCollection.Add("EANUNKNOWN")
posCollection.Add("CPOSWITHOUTADDR")
posCollection.Add("EANWITHOUTDESC")
posCollection.Add("CPOSEXCLUDED")
posCollection.Add("EANEXCLUDED")
Case 1
main = New CRCheckRelevance2
posCollection.Add("ACTPOSWITHOUTSALES")
posCollection.Add("SUPPPOSWITHSALES")
posCollection.Add("INACBRDWITHSALES")
posCollection.Add("ACTBRDWITHSALES")
posCollection.Add("ACTBRDWITHOUTSALES")
posCollection.Add("POSPERCHAIN")
posCollection.Add("POSPERCHANNEL")
posCollection.Add("BRANDPERPRICECAT")
posCollection.Add("BRANDPERTASTE")
posCollection.Add("BRANDPERBLEND")
posCollection.Add("BRANDPERSIZE")
posCollection.Add("BRANDPERMANUFACT")
posCollection.Add("OTPPERMANUFACT")
posCollection.Add("TOTALPERMANUFACT")
posCollection.Add("WRLCHECK")
End Select
Dim _checkResultDetailDatatable As DataTable = dsReport.Tables("CHECK_RESULT_DETAIL")
Dim nbr As Integer = checkResultDetailAdapter.SelectBySubEntityByMonth(_checkResultDetailDatatable, _subentityId, _monthId, typeResultIds)
dsReport.AcceptChanges()
Dim crSubReport As ReportDocument
For Each typeCode In posCollection
crSubReport = New ReportDocument
typeResult = typeResultAdapter.SelectByCodeGetBo(typeCode)
crSubReport = main.OpenSubreport(typeCode)
crSubReport.Database.Tables(0).SetDataSource(dsReport)
main.SetParameterValue("typeResultId", typeResult.TYP_RSLT_ID, typeCode)
main.SetParameterValue("period", VISTA.Main.boSubentityProcess.month, typeCode)
main.SetParameterValue("subentity", VISTA.Main.boSubentityProcess.subEntity, typeCode)
Select Case _reportType
Case 0
main.SetParameterValue("title", "CONSISTENCY CHECK RESULTS", typeCode)
Case 1
main.SetParameterValue("title", "RELEVANCE CHECK RESULTS", typeCode)
End Select
Dim sberp As ReportDocument = New ReportDocument()
Next
For Each typeCode In posCollection
dv = New DataView(dsReport.Tables("CHECK_RESULT_DETAIL"))
typeResult = typeResultAdapter.SelectByCodeGetBo(typeCode)
dv.RowFilter = "TYP_RSLT_ID = " + typeResult.TYP_RSLT_ID.ToString()
If dv.Count = 0 Then
main.SetParameterValue(typeCode + "View", True)
Else
main.SetParameterValue(typeCode + "View", False)
End If
Next
CrystalReportViewer1.ReportSource = main