Hi! I'm having some issues with Crystal Reports... I have a report with unbound fields. I'm trying to bind them at runtime to code from a dataset, but I'm not really sure how I should go about this. Can anyone give me some ideas? I currently have:
The code is a little messy, as it's still got a bunch of stuff from tests I've done, but I'm really stuck here. I hope that someone here can help me out!
Code:
Dim crTES2 As New Timesheet
Dim crTES As New rptTES
Dim rowRows As DataRow
Dim dsReport As DataSet
Dim dsTest As DataSet
Dim intKey As Integer
Dim strTest As String
intKey = Val(strKey)
crvTES.ReportSource = crTES
dsReport = Connect(2)
dsTest = Connect("Select * from TimesheetInfo where Entry = 2")
'dsReport = Connect("Select * from CurrentTimesheet")
crvTES.ReportSource = crTES
crTES.SetDataSource(dsTest)
For Each rowRows In dsTest.Tables(0).Rows
Next
crTES.DataDefinition.FormulaFields("Employee").Text = "{TimesheetInfo.PayrollNum}"
'strTest = dsTest.Tables(0).Columns("PayrollNum").ToString
crTES.DataDefinition.FormulaFields("Employee").Text = "'" & strTest & "'"
'crvTES.SelectionFormula = "{ShiftReport.ShiftCount} = " & Val(strKey)
Me.ShowDialog()
The code is a little messy, as it's still got a bunch of stuff from tests I've done, but I'm really stuck here. I hope that someone here can help me out!