StrataFrame Forum

A Couple of Questions from a New User

http://forum.strataframe.net/Topic3717.aspx

By fparker - 10/20/2006

Greetings,

My Company is just getting into StrataFrame and I have a couple of questions. 

First, according to other posts in this forum, if we want to present data to the user in an editable grid, we must use a grid component from DevExpress.  DevExpress offers a couple of different grid controls.  Which ones are supported?  Do we buy these controls directly from DevExpress? And is there a "Strataframe" version of the controls or do we just buy the standard versions? 

Secondly, many of our applications are meant to work with Microsoft's Great Plains ERP system.  Great Plains allows you to create "add ins" to provide custom functionality.  These must be implemented as .NET DLLs.  Is it possible to create DLLs that contain StrataFrame Maintenance forms?  If so, is there any documentation/sample code for this?

Thanks for your help.

Fran Parker

MaxQ Technologies, Inc.

By Trent L. Taylor - 10/20/2006

Which ones are supported?

Any grid is supported within StrataFrame.  We have a control called a BusinessBindingSource that allows any business object to be bound to any type of grid control. 

Do we buy these controls directly from DevExpress?

Yes.  You just purchase the controls directly from DevExpress.  To take advantage of all of the controls I recommend the DxExperience package. 

And is there a "Strataframe" version of the controls or do we just buy the standard versions? 

You just buy their standard version.  When you install StrataFrame (if you already have it installed you can just re-crate the toolbox tab) you will use the inherited controls which add functionality to DevExpress and has many of the unique StrataFrame controls that use the DevExpress editors.  So when you want to use a SImpleButton that supports StrataFrame data binding, you will drop our inherited SimpleButton on the form instead of the standard SimpleButton control.  But as far as DevExpress is concerned, you just purchase the controls direct from them.  The StrataFrame DevEx inherited controls use the XtraEditor, XtraBars, XtraGrid, and XtraUtils if you want to buy the individually.

Is it possible to create DLLs that contain StrataFrame Maintenance forms?

Sure.  You can create any .NET assembly, whether StrataFrame is in the formula or not, as a DLL that supports an add-in.  This is just a function of .NET...but you can definitely create DLLs with StrataFrame Maintenance Forms within it.  As for a sample, there isn't much to show.  All you need to do is go to the project properties and set the Application Type as a Class Library.

By fparker - 10/23/2006

Trent,

Thanks for the reply and the information about the BusinessBindingSource object.  Normally, our grid of choice is ComponetOne's True DB Grid and I was able to get this to work via the BusinessBindingSource object.  However, I am wondering whether or not we would get any extra "StrataFrame" functionality out of switching to the DevExpress grid or does that one also simply make use of the BusinessBindingSource object?  Also, I put a test business rule into my object's CheckRulesOnCurrentRow event expecting it to fire as I moved off a grid row.  Instead, I was able to enter invalid data into the grid without error until I attempted to save my changes.  I know that I could use the events that the grid provides to make calls into the business object to perform the validations but I want to verify that that is necessary and that I am not just missing something.

As far as my question about StrataFrame forms in DLLs is concerned, I should have provided more detail.  I know that I can simply change the output type on my project to get a DLL rather than an EXE but what I really need to do is compile an entire StrataFrame maintenance application into a DLL and then call it from a non-StrataFrame application.  As a test, I created an EXE that contained a StrataFrame business object and an associated maintenance form.  In EXE form, it was all working correctly.  I then changed the project's output type to class library and made the Main method of the Program class public and recompiled.  Next I created another Windows application and attempted to call the DLLs Main method.  This resulted in an error about starting a second message loop.  So I then commented out the StrataFrameApplication.RunApplication() line in the Main method and added code that created and displayed an instance of my maintenance form.  This resulted in a DataLayerException being thrown in my business object's data retrieval method (which just does a select top 100...).  This method is called from the ParentFormLoading event.  So, long story short, my question is, is it possible to create a StrataFrame application that is contained entirely within a DLL and that is callable from an application that has its own message loop? 

Thanks again for any help you can provide.

Fran Parker

MaxQ Technologies, Inc.

By StrataFrame Team - 10/27/2006

I implemented the IDataErrorInfo interface on the business object to get the broken rules to start showing up in the grids, however, I do not have ComponentOne's grid to test with.  In all truthfulness, you're not going to get any extra StrataFrame functionality by switching to another grid type... since we never inherit a grid, and we only implement the interfaces that a grid is expecting, then choosing one grid over another is left up to you and which one you personally like the best. 

