How to add column to databand programatically

Stimulsoft Reports.NET discussion
Post Reply
theregister
Posts: 53
Joined: Wed Nov 27, 2013 5:24 pm

How to add column to databand programatically

Post by theregister »

Say I have this:

Code: Select all

Dim myDataband As New StiDataBand()
But then I want to do something like this:

Code: Select all

Dim myColumn As New StiDataColumn
myDataband.Components.Add(myColumn)
But it says that 'Stimulsoft.Report.Dictionary.StiDataColumn' cannot be converted into 'Stimulsoft.Report.Components.StiComponent'.
Then I tried to convert the column to a component but it didn't work:

Code: Select all

TryCast(Report.GetComponentByName(myColumn.Name), StiComponent)
It said the expression wasn't a method.

So how can a column be added to a databand via code?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: How to add column to databand programatically

Post by Alex K. »

Hello,

Please check the sample project in the attachment.

Thank you.
Attachments
CreateReportInCode.zip
(21.14 KiB) Downloaded 257 times
Post Reply