Iii CONTENTS Preface. How To Use This Report. Sapphire is one of the two gemvarieties of corundum, the other being ruby defined as corundum in a shade of red. Although blue is the bestknown sapphire color. The SAP Support Portal is SAPs primary customerfacing website, which provides access to support tools, services and applications, as well as related documentation. Crystal Reports in ASP. NETCrystal Reports in ASP. NETCrystal Reports is the standard reporting tool for Visual Studio. NET used. to display data of presentation quality. You can display multiple level totals, charts to analyze data, and much more in Crystal Reports. Creating a Crystal Report requires minimal coding since it is created in Designer interface. It is available as an integrated feature of Microsoft Visual Studio. NET, Borland Delphi, and CBuilder. Advantages of Crystal Reports. Some of the major advantages of using Crystal Reports are 1. Rapid report development since the designer interface would ease. Can extend it to complicated reports with interactive charts. Exposes a report object model, can interact with other controls on the ASP. NET Web form. 4. Can programmatically export the reports into widely used formats like. Implementation Models. Crystal Reports need database drivers to connect to the data source for accessing data. Crystal Reports in. Crystal Report To Pdf New Window' title='Crystal Report To Pdf New Window' />The Pull Method. When this model is used to access data from the data source. This model does not require the developer to write code for creating a connection and. It is the Crystal report that manages the SQL commands. The Push Method. When this model is used to access data from data source. The data from the data source is cached in dataset and multiple crystal reports accesses data from the dataset. Crystal Report To Pdf New Window' title='Crystal Report To Pdf New Window' />The performance can be optimized in this manner by using connection sharing and manually limiting the number. Crystal Reports Types. Crystal Report Designer can load reports that are included into the project as well. Strongly typed Report. When you add a report file into the project. In this case, you will have the advantage of directly creating an instance of the report object. The related. vb file, which is hidden, can be viewed using the editors show all files. Solution Explorer. Un Typed Report. Those reports that are not included into the project are un typed reports. In this case, you will have to create an instance of the Crystal Report Engines Report. Document object. Creating Crystal Reports. You can create a Crystal Report by using three methods 1. Manually i. e. from a blank document. Using Standard Report Expert. From an existing report. Using Pull Method. Creating Crystal Reports Manually. We would use the following steps to implement Crystal Reports using the Pull Model 1. Create the. rpt file from scratch and set the necessary database. Crystal Report Designer interface. Place a Crystal. Report. Viewer control from the toolbox on the. Call the databind method from your code behind page. I. Steps to create the report i. Add a new Crystal Report to the web form by right clicking on the. Solution Explorer, selecting Add Add New Item Crystal Report. On the Crystal Report Gallery pop up, select the As a Blank Report. This should open up the Report File in the Crystal Report Designer. Right click on the Details Section of the report. Database AddRemove Database. In the Database Expert pop up window. OLE DB ADO option by clicking the sign. OLE DB ADO pop up. In the OLE DB ADO pop up. Select Microsoft OLE DB Provider for SQL Server and click Next. Specify the connection information. Click Next and then click Finish9 Now you should be able to see the Database Expert. Expand the Pubs database. Tables, select the Stores table and click on. Selected Tables section. Note If you add more than one table in the database Expert. OK button after adding the tables. Links tab. You can remove the link by clicking the Clear Links button. Now the Field Explorer should show you the selected table. Database Fields section. Drag and drop the required fields into the Details. The field names would automatically appear in the. Page Header section of the report. If you want to modify the header text then right click on the text of the Page Header. Edit Text Object option and edit it. Save it and we are through. II. Creating a Crystal Report Viewer Control. Drag and drop the Crystal Report Viewer. Open the properties window for the Crystal Report Viewer control. Click on the. next to the Data Binding. Property and bring up the data binding pop up window. Select Report Source. Select the Custom Binding Expression radio button. You should be able to see the Crystal Report Viewer. Crystal Report Viewer controls and setting its properties. Note In the previous example. Crystal. Report. Viewer control was able to directly load the actual data during design time. In this case, it will not display the data during design time as it not saved with the data. Call the Databind method on the Page Load Event of the Code Behind file. Build and run your. The output would look like this. Using a PUSH model. Create a Dataset during design time. Create the. rpt file from scratch. Dataset that we created in the previous step. Place a Crystal. Report. Viewer control on the. In your code behind page. Call the Databind method from your code behind page. I. Creating a Dataset during Design Time to Define the Fields of the Reports. Right click on Solution Explorer, select Add. Add New Item Select Data. Set2 Drag and drop the Stores table. PUBS database from the SQL Server Item under Server Explorer. This should create a definition of the Stores. Dataset. The. xsd file created this way contains only the field definitions. It is up to the developer to create the connection to the database. Crystal Report. II. Creating the. rpt File. Create the report file using the steps mentioned previously. The only difference here is that instead of connecting to the Database thru Crystal Report. Table, we would be using our Data. Set that we just created. After creating the. Details section of the Report file. AddRemove Database6 In the Database Expert window. Project Data instead of OLE DB that was selected. PULL Model. expand ADO. NET Data. Set, Data. Sims 3 Level Up Collection Rar on this page. Set. 1. and select the Storestable. Include the Stores table into the Selected Tables. Click ok8 Follow the remaining steps to create the report layout. PULL Model to complete the. Report file creation. III. Creating a Crystal. Report. Viewer Control. Follow the steps mentioned previously in the PULL Model. Crystal Report Viewer control and set its properties. Code Behind Page Modifications. Call this subroutine in your page load event. Sub Bind. Report. Dim my. Connection As. New Sql. Client. Sql. Connection. my. Connection. Connection. String server localNet. SDK databasepubs TrustedConnectionyes. Dim My. Command As. New Sql. Client. Sql. Command. My. Command. Connection my. Connection. My. Command. Command. Text Select from Stores. My. Command. Command. Type Command. Type. Text. Dim My. DA As. New Sql. Client. Sql. Data. Adapter. My. DA. Select. Command My. Command. Dim my. DS As. New Dataset. 1. This is our Data. Set created at Design Time. My. DA. Fillmy. DS. Stores. You have to use the same name as that of your Dataset. Dim o. Rpt As. New Crystal. Report. 1        . This is the Crystal Report file created at Design Time. Rpt. Set. Data. Sourcemy. DS. Set the Set. Data. Source property of the Report to the. Dataset. Crystal. Report. Viewer. 1. Report. Source o. Rpt. Set the Crystal Report Viewers property to the o. Rpt. Report object that we created. End. Sub. Note In the above code. Rpt is an instance of the Strongly Typed Report file. If we were to use an Un. Typed Report then we would have to use a Report. Document object. and manually load the report file into it. Enhancing Crystal Reports. Accessing filtered data through Crystal reports. Perform the following steps for the same. Generate a dataset that contains data according to your selection criteria. Create the Crystal Report manually. It would look like this. Right Click Group Name fields in the field Explorer window. Group from the shortcut menu. Select the relevant field name from the first list box as shown. Understanding the Login Failed Error in Crystal Reports ASP Alliance. Thanksyou article helped me. Here is the simple implementationFirst Include these header file using Crystal. Decisions. Crystal. Reports. Engine using Crystal. Decisions. Shared In crystal viewer load event change logon Info otherwise it will not effectprivate void crystal. Report. Viewer. 1Loadobject sender, Event. Args ecrystal. Report. Viewer. 1. Selection. Formula invoicedesc. To. String Change Credentials Here. Database cr. Sub. DB Tables cr. Tables Connection. Info c. Info new Connection. Info c. Info. Server. Name SERVER c. Info. User. ID username c. Info. Password password c. Info. Database. Name databasename Invoice. Report IR new Invoice. Report cr. Sub. DB IR. Database cr. Tables cr. Sub. DB. Tables foreach Table cr. Table in cr. TablesTable. Log. On. Info cr. Table. Log. On. Info cr. Table. Log. On. Info cr. Table. Log. On. Info. Connection. Info c. Info cr. Table. Apply. Log. On. Infocr. Table. Log. On. Info crystal. Report. Viewer. 1. Report. Source IR.