Posted 6 September 2018, 1:34 pm EST
I am experiencing some growing pains converting from C1Report to C1FlexReport. I have report which has a box around some of the text. After conversion , this box would no longer render for some reason so I replaced it with a Shape in the FlexReport editor. I need to iterate through the various sub reports in the main report at runtime and set connection string info. I converted my code to support Flexreport and it worked fine UNTIL I added the shape field to my report. Here is the snipped of my code:
Dim f As C1.Win.FlexReport.Field
For Each f In C1FlexReport1.Fields
If Not IsNothing(f.Subreport) Then
f.Subreport.DataSource.ConnectionString = ConnStr
End If
Next
It gives the following runtime error during execution:
System.InvalidCastException: ‘Unable to cast object of type ‘C1.Win.FlexReport.ShapeField’ to type ‘C1.Win.FlexReport.Field’.’
Any suggestions?