Can't use object's property in my report

edited July 2018 in FastReport .NET
I have a C# program which passes some data to my report.
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

  • edited 4:32AM
    try : report.RegisterData(bankOffer, "frBankOffer", 3);


    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.


  • edited 4:32AM
    ipong wrote: »
    try : report.RegisterData(bankOffer, "frBankOffer", 3);


    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!)

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.