I've found how to connect a dataset to a form, but now I'm trying to create a text box to pick up a field from my dataset. I know I'm doing it wrong, but I'm not sure what to do to make it correct...
Here is my code :
Code: Select all
' Build Dataset
Dim ds As DataSet
dms.CreateRecordOnly("Result")
dms.CreateRecordOnly("tmp")
dms.dataDate("tmp", 1) = "01/01/05"
dms.dataDate("tmp", 2) = "01/05/07"
dms.data("tmp", 3) = "1"
dms.record("Result") = dms.CallProg("WIN.VEHICLES.DELIVERY.REPORT", DMS.record("tmp"))
ds = dms.BuildDataSet("Result")
ds.Tables(0).TableName = "spv"
' Register dataset onto report
Me.StiReport1.RegData("spv", ds.Tables(0))
Me.StiReport1.DataStore.RegData("spv", ds.Tables(0))
StiReport1.Dictionary.Synchronize()
' Now Dynamically Add Data column - For data column "Model" in dataset
Dim tb As New Stimulsoft.Report.ReportControls.StiTextBoxControl
tb.Left = 6.0
tb.Top = 0
tb.Text = "{Spv.Model}"
Dim stico As Stimulsoft.Report.Components.StiDataBand
Dim stipage As Stimulsoft.Report.Components.StiPage
stico = CType(Me.StiReport1.GetComponentByName("DataBand1"), Stimulsoft.Report.Components.StiDataBand)
stipage = CType(Me.StiReport1.GetComponentByName("Page1"), Stimulsoft.Report.Components.StiPage)
tb.Parent = stico
tb.Page = stipage
StiReport1.Compile()
StiReport1.Render(False)
StiReport1.Show()
Regards
Simon