Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing a dashboard a second time results in an exception #406

Closed
vimarx opened this issue May 19, 2019 · 16 comments
Closed

Editing a dashboard a second time results in an exception #406

vimarx opened this issue May 19, 2019 · 16 comments

Comments

@vimarx
Copy link
Member

vimarx commented May 19, 2019

if you create a Dashboard , edit using Dashboard designer, saves it, then open dashboard designer again , an duplicate element exception raises,

Type:       InvalidNameException
Message:    Esta colección ya contiene un elemento con el nombre ' DashboardObjectDataSource'
Data:       0 entries
Stack trace:

en DevExpress.DashboardCommon.Native.ObjectNameGenerator.CheckName(String name)
en DevExpress.DashboardCommon.Native.ObjectTypeNameGenerator.CheckName(String name)
en System.EventHandler1.Invoke(Object sender, TEventArgs e) en DevExpress.DataAccess.NotifyingCollection1.BeforeAddItem(T item)
en DevExpress.DataAccess.NotifyingCollection1.InsertItem(Int32 index, T item) en Xpand.ExpressApp.Dashboard.Services.Extensions.GetDashboard(IDashboardDefinition dashboardDefinition) en Xpand.ExpressApp.Dashboard.Services.Extensions.GetDashboard(IDashboardDefinition dashboardDefinition, XafApplication application, RuleMode ruleMode, IXpandDashboardDataSourceFillService dashboardDataSourceFillService, DataSourceOptionsContainer options, Action1 editParameters, Action modeParametersEdited)
en Xpand.ExpressApp.XtraDashboard.Win.Templates.DashboardDesignerForm.LoadTemplate(IDashboardDefinition dashboardDefinition, XafApplication application)
en Xpand.ExpressApp.XtraDashboard.Win.Controllers.DashboardDesignerController.DashboardEditExecute(Object sender, SimpleActionExecuteEventArgs e)
en DevExpress.ExpressApp.Actions.ActionBase.ExecuteCore(Delegate handler, ActionBaseEventArgs eventArgs)
InnerException is null

@apobekiaris
Copy link
Member

Thnks fix is provide in #363 and patch is building

@apobekiaris apobekiaris removed their assignment May 20, 2019
@vimarx
Copy link
Member Author

vimarx commented May 20, 2019

the DataSource is empty for new dashboards
image

and also the generated XML

@apobekiaris
Copy link
Member

I guess that you already patched the sources with my previous suggestion which was a bad one. I tested this one and works for both cases

        private static void AddNewDataSources(IDashboardDefinition dashboardDefinition, DevExpress.DashboardCommon.Dashboard dashboard){
            var dashboardTypesCount = dashboardDefinition.DashboardTypes.Count;
            if (dashboardTypesCount > 1) {
                throw new UserFriendlyException($"{dashboardDefinition.Name} contains {dashboardTypesCount} dashboard types. Only one dashboard type is supported.");
            }

            
            var wrapper = dashboardDefinition.DashboardTypes.First();
            var dataSource = new DashboardObjectDataSource{
                DataSourceType = wrapper.Type,
                Name = nameof(DashboardObjectDataSource),
                ComponentName = nameof(DashboardObjectDataSource)
            };
            if (!dashboard.DataSources.Any()) {
                dashboard.DataSources.Add(dataSource);
            }
        }

@expand
Copy link
Member

expand commented May 20, 2019

eXpand.lab release 19.1.301.1 includes commit Editing a dashboard a second time results in an exception #406 that relate to this task. Please test if it addresses the problem. If you use nuget add our LAB NugetServer as a nuget package source in VS.

Thanks a lot for your contribution.

@rSeeFip
Copy link

rSeeFip commented May 23, 2019

and with this restriciton, how it's possible to use multiple datasources with federal datasource in Dashboard ?

@apobekiaris
Copy link
Member

can u provide me an example of how do u want to use multiple datasources?

@rSeeFip
Copy link

rSeeFip commented May 23, 2019

  1. With 19.1 expand its necessary to selected type for Dashboard, i have many Dashboards where i use
    only SQLDatasource f.e. Access or different Databases.

  2. i have several Dashboards where i use more than one type, because they not associated

  3. I try Federal Datasource with one type and one SQLDatasource in Designer i get items on both
    connections in Designer, after saving and closing Designer i can't reopen beacuse i get error that
    already an "DashboardObjectDataSource"

With #363 and #406 i must select an type and can only select one type

@apobekiaris
Copy link
Member

With 19.1 expand its necessary to selected type for Dashboard, i have many Dashboards where

i will fix this problem

i have several Dashboards where i use more than one type, because they not associated

is this supported in the XAF native module?

@rSeeFip
Copy link

rSeeFip commented May 23, 2019

yes its supported, I've now created xaf 19.1 project with to BO's and it is possible to add both on one dashboard
image

@apobekiaris
Copy link
Member

hmm my apologies then i was under the wrong consumption, I will revert those changes asap.

@apobekiaris apobekiaris self-assigned this May 23, 2019
@rSeeFip
Copy link

rSeeFip commented May 23, 2019

thanks a lot

@apobekiaris apobekiaris removed their assignment May 27, 2019
@expand
Copy link
Member

expand commented May 27, 2019

eXpand.lab release 19.1.302.4 includes commit Revert "Dashboard: DisableMultiDashboardTypeController #406 #363" 0f1841fb1bbc4de50b06553f362e6bd58f0af31e.,Revert "XtraDashboard: DashoardName is not localized #406 #363" commit 8a13613a949b63657bf3345894bdfa76b6dae339.,[Revert "Force only one DashboardObjectDataSource #363" #406

This reverts commit f653e4d.](eXpandFramework/eXpand.lab@79253eb) that relate to this task. Please test if it addresses the problem. If you use nuget add our LAB NugetServer as a nuget package source in VS.

Thanks a lot for your contribution.

@expand expand modified the milestones: 19.1.301.0, 19.1.303.0 May 27, 2019
@rSeeFip
Copy link

rSeeFip commented May 28, 2019

With your fix it is still not possible to select multiple types and when trying to open an existing dashboard with multiple types in Editor the following error occurs "External DashboardName contains x dashboard tpyes. Only one dashboard is supported" out from
Xpand.ExpressApp.XtraDashboard.Win.Controllers.DashboardDesignerController

@apobekiaris
Copy link
Member

hmm at least on my side I can edit a dashboard select more types and they will show in the designer lookup

image

image

are you sure you are in the correct version cause these reverts are done from git, haven't changed anything

@rSeeFip
Copy link

rSeeFip commented May 28, 2019

Sorry, using wrong Version

Thanks for support

@expand
Copy link
Member

expand commented Jul 28, 2019

Closing issue for age. Feel free to reopen it at any time.

.Thank you for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants