THE Definitive Guide for using DevExpress XtraReport with SF 1.7.6


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 always like to make sweeping claims like this as there is always someone (or somebodies) that know more than I do and can provide additional information that makes the tutorial even better. 
  • Dynamically configuring a report based upon an SQL Server table (ReportEngine)
  • Methodology for abstracting business objects (three layers are illustrated)
  • Class Diagrams for Business Layer, BOL and Report BO classes
  • Description of the Business Binding Source as it relates to Generics
  • Creating a simple Customer List
  • Filtering the contents of that Customer List by collecting information from the user
  • Adding custom properties to Report Business Objects
  • Illustrating how powerful the Report Engine table can be
  • How to subclass an XtraReport so that common processing can be consumed over every report in your application
  • Creating an Inherited Report
  • Create a Master-Detail using the data "Flattening" methodology
  • Create a Master-Detail report by using multiple Data Sources and Sub-reports
Here it is ... https://www.dropbox.com/s/1e82qqb7h96pfu6/DXStrataFlix.zip

DevExpress 13.2.7

Free, web based, UML Modeling tool (FREE)

Charles T. Blankenship
Senior Consultant
Novant Consulting, Inc.
704.975.7152
http://www.novantconsulting.com
Replies
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
You Are welcome Charles.

The only thing I have not been able to do with DevExpress Reports and SF is to preview the report in the VS IDE since I am using SF BBS, but have not had the time to look for a solution and the upcoming SF2.0 have a much better Business Object class that would be able to talk to any 3rd party tool like all DevExpress controls without the need to use the SF Business Binding Source and then I almost sure we will be able to preview the report while designing it.

Edhy Rijo

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,
Your DDT package DXStrataFlixDDT.pkg does not contain any metadata with your fixed data to test your reports. 

All tables are empty, specially your  ReportEngine.

Please provide a DDT package with the Deployment Data or include a copy of your MS-SQL Database in your DropBox so we can test it.

Edhy Rijo

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,

I have review your  code and have couple of suggestions:
  • When creating SqlCommand objects, try using the "using" command to speed up your code and allow the .Net garbage collection to dispose the object more efficiently.

        public void fillAll()
        {
            using (SqlCommand oSqlCmd = new SqlCommand())
            {
                oSqlCmd.CommandText = "SELECT * FROM Customers ORDER BY cust_LastName";
                FillDataTable(oSqlCmd);
            }
        }
  • When creating Sql CommandText, take advantage of the String.Format to build your SQL string and use Parameters instead of adding the value to the string, here is a sample of your CustomersBO.fillByLastName method:

        public void fillByLastName(string lastName)
        {
            using (SqlCommand oSqlCmd = new SqlCommand())
            {
                oSqlCmd.CommandText = String.Format("SELECT * FROM {0} WHERE UPPER(cust_LastName) LIKE '{1}'% ORDER BY cust_LastName", this.TableNameAndSchema, "@LastName");
                oSqlCmd.Parameters.AddWithValue("@LastName", lastName.ToUpper()).SqlDbType = SqlDbType.VarChar;
                FillDataTable(oSqlCmd);
            }
        }


Your project is pretty good organized, that is important, as well as your naming convention too.  In my case for SF Custom Field Properties I would prefix the property with "cfp_", so when using it in the field builders of DevExpress, I can clearly know this is a Custom Field Property:

        [Browsable(false),
        BusinessFieldDisplayInEditor,
        Description("Customer Last, First and Middle Name"),
        DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public string cfp_cust_LastFirstMiddle
        {
            get
            {
                return string.Format("{0}, {1} {2}", this.cust_LastName, this.cust_FirstName, this.cust_MiddleName);
            }
        }


Also, I would always use a Base Business Object class, to hold common methods and properties like the FillAll() method which it is mostly used by every BO.

Again, those are just suggestions, which means, there is nothing wrong with your original code.

Oh, I almost forgot, in your document to said:
"Alsoanother big thanks to Edhy for ignoring my request to help with regards to mycomplete and total ignorance of using this tool."

Not quite true based on the number of post I have here Hehe I probably missed a post due to a lot of work with my customers, fortunately since last November 2013 I have been pretty busy working on several project and not having too much time to share with my peers.

Now where is your version of the StrataFlix database so I can test your would project? BigGrin   Let's the fun begin.....w00t


Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Edhy Rijo - 10 Years Ago
Terry Bottorff - 10 Years Ago
Terry Bottorff - 10 Years Ago
Edhy Rijo - 10 Years Ago
Terry Bottorff - 10 Years Ago
Edhy Rijo - 10 Years Ago
Edhy Rijo - 10 Years Ago
Edhy Rijo - 10 Years Ago
Edhy Rijo - 10 Years Ago
Terry Bottorff - 10 Years Ago
Edhy Rijo - 10 Years Ago
                     Thanks Edhy, I will look into this over the weekend.
Terry Bottorff - 10 Years Ago
Terry Bottorff - 10 Years Ago
                         Hi Terry, Great, glad you were able to rename the BBS. This is a very...
Edhy Rijo - 10 Years Ago
                             Edhy, do you use Views for your reports or Custom Fields? I am not...
Terry Bottorff - 10 Years Ago
                                 Hi Terry, [quote][b]Terry Bottorff (3/1/2014)[/b][hr]Edhy, do you use...
Edhy Rijo - 10 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search