I do know that after implementing the IDataErrorInfo interface, the error provider was showing up in the UltraGrid, but only after saving the business object, and not when you try to navigate off of a record with a broken rule.  When debugging the code, the rules are actualy checked, and the row is prevented from navigating, but the ICurrencyManager.Position cannot be interrupted (the grid still navigates off the row with the broken rule) and the grid does not repaint to show the broken rule.

So, you might have better luck with the ComponentOne grid with the new interface, but the Infragistics UltraGrid doesn't quite work exactly as expected when you try to keep someone from navigating off of the row they're on during a rules check.

By Trent L. Taylor - 10/27/2006

Fran,

It was not intentional and does not happen very often, but this post was accidentally overlooked.  When you do not hear from us within a 24 hour period (weekends excluded) then come back to the same topic and add another post asking if we have had a chance to look at this.  We receive an email which will get us back out here looking at this post.  Sorry for any trouble.

By fparker - 10/27/2006

Thanks very much for the grid information.  How about my question about building a StrataFrame maintenance application that is contained entirely within a DLL?  Is that something you guys have ever tried before?  Thanks for your help.

Fran Parker

MaxQ Technologies, Inc.

By Trent L. Taylor - 10/27/2006

How about my question about building a StrataFrame maintenance application that is contained entirely within a DLL?  Is that something you guys have ever tried before?

This is done every day and will work just fine. 

By fparker - 10/27/2006

This is done every day and will work just fine. 

That's great news!  I haven't been able to get it to work.  Here is what I tried:

As a test, I created an EXE that contained a StrataFrame business object and an associated maintenance form.  In EXE form, it was all working correctly.  I then changed the project's output type to class library and made the Main method of the Program class public and recompiled.  Next I created another Windows application and attempted to call the DLLs Main method.  This resulted in an error about starting a second message loop.  So I then commented out the StrataFrameApplication.RunApplication() line in the Main method and added code that created and displayed an instance of my maintenance form.  This resulted in a DataLayerException being thrown in my business object's data retrieval method (which just does a select top 100...). 

Do you have any advice (or an example) about to get the form contained in the DLL to open up?  Thanks for your help.

Fran Parker

MaxQ Technologies, Inc.

By Trent L. Taylor - 10/27/2006

If you are running through a DLL you still have to initialize the environment.  The problem you are having is because the SetDataSources method in Appmain is never called.  For example:

Option 1 - Replace the SetDataSources Method
ConnectionManager.ApplicationKey = "MyApplication"
ConnectionManager.ApplicationDefaultTitle = "MyApplication Connection"
ConnectionManager.ApplicationDefaultDescription = "This application connection is used by MyApplication"

'-- Set the required data source information so that the ConnectionManager can gather it
'      SQL Connection
ConnectionManager.AddRequiredDataSourceItem("", "SQL Connection", DataSourceTypeOptions.SqlServer, "MyDatabase", "This connection is used by MyApp.")
       
'-- Allow the database connection wizard to manage the connection
ConnectionManager.SetConnections()

Option 2 - Manually Specify the Connection Strings
MicroFour.StrataFrame.Data.Databasics.DataSources.Add(New SqlDataSourceItem("","MyConnectionString"))

If you are going to be using localization, you need to set this information up as well.  This is called in the InitApplication method of AppMain.vb or program.cs.  The last thing has to do with security.  You will need to look in this two methods mentioned in this post and pull out any security settings as well (only seen when the security templates were used to create an application).

Just out of curiosity....how are you planning on calling this DLL if not through an EXE?  You have to have an entry point someplace.  Are you using COM or something?

By fparker - 10/27/2006

Thanks for your help.  I'll give that a try.

Just out of curiosity....how are you planning on calling this DLL if not through an EXE?  You have to have an entry point someplace.  Are you using COM or something?

Much of our work revolves around Microsoft's Great Plains ERP system.  Great Plains allows developers to create "add-ins" to provide custom functionality.  These have to be implemented as .NET DLLs.  One of the Great Plain's EXEs (which is beyond our control) will call into the add-in DLL to tell it that the user wants it to perform its function.  We are hoping to build our add-ins using StrataFrame.

Thanks again.

Fran Parker

MaxQ Technologies, Inc.

By StrataFrame Team - 10/27/2006

The interface you use to implement the add-in should have a method called OnStart() or OnConnect(), or something to that effect... you'll want to find the method that Great Plains calls to initialize your add-in and put your code to set the data sources there.