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 
//
this.RequiredModuleTypes.Add(typeof(Xpand.ExpressApp.ImportWiz.ImportWizModule))
//
Add folowing code to WinModule.Designer.cs

//
this.RequiredModuleTypes.Add(typeof(ImportWizWinModule));
//


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.11.1.4.6. What code do we need to add to Module & WinModule.Designer?

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

    AtsakytiPanaikinti
  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)?

    AtsakytiPanaikinti
  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.

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

    AtsakytiPanaikinti
  6. Tendran un ejemplo en Visual basic .net

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

    Andrey

    AtsakytiPanaikinti
  8. Hi,

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

    AtsakytiPanaikinti
  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.

    Martin

    AtsakytiPanaikinti
  10. Hi, WEB support?
    Dorin

    AtsakytiPanaikinti
  11. Hi ,

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

    Martin

    AtsakytiPanaikinti
  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

    AtsakytiPanaikinti
  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

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

    AtsakytiPanaikinti
  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.

    Thanks.

    Angel

    AtsakytiPanaikinti
    Atsakymai
    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"

      Panaikinti
    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.

      Panaikinti
  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=14.1.6.9, Culture=neutral, PublicKeyToken=c52ffed5d5ff0958'.

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


    Can anyone help me?

    AtsakytiPanaikinti
  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!

    AtsakytiPanaikinti
  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

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

    AtsakytiPanaikinti