We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

how to create olapgrid in code

Thread ID:

Created:

Updated:

Platform:

Replies:

109896 Jul 10,2013 12:13 AM Mar 5,2015 08:11 AM ASP.NET Web Forms (Classic) 7
loading
Tags: OlapGrid
robert
Asked On July 10, 2013 12:13 AM

code:
/// <summary>
        /// Samples the browser settings.
        /// </summary>
        public OlapGrid og = new OlapGrid();
        public WaitingPopup ow = new WaitingPopup();
     

        protected void Page_Load(object sender, EventArgs e)
        {
            AdomdDataProvider dataProvider = null;
            if (dataProvider == null)
            {
                string connectionString = "Datasource='C:\\Syncfusion\\11.2.0.25\\Common\\Data\\OfflineCube\\ASP\\Adventure_Works_Ext.cub'; Provider=msolap;";
                if (connectionString != null)
                {
                    dataProvider = new AdomdDataProvider(connectionString);
                    Session["DataProvider"] = dataProvider;
                }
            }
            if (dataProvider != null)
            {
                
                og.ID = "og";
                if (!IsPostBack)
                {
                    //// Data binding
                    OlapDataManager DataManager = new OlapDataManager(dataProvider);
                    DataManager.SetCurrentReport(SimpleReport());
                    og.OlapDataManager = DataManager;
                    og.DataBind();
                }

                GridContainer.ContentTemplateContainer.Controls.Add(og);
                ow.DisableOnShowElementID = "og";
                GridContainer.ContentTemplateContainer.Controls.Add(ow);

            }
     

            
        }

error:
[NullReferenceException: 未将对象引用设置到对象的实例。]
   Syncfusion.Web.UI.WebControls.Olap.Locale.OlapResourceManager.get_ResourcePath() +38
   Syncfusion.Web.UI.WebControls.Olap.Locale.OlapResourceManager.EnsureResources(Boolean isDefaultCulture) +93
   Syncfusion.Web.UI.WebControls.Olap.Locale.OlapResourceManager.EnsureResources() +52
   Syncfusion.Web.UI.WebControls.Olap.Locale.OlapResourceManager.get_Resources() +40
   Syncfusion.Web.UI.WebControls.Olap.Locale.OlapResourceManager.GetString(String name) +34
   Syncfusion.Web.UI.WebControls.Grid.Olap.CellDetailsToolTip..ctor(OlapGrid grid) +69
   Syncfusion.Web.UI.WebControls.Grid.Olap.OlapGrid.CreateChildControls() +3351
   System.Web.UI.Control.EnsureChildControls() +102
   System.Web.UI.Control.PreRenderRecursiveInternal() +42
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496

Prabu S [Syncfusion]
Replied On July 11, 2013 05:42 AM

Hi Robert,

We would like to inform you that we have created an incident for follow-up regarding this query under direct-trac support system (Incident ID: 110593).

Please let us know if you have any query.

Regards,

Prabu S.

ericpoon
Replied On September 12, 2013 12:16 AM

Hello,

I would like to know ho to create the olap grid in code too, i got the following error:

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[NullReferenceException: Object reference not set to an instance of an object.]
   Syncfusion.Web.UI.WebControls.Shared.PopupControl.PopupBase.SetViewStateValue(String sKey, Object oValue, Object oDefaultValue) +15
   Syncfusion.Web.UI.WebControls.Shared.WaitingPopup.SetViewStateValue(EViewStateKeys eKey, Object oValue) +75
   Syncfusion.Web.UI.WebControls.Shared.WaitingPopup.set_DisableOnShowElementID(String value) +10
   Syncfusion.Web.UI.WebControls.Grid.Olap.OlapGrid.AddWaitingPopup() +31
   Syncfusion.Web.UI.WebControls.Grid.Olap.OlapGrid.CreateChildControls() +2256
   System.Web.UI.Control.EnsureChildControls() +87
   System.Web.UI.Control.PreRenderRecursiveInternal() +44
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

Prabu S [Syncfusion]
Replied On September 16, 2013 01:53 PM

Hi Robert,

 

We are not able to reproduce the reported problem and kindly ensure the patch provided through direct-trac support system (Incident ID: 110593) is correctly installed.

 

Please  find the sample in following link. In the sample OlapGrid is created through code-behind.

http://www.syncfusion.com/uploads/user/directTrac/110593/OlapGrid_ThroughCode-1566539660.zip

 

Please let us know if you want any further assistance.

 

Regards,

Prabu S.


saglietto piermaria
Replied On March 3, 2015 02:28 AM

Hello,
I have the same problem of ericpoon an I can't download the .zip file. Can anyone help me to solve the problem?

Thanks

Regads

Ramesh Govindaraj [Syncfusion]
Replied On March 4, 2015 06:05 AM

Hi Robert,

Sorry for the inconvenience caused.

Please find the sample in the below link.

Sample Link:

http://www.syncfusion.com/downloads/support/directtrac/109896/grid_code_behind-1266291619.zip

Please let us know if you have any concern.

Thanks,

Ramesh. G



saglietto piermaria
Replied On March 4, 2015 11:24 AM

Thanks, I've solved the problem.

Regards

Alagarsamy D [Syncfusion]
Replied On March 5, 2015 08:11 AM

Hi Robert,
 
Thanks for the update.
 
Thanks,
Alagarsamy D.



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;