Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Specifies the OLAP connection settings.
            ASPxPivotGrid1.OLAPDataProvider     = OLAPDataProvider.Adomd;
            ASPxPivotGrid1.OLAPConnectionString =
                @"Provider=MSOLAP;
                Data Source=http://demos.devexpress.com/Services/OLAP/msmdpump.dll; 
                Initial catalog=Adventure Works DW Standard Edition;
                Cube name=Adventure Works;
                Query Timeout=100;";

            // Retrieves fields.
            ASPxPivotGrid1.RetrieveFields(PivotArea.ColumnArea, false);

            // Adds some fields from the Field List to the specified area to create a report.
            ASPxPivotGrid1.Fields["[Customer].[Country].[Country]"].Area        = PivotArea.RowArea;
            ASPxPivotGrid1.Fields["[Customer].[Country].[Country]"].Visible     = true;
            ASPxPivotGrid1.Fields["[Customer].[City].[City]"].Area              = PivotArea.RowArea;
            ASPxPivotGrid1.Fields["[Customer].[City].[City]"].Visible           = true;
            ASPxPivotGrid1.Fields["[Date].[Fiscal].[Fiscal Year]"].Area         = PivotArea.ColumnArea;
            ASPxPivotGrid1.Fields["[Date].[Fiscal].[Fiscal Year]"].Visible      = true;
            ASPxPivotGrid1.Fields["[Measures].[Internet Sales Amount]"].Visible = true;

            // Sets the Customization Forms style to Excel2007 with additional capabilities.
            ASPxPivotGrid1.OptionsCustomization.CustomizationFormStyle = CustomizationFormStyle.Excel2007;
        }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ASPxPivotGrid1.DataSource = ManualDataSet.CreateData().Tables[0];
        ASPxPivotGrid1.DataBind();

        if (!IsPostBack)
        {
            Session["selectedRowIndex"] = 0;
            Session["selectedColIndex"] = 0;

            ASPxPivotGrid1.RetrieveFields();
            ASPxPivotGrid1.Fields["MyData"].Area     = DevExpress.XtraPivotGrid.PivotArea.DataArea;
            ASPxPivotGrid1.Fields["MyRow"].Area      = DevExpress.XtraPivotGrid.PivotArea.RowArea;
            ASPxPivotGrid1.Fields["MyDateTime"].Area = DevExpress.XtraPivotGrid.PivotArea.ColumnArea;

            ASPxPivotGrid1.Fields["MyDateTime"].ValueFormat.FormatType         = DevExpress.Utils.FormatType.DateTime;
            ASPxPivotGrid1.Fields["MyDateTime"].ValueFormat.FormatString       = "d";
            ((XYDiagram)WebChartControl1.Diagram).AxisX.DateTimeOptions.Format = DateTimeFormat.ShortDate;
        }

        PrepareChartData();
        FillChart();
    }