BBS DataRelation <> Report Sharp Shooter


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
WOW...long post.  I will let Ivan respond.  Let me know if you have any other issues. Wink
Philipp Guntermann
Philipp Guntermann
StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)
Group: Forum Members
Posts: 141, Visits: 263
ok, i got it working now by building it from scratch again and comparing to your corrected code.

Not sure tho, if i fully understand the procedure. And since i'll have to explain that to someone in future, i'am trying to summarize:

1) Creation of a "ParentBO" and a "ChildBO". For convenience put in a Namespace called "BuisnessObjects".

2) Mapping of the BO's in the BOM.

3) Creation of a BuissnessBindingSource for each BO using the CustomBuisnessBindingSource, for convenience put in a Namespace called "ReportBinding" or something like that.

4) Creation of a BuisnessObject based upon ParentBO but with a different Name (for example: "ParentReportBO" using the CustomBuisnessBindingSource put in the "ReportBinding" Namespace.

5) Correcting the Name in "ParentReportBO", because the CustomBuisnessBindingSource created code by default puts the name of "ParentBO".

6) Changing of ParentBBS so it inherits from "ParentReportBO" instead of "ParentBO". Also adding

[System.ComponentModel.ToolboxItem(true)], so it appears within the toolbox.

7) Adding the Custom Property to expose "ChildBBS" to "ParentReportBO" and adding a 'Reflection Property" for "ChildBBS", for some reason (that i dont really get) of type "ParentReportBO" instead of "ChildBO".

8) Making sure "ChildBBS" is public.

9) Adding of the "ParentBBS" from the Toolbox to the form and using that as source for the ReportManager.


Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
You're welcome Philipp, great you got it working! Cool

Your steps sound good. Creating an XYZReportBO is just for convinience, so if you need to add properties or make any customization exclusive for the report's sake, you won't be messing with your original BO.

As for the Reflection Property Descriptor, you are adding a property descriptor to your parent BO, so that is why you will need to make it a typeof(YourCurrentParentBO).

You might be confusing it because the property in question is of the type of your ChildBO, but it could be an Integer, a Boolean or whatever, and when you added the custom descriptor, you would still add the descriptor as the type of YourCurrentParentBO.

If I mixed all up, I'm sure SuperMan will jump in and make things right. BigGrin

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Ivan George Borges (12/08/2008)
If I mixed all up, I'm sure SuperMan will jump in and make things right. BigGrin

Hummm, guess you meant SuperTrent Smile

Edhy Rijo

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hey, don't give up his secret identity!!! Smooooth
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
LOL....you guys need to tell my WIFE that BigGrin  When I am sitting on the couch watching football I don't get the same kudos w00t

Let me know if are still stuck, Phillip. Smile

Philipp Guntermann
Philipp Guntermann
StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)
Group: Forum Members
Posts: 141, Visits: 263
Sorry, but i need to warm up this topic again. Kinda saw it comming tho Smile

Since the structural part is now in place, i need to actually fill the BO's. From the StrataFlix Sample i got the impression that i need to use FillMultipleDataTables for this purpose.

In my application i have a list of double which are the primary keys of the ParentBO datasets.

So i could do something like this:

string SQLRechkopf, SQLRechpos;

SQLRechkopf = "SELECT * FROM Rechkopf WHERE 1=1";

foreach (double _ix in _indexes)

{

 SQLRechkopf += " AND (ID = " + _ix.ToString() + ")";

}

SQLRechpos = "SELECT * FROM Rechpositionen WHERE 1=1";

foreach (double _ix in _indexes)

{

 SQLRechpos += " AND (RechkopfID = " + _ix.ToString() + ")";

}

System.Data.Common.DbCommand dbc = new System.Data.SqlClient.SqlCommand();

dbc.CommandText = SQLRechkopf + ";" + SQLRechpos;

and then

MicroFour.StrataFrame.Business.BusinessLayer.FillMultipleDataTables(dbc,ParentBO,ChildBO);

