2011 m. gegužės 25 d., trečiadienis

How to Include eXpandFramework module into existing XAF application


This post describes how to add a feature from eXpandFramework into an existing XAF application.

1. Download the latest sources or binaries from here

Make sure that DevExpress engine that You're using matches with the one that eXpand was built on

2. In Case You've decided to download Source's - You'll need to build them first.

First make sure thet DX version matches (if not run the DX Project converter tool)

Then run buildall32bit.cmd or buildall64bit.cmd depending on Your system.

You'll find your build results  in Xpand.DLL folder

3. Add necessary references to Your project.

In this case : How to Add Excel import Wizard module to an Existing XAF application.
Add references, in Your main module, to:
  • Xpand.ExpressApp.dll
  • Xpand.ExpressApp.ImportWiz.dll
   Add reference, in Your Win module, to:
  • Xpand.ExpressApp.dll
  • Xpand.ExpressApp.Win.dll
  • Xpand.ExpressApp.ImportWiz.Win.dl

Add following code to Module.Designer.cs 
Add folowing code to WinModule.Designer.cs


4. Run the application and use the New Module :)

Here's a blog post with video on How it Works
and a sample Solution that You can Download

24 komentarai:

  1. there are no 'ImportWizModule' and 'ImportWizWinModule' in Xpand v. What code do we need to add to Module & WinModule.Designer?

  2. The modules have been renamed to "ImportWizardModule" and "ImportWizardWindowsFormsModule" accordingly

  3. OK. Now it's working. Thank You for Your hard work. However i have few questions:
    1. Is it possible to import excel 2003 sheet?
    2. Is it possible to omit some excel columns in mappings page, if they don't meet requirements of validation rule?
    For example if we have property with 'RuleRequiredField' attribute, and there is an empty column mapping to it.
    How can I disable for end user, columns with errors (in mapping screen)?

  4. Hi,

    1. speaking of Excel 2003, You'd need to upgrade the wizard implementing something like this http://exceldatareader.codeplex.com/
    At the moment only XLSX files are supported.
    2. There's no way of temporarily disabling validation rules that I know of.

  5. OK. Once again: Thank You for Your hard work

  6. Tendran un ejemplo en Visual basic .net

  7. compiled dll in wants DevExpress.ExpressApp.v11.1 ( reference and not 10.2.8; (just if you want keep your archive consistent)


  8. Hi,

    How can I restrict the action "Import from..." from showing up on every listview and detailview in my application?

  9. Frederik - sorry for not responding for so long. Just got back from a vacation.

    To restrict the import action from showing up - You'd need to implement some permission mechanism, That would set the "ImportAction.Active" property in the "ImportWizViewControllerBase" controller to False or True depending on the situation.

    I'll chat with Apostolis, and add some default mechanism (permission) for it in the next version.

    Hope that helps.


  10. Hi, WEB support?

  11. Hi ,

    see http://expandframework.com/
    there's a list of modules, and info on win/web support for each.


  12. HI.

    I follow the same way to create the project. but when i run the program. it prompt

    Exception occurs while initializing the 'Xpand.ExpressApp.SystemModule.XpandSystemModule' module: Please make sure XPand.Persistent.BaseImpl is referenced from your application project and has its Copy Local==true

    do you have any idea?

    I am no using expand template.
    or I must use expand vs template?

    Thank You

  13. Did You try reading the error message ?
    It says right there, to add a reference, and set copy local = true. Do that in both "Win" modules

  14. Yes. I added. but not work.
    Never mind. I try recreate the project and test again.

  15. Hi,

    I have two questions:
    1. What I need to do toimplement the Web Solution.
    2. What I need to do to import related object data or enums like Address and Gender from Contact.



    1. Hi.

      The Web - is NOT supported. Only winforms.
      Related objects - yes. You import the separately, as a table of contacts, and specify a contact key.

      This module is intended to import data from excel - not provide a full database import export.
      For that purpose - there's another Expand module : http://www.expandframework.com/#IO which is able to export/import the whole object "graph"

    2. Hi,

      thanks for your answer:

      I have the follow Problems:
      1. If I Guest the Mapping and Remove the field that i don‘t need i take the follow exeptions many times:
      Error processing record 1. System.FormatException: Unrecognized Guid format.
      at System.Guid.GuidResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument, String failureArgumentName, Exception innerException)
      at System.Guid.TryParseGuid(String g, GuidStyles flags, GuidResult& result)
      at System.Guid..ctor(String g)
      at Xpand.ExpressApp.ImportWizard.Win.Wizard.StringValueMapper.MapStringToValueType(XPMemberInfo prop, String value, NumberFormatInfo numberFormatInfo)
      at Xpand.ExpressApp.ImportWizard.Win.Wizard.StringValueMapper.MapValueToObjectProperty(XPObjectSpace objectSpace, XPMemberInfo prop, String value, IXPSimpleObject& newObj)
      at Xpand.ExpressApp.ImportWizard.Win.Wizard.ExcelImportWizard.ProcessSingleRow(XPObjectSpace objectSpace, DoWorkEventArgs e, Type type, String keyPropertyName, Row excelRow, List`1 props, Int32 i, String& message)

      It doesn‘t happen if I set the same Mapping manually.

      2. If I go back after „Import“ or „Import and Cancel“ I take de follow error message repeatedly:

      Cannot access a disposed object.
      Object Name: „Xpand.ExpressApp.ImportWizard.MappeableProperty (1155) Do you want to correct the value?

      Some Idea?

      Thanks in advance.

  16. Hi, in my application I find two errors:

    - Error 1: The type 'Xpand.Persistent.Base.General.XpandModuleBase' is defined in an assembly that is not referenced.You must add a reference to assembly 'Xpand.Persistent.Base, Version=, Culture=neutral, PublicKeyToken=c52ffed5d5ff0958'.

    - Error 2: Assembly 'Xpand.ExpressApp.ImportWizard.Win, Version=, Culture=neutral, PublicKeyToken=c52ffed5d5ff0958' uses 'DevExpress.ExpressApp.v14.1, Version=, Culture=neutral, PublicKeyToken=b88d1754d700e49a' which has a higher version than referenced assembly 'DevExpress.ExpressApp.v14.1, Version=, Culture=neutral, PublicKeyToken=b88d1754d700e49a'

    Can anyone help me?

  17. Hi
    First i m so grateful for your module importWizard, it is very helpful

    I like to report a bug about it, when i used importWizard module with the version 14.2.6 of devexpress, a problem shows whenever i use the new DataView mode for any listView!!

    I hope you provide a fix to that!

    thanks for the good work!

  18. Hello , i have a bug when i Release Devexpress Aplication have used eXpand Framework , it make the project Application Eror when push code to server . Can u help me fix this bug please, Tks u

  19. Tinklaraščio administratorius pašalino šį komentarą.