Posted 24 October 2023, 9:10 am EST - Updated 24 October 2023, 9:15 am EST
'FieldBase' does not contain a definition for 'Picture' using C1FlexReport in
Posted by: fanoos.pasha on 24 October 2023, 9:10 am EST
-
-
Posted 25 October 2023, 3:07 am EST
Hello fanoos,
This error is thrown because the Fields property of FlexReport gets the collection of Field objects, but you are trying to access the ImageField object’s property.
To solve this, please try to cast the Field object to the ImageField object as follows:((ImageField)report.Fields["ImageField"]).Picture = "Picture"; ((ImageField)report.Fields["ImageField"]).PictureScale = PictureScaleEnum.Scale;
Please refer to the attached sample for implementation. (see FlexReport_Image.zip)
Regards,
Prabhat Sharma.
FlexReport_Image.zip -
Posted 26 October 2023, 8:44 am EST
Hi Prabhat,
Yes, it is working after casting the Field object to the “ImageField” object .
Thank you so much for your support.
Thanks
Fanoos Pasha -
Posted 30 October 2023, 6:41 am EST
Hi Prabhat,
unable to migrate following line of code from C1Report to C1FlexReport
From ((C1.C1Report.CustomFields.Chart)theField).RecordSource = strQuery; working
TO ((C1FlexReport.CustomFields.Chart)theField).RecordSource = strQuery; giving error
Kindly assists.
-
Posted 1 November 2023, 4:29 am EST
Hello fanoos,
C1Report used the recordSource property to pass a query string to query data using the same connection string as the main data source, whereas in C1FlexReport, it creates a secondary data source and sets that data source to the chart’s DataSource property.
When you open your legacy C1Report with C1FlexReport Designer, it automatically does this. So if you want to change the RecordSource property for the chart, you will need to see which dataSource your chart is bound to and use that dataSource to set the RecordSource as follows:report.DataSources["Field1DataSource"].RecordSource = "select * from cars where id < 20";
Please refer to the attached sample for implementation. (see FlexReport48_RecordSource.zip)
**Note: ** If you are migrating manually, please create a new dataSource and bind your chart field to it using it’s DataSource property.
Regards,
Prabhat Sharma.