Page 301 - Open Soource Technologies 304.indd
P. 301

Unit 13: Working With Reports



                   5. Repeat these steps to add more TextBox and bound it to the DataMember and DataField
                      based on the field you select.
               Additionally we have created a button called CmdPrint to open newly created Data Report.
               Within the click event of this button put the code below:








                 Create a Data-Bound Report
                 You can create a data-bound report using the same drag-and-drop technique you used to
                 create data-bound forms. Simply create a Command object based on a table or query, then
                 drag it onto a blank report in the Data Report designer.
                 In this topic, we will create a report that displays orders for French customers in the
                 Northwind Traders sample database.
                 To create a data-bound report

                   1. Create a data environment Command object.
                   2. Open a Data Report designer.
                   3. Drag the Command object from the Data Environment designer to the Data Report
                      designer.

                   4. Set data properties for the report.
                 Questions
                   1. How to create Data environment Command object?

                   2. What is data Report Designer?

               13.10  Summary


                   • Data environment is a respository in our Visual InterDex.
                   • The activeX data object (ADO), which is the primary method in visual basic to access data
                      in any data sourch, both relational and non-relational.
                   • In visual basic we can create our own data source either as user controls or classes to
                      encapsulate bussiness rules or proprietary data structure.
                   • Data formatting objects allows to display data with custom formatting.
                   • The select * command is to select all the fields from the table in the database.

               13.11  Keywords


               ActiveX Data Objects (ADO):  An ADO is a set of Component Object Model (COM) objects for
               accessing data sources.




                                      LOVELY PROFESSIONAL UNIVERSITY                        295
   296   297   298   299   300   301   302   303   304   305   306