Dim rp As New ReportDocument
Dim myData As New MyDataSet
Dim dt As New MyDataSet.UserDataTable
Dim FirstRow As MyDataSet.UserRow = _
CType(myData.User.NewRow, MyDataSet.UserRow)
FirstRow.MemberID = "1"
FirstRow.FirstName = "Amir Hossein"
FirstRow.LastName = "Rahnama"
myData.User.Rows.Add(FirstRow)
Dim SecondRow As MyDataSet.UserRow = _
CType(myData.User.NewRow, MyDataSet.UserRow)
SecondRow.MemberID = "2"
SecondRow.FirstName = "Aziz"
SecondRow.LastName = "Khodaie"
myData.User.Rows.Add(SecondRow)
rp.Load("C:\Report.rpt")
rp.SetDataSource(myData)
CRV1.ReportSource = rp
When setting the datasource It comes up with an error:
Unknown Database Connector Error Error in File C:\DOCUME~1\A_RAHN~1\LOCALS~1\Temp\1\Report {832105B2-2E31-4018-9761-77581CC86142}.rpt: Unknown Database Connector Error
To let you know, I created that report by Crystal Reports 2008 Stand-alone IDE rather than generating it in VS2010 IDE and it is binded to that dataset dutring the crystal report wizard.
What you need to do is that you will add an attribute to startup element in the following order:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With