Hello,
I have a VB 2010 application and I am trying to use Reportviewer rather than Crystal. I have many values assigned to variables that are determined at run time by the user and resulting calcultions. I got Parameters to work but I have so many that it's hard to keep organized and not miss something. I appears that Classes and Collections with a method to return a list would work much better. I have been trying but can't quite get there.
So far I appear to have been able to get the first of the Classes, Collection and List into the ReportViewer Data Source and I have draggged and dropped them into the report (Report1.rdlc) and I have assigned values (variables determined at run time) to the Class Properties in the Load event of the ReportViewer form (SCoPeReport.vb). However, the text values for the properties do not show up on the report.
Can you tell me what I am missing to make this work? I have hundreds of these variables to keep track of and I am try to get this working on a small number of them to start the first of the Classes. My present code is shown below.
Thank you,
Dan
This is the code for the Class
Imports System.Collections.Generic
PublicClassProjectInfo :InheritsList(OfProjInfo) 'From this above line Data Sourced gets Drag]Drop witgh fields below.
EndClass
PublicClassProjInfo
Dim _PrjName AsString
Dim _PrjAddress AsString
Dim _PrjCSZ AsString
Dim _JbNo AsString
Dim _ClcNo AsString
Dim _ClcDate AsString
Dim _PrpName AsString
Dim _PrpCoName AsString
Dim _PrpAddress AsString
Dim _PrpCSZ AsString
Dim _PrpPhone AsString
Dim _PrpFax AsString
Dim _PrpEmail AsString
Dim _PrpURL AsString
PublicProperty PrjNameAsString
Get
Return _PrjName
EndGet
Set(value AsString)
_PrjName = value
EndSet
EndProperty
PublicProperty PrjAddressAsString
Get
Return _PrjAddress
EndGet
Set(value AsString)
_PrjAddress = value
EndSet
EndProperty
PublicProperty PrjCSZAsString
Get
Return _PrjCSZ
EndGet
Set(value AsString)
_PrjCSZ = value
EndSet
EndProperty
PublicProperty JbNoAsString
Get
Return _JbNo
EndGet
Set(value AsString)
_JbNo = value
EndSet
EndProperty
PublicProperty ClcNoAsString
Get
Return _ClcNo
EndGet
Set(value AsString)
_ClcNo = value
EndSet
EndProperty
PublicProperty ClcDateAsString
Get
Return _ClcDate
EndGet
Set(value AsString)
_ClcDate = value
EndSet
EndProperty
PublicProperty PrpNameAsString
Get
Return _PrpName
EndGet
Set(value AsString)
_PrpName = value
EndSet
EndProperty
PublicProperty PrpCoNameAsString
Get
Return _PrpCoName
EndGet
Set(value AsString)
_PrpCoName = value
EndSet
EndProperty
PublicProperty PrpAddressAsString
Get
Return _PrpAddress
EndGet
Set(value AsString)
_PrpAddress = value
EndSet
EndProperty
PublicProperty PrpCSZAsString
Get
Return _PrpCSZ
EndGet
Set(value AsString)
_PrpCSZ = value
EndSet
EndProperty
PublicProperty PrpPhoneAsString
Get
Return _PrpPhone
EndGet
Set(value AsString)
_PrpPhone = value
EndSet
EndProperty
PublicProperty PrpFaxAsString
Get
Return _PrpFax
EndGet
Set(value AsString)
_PrpFax = value
EndSet
EndProperty
PublicProperty PrpEmailLAsString
Get
Return _PrpEmail
EndGet
Set(value AsString)
_PrpEmail = value
EndSet
EndProperty
PublicProperty PrpURLAsString
Get
Return _PrpURL
EndGet
Set(value AsString)
_PrpURL = value
EndSet
EndProperty
EndClass
This is the code for the Load event of the Reprtviewer form (SCoPeReport.vb)
PublicClassSCoPeReport
PrivateSub SCoPeReport_Load(senderAs System.Object, eAs System.EventArgs)HandlesMyBase.Load
Dim Project AsNewProjInfo
Project.PrjName = gsProjName
Project.PrjAddress = gsProjAddress
Project.PrjCSZ = gsProjCSZ
Project.JbNo = gsProjNo
Project.ClcNo = gsCALCno
Project.ClcDate = Now.Date
Project.PrpName = gsPrepName
Project.PrpCoName = gsPrepCoName
Project.PrpAddress = gsPrepAddress
Project.PrpCSZ = gsPrepCSZ
Project.PrpPhone = gsPrepPhone
Project.PrpFax = gsPrepFax
Project.PrpEmailL = gsPrepEmail
Project.PrpURL = gsPrepURL
Me.ReportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout)
EndSub
EndClass
Dan