Custom Business Binding Source


Author
Message
Charles Thomas Blankenship...
Charles Thomas Blankenship
StrataFrame User (376 reputation)StrataFrame User (376 reputation)StrataFrame User (376 reputation)StrataFrame User (376 reputation)StrataFrame User (376 reputation)StrataFrame User (376 reputation)StrataFrame User (376 reputation)StrataFrame User (376 reputation)StrataFrame User (376 reputation)
Group: Awaiting Activation
Posts: 172, Visits: 12K
I've created a new Project for reporting ... created a custom business binding source ... as Ehdy recommended ... but after building the solution the only thing that shows up is the HolidaysBO ... not the HolidaysBBS ... the HolidaysBO cannot be dropped onto the DevExpressReport ... I assume only the HolidaysBBS can perform that function.

Any ideas to help straighten me out?

Thanks

Charles T. Blankenship
Senior Consultant
Novant Consulting, Inc.
704.975.7152
http://www.novantconsulting.com
Reply
Edhy Rijo
E
StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Charles,

My solution to your situation is to create a class in my Business project, I name my AppSettings.vb.  In this class I would create a Public Shared ReadOnly Property for the CompanyConfig BO, then I would use objects of this properties in my report directly instead of using a BBS, also I use those properties in many other parts of my applications when needed, here is quick sample of the AppSettings.vb class:

Imports InsuranceBrokerSystem.Business

Public Class AppSettings
    Private Sub New()
    End Sub

    '-- Set the Company Setting Object
    Public Shared ReadOnly Property CompanyConfig() As CompanyConfigBO
        Get
            Using bo As New bizCompany
                bo.FillAll()
                If bo.Count = 0 Then
                    bo.NewRow()
                    bo.Save()
                End If

                Return bo
            End Using
        End Get
    End Property
End Class


Then in your Master Report report PageHeader.BeforePrint you can do things like this with your own share property, be aware that in the sample code below, I already created some parameters in my Master report like "BusinessCompanyName":

Private Sub PageHeader_BeforePrint(sender As Object, e As Drawing.Printing.PrintEventArgs) Handles PageHeader.BeforePrint
        '-- Set the Internal Parameters values for the report header
        Dim ShowCompanyName As Boolean = True
        Dim sb As New System.Text.StringBuilder

        With Business.AppSettings.Company
            If ShowCompanyName = True Then
                Me.BusinessCompanyName.Value = .CompanyName
            End If

            If Not String.IsNullOrWhiteSpace(.Street) Then
                sb.AppendLine(.Street)
            End If

            sb.AppendFormat("{0} {1} {2}", .City, .State, .Zip)
            Me.BusinessCompanyAddress.Value = sb.ToString


            Dim sbPhoneLine As New System.Text.StringBuilder
            sbPhoneLine.AppendFormat("Phone: {0}  Fax: {1}", CleanFormatPhoneNumber(.Phone), CleanFormatPhoneNumber(.Fax))

            If Not String.IsNullOrWhiteSpace(.CompanyEmail) Then
                sbPhoneLine.Append(String.Format("   [{0}]", .CompanyEmail))
            End If

            If Not String.IsNullOrWhiteSpace(.CompanyWebSite) Then
                sbPhoneLine.Append(String.Format("   [{0}]", .CompanyWebSite))

                '-- Add the company url to the logo
                Me.xrCompanyLogoPictureBox.NavigateUrl = .CompanyWebSite
            End If

            Me.BusinessCompanyPhoneAndFax.Value = sbPhoneLine.ToString
        End With
    End Sub


Using this method, you can have your DevExpress Master Report with the Header showing the same info like company name and address as well as the report or transaction type, in my case here, a Customer Receipt and a Transactions Report shown in the attached images.

For you and others, be aware that reporting concepts can get deep and sometimes it is almost impossible to explain a concept without dedicating a lot of time to show and explain how a concept was used and sometimes there is not such free time to explaining all. I am sure it took you quite some time to come up with your "DXStrataflixExampleTutorial.docx" document and still things may not be completely clear for some users here.

I hope my concept explain here can help you enhance your classes, but there is much more in there that it is not possible to explain in a forum thread.

Enjoy and have fun with it!!!!



Edhy Rijo

Attachments
TransactionsReport.png (73 views, 165.00 KB)
CustomerReceipt.png (77 views, 158.00 KB)
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