Hi Devexpress,
Although I see so many threads mentioned about this, I am also struggling into how to store a credential in Dashboard xml, using XAF
this is my implementation in Module.Win:
C#public class DashboardDesignerController : ObjectViewController<ObjectView, IDashboardData>
{
protected override void OnActivated()
{
base.OnActivated();
WinShowDashboardDesignerController showDashboardDesignerController = Frame.GetController<WinShowDashboardDesignerController>();
if (showDashboardDesignerController != null)
showDashboardDesignerController.DashboardDesignerManager.DashboardDesignerCreated += DashboardDesignerManager_DashboardDesignerCreated;
}
private void DashboardDesignerManager_DashboardDesignerCreated(object sender, DashboardDesignerShownEventArgs e)
{
//this part...
e.DashboardDesigner.DataSourceWizard.ShowConnectionsFromAppConfig = false;
e.DashboardDesigner.DataSourceWizard.SqlWizardSettings.DatabaseCredentialsSavingBehavior = DevExpress.DataAccess.Wizard.SensitiveInfoSavingBehavior.Always;
}
protected override void OnDeactivated()
{
WinShowDashboardDesignerController showDashboardDesignerController = Frame.GetController<WinShowDashboardDesignerController>();
if (showDashboardDesignerController != null)
showDashboardDesignerController.DashboardDesignerManager.DashboardDesignerCreated -= DashboardDesignerManager_DashboardDesignerCreated;
base.OnDeactivated();
}
}
But I get this after saved to the database:
SQLselect content from dashboarddata
XML<Connection Name="localhost_mydbname_Connection" FromAppConfig="true" />
I set the breakpoint at DashboardDesignerManager_DashboardDesignerCreated(), and it seems to be fired correctly during press new button.
and those properties are set correctly. However, the db content is not.
Please suggest what should be fixed.
Thanks
Hello,
I am passing this question to our Dashboards team for further research as it seems to be related to the Dashboard control's engine. Please await their answer.
As far as XAF is concerned, you can access the Dashboard control within an XAF application as described at How to: Access the Dashboard Control. Let me know if you experience any further difficulties with the XAF integration.
Thanks,
Andrey
Hello,
Thank you for your patience. We found the cause of this behavior and will discuss it further. We will update this thread once we have any news. For now, use the following DashboardDesignerManager descendant:
using DevExpress.ExpressApp; using DevExpress.Persistent.Base; using DevExpress.ExpressApp.Dashboards.Win; using DevExpress.DashboardCommon; namespace dxT742223.Module.Win.Controllers { public class DashboardDesignerManagerEx : DashboardDesignerManager { public DashboardDesignerManagerEx(XafApplication application) : base(application) { } protected override void ProcessDashboardBeforeSaving(Dashboard dashboard) { //base.ProcessDashboardBeforeSaving(dashboard); } } public class DashboardDesignerController : ObjectViewController<ObjectView, IDashboardData> { protected override void OnActivated() { base.OnActivated(); WinShowDashboardDesignerController showDashboardDesignerController = Frame.GetController<WinShowDashboardDesignerController>(); if(showDashboardDesignerController != null){ showDashboardDesignerController.DashboardDesignerManager = new DashboardDesignerManagerEx(Application); showDashboardDesignerController.DashboardDesignerManager.DashboardDesignerCreated += DashboardDesignerManager_DashboardDesignerCreated; } } private void DashboardDesignerManager_DashboardDesignerCreated(object sender, DashboardDesignerShownEventArgs e) { //this part... e.DashboardDesigner.DataSourceWizard.ShowConnectionsFromAppConfig = false; e.DashboardDesigner.DataSourceWizard.SqlWizardSettings.DatabaseCredentialsSavingBehavior = DevExpress.DataAccess.Wizard.SensitiveInfoSavingBehavior.Always; } protected override void OnDeactivated() { WinShowDashboardDesignerController showDashboardDesignerController = Frame.GetController<WinShowDashboardDesignerController>(); if(showDashboardDesignerController != null) showDashboardDesignerController.DashboardDesignerManager.DashboardDesignerCreated -= DashboardDesignerManager_DashboardDesignerCreated; base.OnDeactivated(); } } }
Thanks,
Andrey
Hi Andrey,
It is working as expected.
Should I use this as a permanent solution, or wait for any updates?
thanks
Hello,
Thank you for keeping us informed. You can use this temporary solution now. Once we have any updates, we will notify you here.
Andrey