i have no idea where to put this code tho (in the ParentReportBO, in the BuisnessObjects.ParentBO, in any of the BBS ???). Also putting ParentBO and ChildBO in FillMultipleDataTables doesnt seem to work either.

 


Philipp Guntermann
Philipp Guntermann
StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)StrataFrame User (231 reputation)
Group: Forum Members
Posts: 141, Visits: 263
got it working now Hehe

tho what i dont like is, that the child bo holds all records from all parentbo datasets. could become an issue when working with

alot of data. is there a possible approach to have the childbo only hold the records relative to the parent bo at any time ?

i am not sure wether report sharp shooter acutally communicates back to the bo, so that one could use the event when the current row changes to 'dynamically' fill the childbo with only the relevant data ?

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Philipp.

Glad you got it working.

is there a possible approach to have the childbo only hold the records relative to the parent bo at any time ?

Have you tried filling your child BO by the Parent pk, for example:

_CustomerNotes.SourceBO.FillByParentPrimaryKey(cust_pk)

instead of filtering by the current parent?

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Philipp Guntermann (12/15/2008)
is there a possible approach to have the childbo only hold the records relative to the parent bo at any time ?

Hi Philipp,

I handle that scenario by creating an SQL statement that will allow me to get the child records for the selected parent PK.  Here is one of my method for a Service Call Profile report:

''' <summary>

''' Retrieves all of the recods that will be used within the Service Call Profile Report (rptServiceCallProfile.rst)

''' </summary>

''' <param name="PK_ServiceCalls"></param>

''' <param name="includeServiceCallRecord"></param>

''' <returns></returns>

''' <remarks></remarks>

Public Shared Function ServiceCallProfileReport_AllData(ByVal PK_ServiceCalls As Integer, ByVal includeServiceCallRecord As Boolean) As SqlCommand

     '-- Establish Locals

     Dim cmd As New SqlCommand()

     '-- Determine if the Service Call record will be included

     If includeServiceCallRecord Then

          cmd.CommandText = "SELECT dbo.ServiceCalls.* FROM dbo.ServiceCalls WHERE dbo.ServiceCalls.PK_ServiceCalls = @PK_ServiceCalls;"

     End If

     '-- Add the Service Call Appliances query for the selected Service Call PK, ordered by the Appliance Service Date.

     cmd.CommandText &= "SELECT dbo.SC_Appliances.* " & _

                                    "FROM dbo.SC_Appliances " & _

                                    "LEFT JOIN dbo.ServiceCalls ON (dbo.ServiceCalls.PK_ServiceCalls = dbo.SC_Appliances.FK_ServiceCalls) " & _

                                    "WHERE (dbo.ServiceCalls.PK_ServiceCalls = @PK_ServiceCalls)" & _

                                    "ORDER BY dbo.SC_Appliances.ServicedDate;"

     '-- Add the Service Call Appliance items for the selected service all PK.

     cmd.CommandText &= "SELECT dbo.SC_AppliancesItems.* FROM dbo.SC_AppliancesItems " & _

                                    "LEFT JOIN dbo.SC_Appliances ON (dbo.SC_AppliancesItems.FK_SC_Appliances = dbo.SC_Appliances.PK_SC_Appliances) " & _

                                    "LEFT JOIN dbo.ServiceCalls ON (dbo.SC_Appliances.FK_ServiceCalls = dbo.ServiceCalls.PK_ServiceCalls) " & _

                                    "WHERE (dbo.ServiceCalls.PK_ServiceCalls = @PK_ServiceCalls)" & _

                                    "ORDER BY dbo.SC_AppliancesItems.ItemType, dbo.SC_AppliancesItems.ServicedDate;"

     '-- Create the parms

     cmd.Parameters.AddWithValue("@PK_ServiceCalls", PK_ServiceCalls).SqlDbType = SqlDbType.Int

     '-- Return the results

     Return cmd

End Function

Hope this help you out!

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search