Académique Documents
Professionnel Documents
Culture Documents
aspx
After some considerations, I decided to investigate the second option first. First option will be discussed in an entry later! To utilizes second option, first we need to create a data set. To add DataSet in VS.NET please perform following steps:
1. 2. 3. 4. 5.
In solution explorer, right-click on your project and select Add - New Item From Add New Item dialog box, select DataSet Once the DataSet is added, DataSet editor will be open. At this point we are ready to structure our data any way we want. We'll make it simple and add only single table; From the Toolbox, drag and drop DataTable object; Add necessary columns to DataTable object. For simplicity, we'll add only single column of type string;
At this point, our data structure is done. Following steps need to be performed to design necessary report:
1. 2. 3.
4.
In solution explorer, right-click on your project and select Add - New Item From Add New Item dialog select Crystal Report A report will be added and report wizard will start. At this point make sure that as data source following is selected: Project Data - ADO.NET DataSets - TestApp.DataSet1 DataTable1 Add Column1 to the list of fields to be displayed.
At this point we are ready to display the data using our newly created report. To do so, we have to populate the DataSet with some data. Following code explains the rest of necessary steps to display the data on the report:
CrystalReport1 Report = new CrystalReport1(); DataSet1 ds = new DataSet1(); DataSet1.DataTable1DataTable t = (DataSet1.DataTable1DataTable)ds.Tables[0]; t.AddDataTable1Row("Row t.AddDataTable1Row("Row t.AddDataTable1Row("Row t.AddDataTable1Row("Row t.AddDataTable1Row("Row 1"); 2"); 3"); 4"); 5");