Binding a control to a regular form property?


Author
Message
Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
Charles Hankey I noticed you were using iText for PDF's. Are you still using it? Do you program in C# or VB? If you use VB where did you find your examples or did you just convert the C# from their site? If you are still using it do you have forms where you fill fields from a database table?
Thank you for your time and effort. 
Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
You can build a sql select statement into the sqldataadapter rather than point it to a sproc and you'll get the same result, I believe. 

I am hosting the form that launches the report inside a SF app, so I think I can grab the connection from the application.  The connection string at design time is a different matter.

I'll keep posting as I work through this, but I'll probably post in User Contrib Samples for easy access.  I'm pretty convinced this is the way to go with SF apps.  I don't see any plus side to using SF business objects for reporting but am willing to listen to arguments in their favor.  Just don't see where the creating a propertyinside reporting bos for child stuff is near as fast as creating datasets from a sqldataadapter. 

Makes sense for CRUD of course, but for just grabbing data for reporting seems overbloated.
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
Hi Charles,

Thanks for posting the link to the video, very interesting.  I was wondering how to get the data to preview with SF BO, but guess is not possible for now.  I kind of like the SP approach, even though that will require an stored procedure for each report, but is either that or no having preview available.

Using the method explained in the video, you also need to grab the connection string at runtime to avoid having to hard code it.

Edhy Rijo

Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
I've been working a bit more with Xtrareports now, so i wanted to share some observations and this thread seems a good place to tack it on, as Peter was so helpful.

First, there is a 42 minute video of a DevExpress Webinar ( god I love that company ) that was very helpful for me getting two very basic things worked out : having preview data available at design time when the datasource is a parameterized sproc and how to hook up the params through the interface.


tv.devexpress.com/#XtraReportsWebinar1

Key concept is to drop a sqldataadapter on the Xtrareport design surface and use that to generate the dataset ( in my case off a sproc )

The sda lets you set default values for params which will be used at design time in preview mode.  A sqltableadapter won't.

(sqldataadapter is not in the toolbox by default so you have to right-click the data tab, pick Choose Items and add it )

The video explaiins everything else very clearly.  ( the part I messed with a bit was trying to drag and drop fields from the datasource treeview onto the report - I needed to find the Fieldlist on the Xtrareports menu and D and D from there.  That is also where you create calculated fields)  

One other comment re Peter's post - there is a third alternative to denormalized tables and subreports - detail bands.  As Peter is a long-time xtrareports user he probably started designing before DevExpress added child detail bands to the product.  They are now recommended over sub reports when the goal is just to have multiple child bands.

Old Foxpro developers will particularly appreciate how easy all this is, especially since we didn't get multiple detail bands out of the box until late ( too late ) in vfp 9

Anyway, my experience of DevExpress so far has been extremely positive and I love the XtraReports !!
Peter Jones
Peter Jones
Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Oops, all the indentation was lost in the post. It should have looked something like this:



Company...Employee...Order...OrderLineItem

C1..E1..O1..OL1

C1..E1..O1..OL2

C1..E1..O1..OL3

C1..E1..O2..OL1

C1..E2..O3..OL1

C1..E2..O4..OL1

C1..E2..O4..OL2

C2..E1..O5..OL1

C2..E1..O5..OL2





Company (GroupHeader1)

..Employee (GroupHeader2)

....Order (GroupHeader3)

......Order Line Items (Detail Band)

....Order (GroupFooter3)

..Employee (GroupFooter2)

Company (GroupFooter1)



Company (GroupHeader1)

..Employee (GroupHeader2)

....Order (GroupHeader3)

......Order Line Items (Detail Band)

....Order (GroupFooter3)

....Order Sub Report1

..Employee (GroupFooter2)

Company (GroupFooter1)

Peter Jones
Peter Jones
Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Oops, all the indentation was lost in the post. It should have looked something like this:



Company...Employee...Order...OrderLineItem

C1..E1..O1..OL1

C1..E1..O1..OL2

