Monday, February 1, 2010

New Pivoting module

eXpand says hi to its new Pivoting module.

Show In Analysis action similar to show in reports (see also Devexpress example)
image

All Pivot control settings can be controled at runtime using the Pivot Settings action

image

see for example the Pivot Options View settings view

image

ModelArtifacteState module has been used to create a Show In Analysis , Pivot Settings Permissions that can be applied to the Roles you want .

[NonPersistent]

public class ShowInAnalysisPermission : ControllerStateRulePermission {

    public override string ControllerType {

        get { return typeof (ShowInAnalysisViewController).FullName; }

        set { base.ControllerType = value; }

    }

 

    public override string ToString() {

        return string.Format("{1}: {0}", ID, GetType().Name);

    }

}

[NonPersistent]

public class PivotSettingsPermission : ControllerStateRulePermission {

    public override string ControllerType {

        get { return typeof (PivotOptionsController).FullName; }

        set { base.ControllerType = value; }

    }

 

    public override string ToString() {

        return string.Format("{1}: {0}", ID, GetType().Name);

    }

}

image

In place pivot editing by using the AllowEdit model attribute

image

AnalysisControlVisibility for controlling the visibility of Pivot or Chart control

image

PivotedPropertyAttribute

You can make at runtime complex views like the above by applying it.

image

Say you have an object with an associated collection property like

[Association("OwnerShellSite-CompetitorLinks")]

[Aggregated]

[DevExpress.Xpo.DisplayName("Competitors")]

public XPCollection<CompetitorLink> OwnerCompetitorLinks {

    get { return GetCollection<CompetitorLink>("OwnerCompetitorLinks"); }

}

if you like instead of the listview that will be shown by default to display a pivot upon OwnerCompetitorLinks collection then you just create another property like

[PivotedProperty("Prices", "Name='Site price analysis'")]

public Analysis PriceAnalysis {

    get { return _priceAnalysis; }

    set { SetPropertyValue("PriceAnalysis", ref _priceAnalysis, value); }

}

and eXpand will do the rest for you!!!

You may also want to pivot on an orphan collection

[Browsable(false)]

public XPCollection<Price> CompetitorPrices {

    get {

        return new XPCollection<Price>(Session);

    }

}

then you should use a different constructor like

[PivotedProperty("CompetitorPrices", "Name='Competitor site price analysis'","PropertyWithSameTypeAsCurrentObjectInPrice")]

public Analysis CompetitorPriceAnalysis {

    get { return _competitorPriceAnalysis; }

    set { SetPropertyValue("CompetitorPriceAnalysis", ref _competitorPriceAnalysis, value); }

}

In the following video you can see how you render any collection of your object with the pivot control in the same detailview as the object using eXpand’s PivotedPropertyAttribute at RUNTIME

The modules you have to register for Pivoting with eXpand would be eXpand.ExpressApp.PivotChart.dll ,eXpand.ExpressApp.PivotChart.Win.dll

Subscribe to XAF feed
Subscribe to community feed

DiggIt!
blog comments powered by Disqus