Can't use object's property in my report
I have a C# program which passes some data to my report.
bankOffer is a collection of objects. Each object has a few simple-type fields and one field which is an object too:
I used [frBankOffer.ShareType.Type] in my report and it worked fine in my branch of program.
But after I had made a clone and updated my program from the main branch, the report failed to show this field in the program.
I checked incoming data and made sure that nothing changed in data format. So, the report gets the same data as before, but can't resolve ShareType.Type.
When I remove this ShareType.Type from the report, it shows the rest data in proper way. Seems like it can't extract any property from ShareType, although it can see the object, because when I use just [frBankOffer.ShareType] the report prints this field's type.
I tried to create an empty report with only "Text" and put [frBankOffer.ShareType.Type] in there. It works with my old program and it doesn't with the new one, although both programs have the same version on FastReport'd dll and, as I mention before, there is no difference between data sending to the report.
What could be wrong with that?
report.RegisterData(bankOffer, "frBankOffer");
report.GetDataSource("frBankOffer").Enabled = true;
DataBand bankOfferMain = (DataBand)report.FindObject("BankOfferMain");
bankOfferMain.DataSource = report.GetDataSource("frBankOffer");
Nothing special.bankOffer is a collection of objects. Each object has a few simple-type fields and one field which is an object too:
    public class BankOfferReport
    {
        public string Name { get; set; }
        public string Account { get; set; }
        public string SharesAmount { get; set; }
        public string SumFull { get; set; }
        public int Tax { get; set; }
        public int SumMinusTax { get; set; }
-->Â Â public ShareType ShareType { get; set; }
        public string ReportingYear { get; set; }
    }
    public class ShareType : ViewModelBase
    {
        public int Id { get; set; }
        public string Type { get; set; }
        private bool isSelected;
        public bool IsSelected
        {
            get { return isSelected; }
            set
            {
                isSelected = value;
                OnPropertyChanged("IsSelected");
            }
        }
    }
I used [frBankOffer.ShareType.Type] in my report and it worked fine in my branch of program.
But after I had made a clone and updated my program from the main branch, the report failed to show this field in the program.
I checked incoming data and made sure that nothing changed in data format. So, the report gets the same data as before, but can't resolve ShareType.Type.
When I remove this ShareType.Type from the report, it shows the rest data in proper way. Seems like it can't extract any property from ShareType, although it can see the object, because when I use just [frBankOffer.ShareType] the report prints this field's type.
I tried to create an empty report with only "Text" and put [frBankOffer.ShareType.Type] in there. It works with my old program and it doesn't with the new one, although both programs have the same version on FastReport'd dll and, as I mention before, there is no difference between data sending to the report.
What could be wrong with that?
Comments
void RegisterData(IEnumerable data, string name, int maxNestingLevel)
Registers the business object. Specify the maximum nesting level in the maxNestingLevel parameter. Several nested
objects may slow down the report.
Thanks, it works!)