Hi All,
At present l'm trying to achieve a couple of things as a mini proof of concept for a project, one l can do, the other alludes me. Reports to be created by the standalone designer, which are then dropped into a directory, where any application that needs them can change any connection strings and then load them into their respective viewers, but with all reports having no hard coded strings.
1. Create a report using the Standalone designer, then before rendering the report in a viewer have any / all SqlDatasources connection strings changed dynamically - OK (l can do this)
2. Don't have any strings in the report hard coded i.e textboxes for displaying titles, column headers etc.
I can do this by accessing the report in code, finding the appropriate item and settings its value before the report is rendered, however l would like to do this a bit more generically / the other way round; is there a way to set an item / collection on the report and then use an expression inside the standalone designer to bind say a textbox value to the an item in the collection (so it gets set at runtime), bearing in mind that the item may not have a datasource property for example a textbox that displays the name of a report on a page header.
What l would really like to do, assuming l could set a collection of say reportText objects on the report (that have a LabelText property) would be to use some sort of expression in the designer (using c# as an example)
textBoxTitle.Value = reportTextCollection.Where( item => item.controlID == "textBoxTitle").FirstOrDefault?.LabelText ?? "Default title value"
Or
textBoxTitle.Value = MyCustomExpressionAssembly.SetLabelText(controlID, reportTextCollection) // return see above
Any thoughts help appreciated, Thank you
Paul