Reporting from an Object Collection One of the data types that the SetDataSource() method accepts is System.Collections.IEnumberable. This lets you print data that is stored within an object collection. For example, it’s easy to report from an ArrayList because it implements the IEnumerable interface. You can even create a custom collection class as a data […]
17.14 Binding to the Schema File
Build the Report Using the Dataset Schema File For a report to use a dataset as its data source, it needs to know how the data is structured. It uses the schema file to determine the structure.The previous section showed three different ways to create the dataset schema file. The way that you created the […]
17.13 ADO.NET Schema Files
Creating a Dataset File with ADO.NET Methods The last way to create a dataset file is to use the methods of the ADO.NET classes. The ADO.NET namespace is designed to make working with XML files almost effortless. It converts a dataset to and from its XML schema. Use the WriteXMLSchema() method to save the schema […]
17.12 Manual DataSets with the IDE
Creating a DataSet Manually with the IDE The previous method of building a dataset assumed that you have a table that can be dragged and dropped onto the designer. There are times you want to create a new table without having an existing data source. This could be a report based on user input or […]
17.11 DataSet Schema File
Define the Dataset Schema File When printing from any data source, Crystal Reports needs to know the tables and fields that it is printing from. When using a standard database, it can query the database to get this information. But when reporting from a dataset it doesn’t have this luxury. Instead, it uses a schema […]
17.10 DataSets, DataTables, DataView and XML
Reporting From the DataSet, DataTable, DataView and XML For purposes of simplifying this discussion, when referring to the any of the above data types, I’ll refer to them as only a dataset object. When there are any differences, I’ll make a note of it. There are three steps for reporting from a dataset. The first […]
17.09 The Push Model
Implementing the Push Model Reports can use either the Pull Model or the Push Model for retrieving data. The Pull Model links to a data source and retrieves the data automatically. The Push Model, discussed in the remainder of this chapter, is based upon generating reports from a manually populated data soThe data source can […]
17.08 Subreport Data Sources
Working with Subreports As mentioned earlier in the chapter, when you use the SetDatabaseLogin() method to pass security credentials to a report, it logs into the main report’s database as well as the database use by the subreports. Thus, you don’t have to do anything extra to open a report that also uses subreports. If […]
17.07 Set NoCount On
Set NoCount On Although this chapter assumes you are already familiar with stored procedures, there is one statement that doesn’t get much attention. I think it is very important to be aware of it. SET NOCOUNT ON The Set NoCount On statement prevents extraneous messages from being output by SQL Server. By default, SQL Server […]
17.06 Parameters and Stored Procedures
Parameters and Stored Procedures A common hurdle that developers have is figuring out how to print reports connected to stored procedures using parameters. It really isn’t hard once you understand how it works. Reports that use stored procedures as their data source are no different than reports that use any other data source. When you […]