C1..E1..O1..OL3

C1..E1..O2..OL1

C1..E2..O3..OL1

C1..E2..O4..OL1

C1..E2..O4..OL2

C2..E1..O5..OL1

C2..E1..O5..OL2





Company (GroupHeader1)

..Employee (GroupHeader2)

....Order (GroupHeader3)

......Order Line Items (Detail Band)

....Order (GroupFooter3)

..Employee (GroupFooter2)

Company (GroupFooter1)



Company (GroupHeader1)

..Employee (GroupHeader2)

....Order (GroupHeader3)

......Order Line Items (Detail Band)

....Order (GroupFooter3)

....Order Sub Report1

..Employee (GroupFooter2)

Company (GroupFooter1)

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
Really awesome, Peter! w00t
Peter Jones
Peter Jones
Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi Charles,



In that simple example I would have a single, denormalised, view:



Company   Employee   Order   OrderLineItem

C1   E1   O1   OL1

C1   E1   O1   OL2

C1   E1   O1   OL3

C1   E1   O2   OL1

C1   E2   O3   OL1

C1   E2   O4   OL1

C1   E2   O4   OL2

C2   E1   O5   OL1

C2   E1   O5   OL2





The report group levels would be:



Company (GroupHeader1)

Employee (GroupHeader2)

Order (GroupHeader3)

Order Line Items (Detail Band)

Order (GroupFooter3)

Employee (GroupFooter2)

Company (GroupFooter1)



So, just a single BO based on a denormalised view



A more complex approach would to use SubReports, e.g. your Order may have a range of other attributes in addition to Order Line Items that you may want to show. In this case you may have:



Company (GroupHeader1)

Employee (GroupHeader2)

Order (GroupHeader3)

Order Line Items (Detail Band)

Order (GroupFooter3)

Order Sub Report1

Employee (GroupFooter2)

Company (GroupFooter1)



In this case Order Sub Report1 would have its own BO.



"I meant in creating a parent-child report or parent-child-child-grandchild etc rather than the denormalization of a view."

Denormalised view (see above)





"Do you use 4 BO s in this case to load your datasets?"

No. See above



"And assuming that there are parent child relationships defined in your BOs, does that get in the way or is it not a problem as long as the instance BOs do not have a parent BO set?"

No relationships. See above.



"My assumption was in the case above, no matter how I got the tables in the dataset filled, the relationships in order to create a parent child report would be set in the dataset, no?"

No. There is no need for any relationships to be defined. Just get the data into a flat file format and sort and group as needed within the report. For instance, you will see that Employee E1 took Orders for 2 different Companies therefore the same view could also be used to generate a report along the lines of:



Employee(GroupHeader1)

Company (GroupHeader2)

Order (GroupHeader3)

Order Line Items (Detail Band)

Order (GroupFooter3)

Company (GroupFooter2)

Employee (GroupFooter1)



All sorting and grouping is performed in the XtraReport.



I think the essential point is that Parent > Child > Grand Child relationships fall into place using the report Grouping hierarchy.



Cheers, Peter



Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Peter thanks so much.



I think I asked my question in-artfully ...



I meant in creating a parent-child report or parent-child-child-grandchild etc rather than the denormalization of a view. So for multiple companies, to show both their employees and their orders and the details of those orders :



Company ( detail band ) has two children - employees and orders

employees ( first child detail )

orders ( second child detail )

lineitems ( child detail of orders )

etc.



Do you use 4 BO s in this case to load your datasets? And assuming that there are parent child relationships defined in your BOs, does that get in the way or is it not a problem as long as the instance BOs do not have a parent BO set?



My assumption was in the case above, no matter how I got the tables in the dataset filled, the relationships in order to create a parent child report would be set in the dataset, no?







Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)Advanced StrataFrame User (770 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
Wow. Peter that is one Great Answer. Thank you. It will take me some time to digest all of that but that will certainly get me started. Thanks again for all of the time you put into helping others.
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