RegisterDatasource

dannidanni Denmark
edited 11:30PM in FastReport .NET
Hi

I have the following objectgraph and registered the "items" list as datasource. After thre RegisterData I enable the lists in the datasource.
My problem is when I look Data in the designer then I only see the first object in each level in the object graph, but want to show all. Can you see what im doing wrong?

If I look at mainmenu->Data->Reportdata with the treeview I get the full object graph - of I press ok in that window the Data windows is updated with the full object graph.


Thank you.
                    List<ReportObjectElev> items = new List<ReportObjectElev>();
                    ReportObjectElev elev = new ReportObjectElev();
                    elev.Bop?¦lskommune = new ReportBaseKommune();
                    elev.Brobygningshold = new List<ReportBaseBrobygningshold>();
                    elev.Brobygningshold.Add(new ReportBaseBrobygningshold());
                    elev.Fraflytningskommune = new ReportBaseKommune();
                    elev.Historik = new List<ReportBaseHistorik>();
                    elev.Historik.Add(new ReportBaseHistorik());
                    elev.Holdtilmeldinger = new List<ReportBaseHoldtilmelding>();
                    elev.Holdtilmeldinger.Add(new ReportBaseHoldtilmelding());
                    elev.Kontaktpersoner = new List<ReportBaseKontakt>();
                    elev.Kontaktpersoner.Add(new ReportBaseKontakt());
                    elev.Notater = new List<ReportBaseNotat>();
                    elev.Notater.Add(new ReportBaseNotat());
                    elev.Praktikformidlinger = new List<ReportBasePraktikformidling>();
                    elev.Praktikformidlinger.Add(new ReportBasePraktikformidling());
                    elev.Prim?¦rKontaktperson = new ReportBaseAnsat();
                    elev.Relationer = new List<ReportBasePerson>();
                    elev.Relationer.Add(new ReportBasePerson());
                    elev.Skole = new ReportBaseSkole();
                    elev.Skole??r = new ReportBaseSkoleaar();
                    elev.Stamklasse = new ReportBaseHoldtilmelding();
                    elev.Vejleder = new ReportBaseAnsat();
                    items.Add(elev);
                    
                    report.RegisterData(items, "Elevdata", FastReport.Data.BOConverterFlags.BrowsableOnly, 3);                    
                    report.GetDataSource("Elevdata").Enabled = true;
                    report.GetDataSource("Elevdata.Brobygningshold").Enabled = true;
                    report.GetDataSource("Elevdata.Historik").Enabled = true;
                    report.GetDataSource("Elevdata.Holdtilmeldinger").Enabled = true;
                    report.GetDataSource("Elevdata.Kontaktpersoner").Enabled = true;
                    report.GetDataSource("Elevdata.Notater").Enabled = true;
                    report.GetDataSource("Elevdata.Praktikformidlinger").Enabled = true;
                    report.GetDataSource("Elevdata.Relationer").Enabled = true;

Comments

  • edited 11:30PM
    Hello,

    Which FR.Net version do you use? Did you tried the latest version?
  • dannidanni Denmark
    edited 11:30PM
    i use version 1.2.1.0.

    I made a simple test project where it worked fine, so it must be our objects that arent instantiated or something.
  • edited September 2009
    I have fixed something after 1.2.1, please try latest available build.
  • dannidanni Denmark
    edited 11:30PM
    AlexTZ wrote: »
    I have fixed something after 1.2.1, please try latest available build.


    Now I have installed version 1.2.23 but it doesnt help.

    I have uploaded a very small test project where I made a datasource. If you use that one it works.

    There is a Entities.Dll included in the project. If you use that datasoruce. The tree in the Data windows is not builded correctly. Could be our object thats weird.

    FRTestDesigner.rar is the test project using FR version 1.2.23

    Untitled.Png shows a screen dump where you can see a difference in the Data windows and the "select report data" menu.

    I cannot see what wrong with it. Maybe you can?

    Thanks.
  • dannidanni Denmark
    edited 11:30PM
    Can it be maxNestingLevel is bugged?

    maxNestingLevel with values 1 to 4 give different registered data, but if I use a value larger than 4 there is no change.

    I even tried 1000 for fun and there is no difference from 4.
  • edited 11:30PM
    I found the bug with maxNestingLevel. The update will be available in the next daily build (today).
  • dannidanni Denmark
    edited 11:30PM
    Fast debugging I must say!

    Thanks! :-)
  • dannidanni Denmark
    edited September 2009
    Hi again.

    It works now, but maybe it works a bit too well now :-)

    Now I can see the properties of System.Objects aswell.

    System.DateTime, Systen.Int32 forinstance.

    Try check out the enclosed picture. This is en error trying to preview the "value" of a nullable Int32 eg. Int32?.

    /Thanks
  • edited 11:30PM
    Hello,

    I will try to fix this as well.
  • dannidanni Denmark
    edited 11:30PM
    Hi,

    Just checking what the status is on this item?

    Do datetime, datetime? and int? act like objects or simple datatypes when viewed in the "Data" window of the designer?

    thanks >
  • edited 11:30PM
    Hello,

    It was fixed long time ago - sorry I didn't notify you about this.

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.