Click here to Skip to main content
15,889,909 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I created Sample MVC devexpress Dashboard application.

I got an error 'An exception of type 'System.NullReferenceException' occurred in DevExpress.Dashboard.v16.2.Core.dll but was not handled in user code' while updating the data extract in gloabal.asax.cs.


void RegisterDefaultDashboard(string dashboardId)
{
string dashboardLocalPath = Server.MapPath(string.Format(@"~/App_Data/Dashboards/{0}.xml", dashboardId));
SessionDashboardStorage.Instance.RegisterDashboard(dashboardId, XDocument.Load(dashboardLocalPath));
ReloadExtract_Click(dashboardId);
}
protected void ReloadExtract_Click(string dashboardId)
{
using (Dashboard newDashboard = new Dashboard())
{
newDashboard.LoadFromXml(Server.MapPath(string.Format(@"~/App_Data/Dashboards/{0}.xml", dashboardId)));
var dataSources = newDashboard.DataSources.OfType<dashboardextractdatasource>().ToArray();
foreach (DashboardExtractDataSource dataSource in dataSources)
dataSource.UpdateExtractFile();
}
}

Please suggest me

What I have tried:

void RegisterDefaultDashboard(string dashboardId)
{
string dashboardLocalPath = Server.MapPath(string.Format(@"~/App_Data/Dashboards/{0}.xml", dashboardId));
SessionDashboardStorage.Instance.RegisterDashboard(dashboardId, XDocument.Load(dashboardLocalPath));
ReloadExtract_Click(dashboardId);
}
protected void ReloadExtract_Click(string dashboardId)
{
using (Dashboard newDashboard = new Dashboard())
{
newDashboard.LoadFromXml(Server.MapPath(string.Format(@"~/App_Data/Dashboards/{0}.xml", dashboardId)));
var dataSources = newDashboard.DataSources.OfType<dashboardextractdatasource>().ToArray();
foreach (DashboardExtractDataSource dataSource in dataSources)
dataSource.UpdateExtractFile();
}
}
Posted
Updated 29-May-17 15:59pm
v2
Comments
[no name] 29-May-17 6:52am    
So debug your code and fix it.

1 solution

Given that you are using a 3rd party library that appears to have had an exception within its code (although its probably an issue in your usage to be honest) I would suggest you direct this kind of question to their forums.

DevExpress Forums - Presentation Components, IDE Productivity Tools, Reporting, App Frameworks - Developer Express Inc.[^]

I use to work with their winforms library and their community is pretty active so you'll have a lot better time of getting useful help by directing your question to the link above.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900