Obsessed in OOP style design and programming. 6+ years experience in C#.net, ASP.net and VB6, SQL server, Crystal Reports This article is focused on creating chart reports using advanced layout option. Then build the web application and run, you will get a report with chart. Now write few lines to display report on the viewer. Note: when you double click on toolbox in the CrystalReportViewer, Visual studio will do all registeration and etc. Therefore, you need to register Crystal Report namespace on the top of the page as shown below. If we compile this application, it will give a compiler error “CR doesn’t exist”. Then place the CrystalReportViewer to the column as shown in the above HTLM tag. Let us see, how we can add the report viewer on the page, just look at these HTML tags.Ĭreate a table in the form object. Now you need to add Crystal Report viewer on the ASP.NET Webpage. But this is not the final report with actual data. You have followed all the essential steps and the result will be a bar chart. You can see here Titles for the report, by default. If you are not setting colors here, system will automatically assign some colors. Here you can select different color for different party. Once you select that and click ‘Format’ button you will see a screen as shown by following figure. Now go to the Axes tab and set the values as shown by following figure. Here you can see ‘Advanced’ is the selected layout in the left hand side. Then select ‘votes_obtained’ field as Show Value(s), shown by the following figure. Select ‘On change of’, ‘select destrict’ field and ‘political_party’ fields from available fields. Now, we have selected ‘Bar’ chart, vertical option and Select ‘Side by side bar chart with 3D visual effect’ from right hand side. If you unchecked ‘Automatically set chart options’ then you can see another two tabs will appear. You can select any type of chart from this list. Once you click that, system will give a screen like follow with many chart types. Then from the menu select Crystal Report => Insert=> Chart. Now, our focus is to represent these data graphically therefore you need to hide the ‘Details section’, by right click the ‘Details section’ and select ‘Surppress’. Your result report will be shown by below figure. Here we have selected all three fields from the table.Ĭlick ‘Finish’ Button. There you need to select fields from selected tables to design report as shown by the following figure. Here we have only one table therefore we have selected that table. Now, you can select the tables which you need to retrieve data to the report. Then you need to expand current connection tag, select your database connection then select the relevant table as shown by the following figure. System will provide a screen as below.Īfter that, you need to assign details of SQL Server and user credential to access the database from the report. Then click Next button, to continue report creation process. So you need to select SQL native client as provider (As above figure shows). This demonstration report is to work with SQL Server 2005 database. Once you click the OK button, system will give a window to select the connection type as shown below. Then you need to create the database connection to access tables within the database. Select ‘Using the Report Wizard’ option and keep the ‘Standard’ report format and click OK button. Once you click the Add button, you will get a window as shown by the following figure. When you select Crystal Report, give a meaningful name to the report. Then select ‘Crystal Report’ from the templates list window. Then right click the project in ‘Solution Explorer’ and select ‘Add New Item’ and select ‘Reporting’ from the categories. Here we are going to use Visual Studio.įirst open Visual studio 2008 or 2005 and create new web project called “ChartswithASP”. The first way is we can use the crystal report and second one is we can use the Visual studio. To design the report, there are two standard ways. Let us design a report using advanced layout in crystal report, get number of election results for political parties’ district wise. Note: The database design is for demonstration purposes only. There are three columns in Vote_Results table. The created database name is ‘ElectionResults’ with one table called ‘Vote_Results’. Here, we are going to produce a report which will represent election results graphically. SQL Server 2005, Visual studio 2005/2008, Crystal Report. Future articles will focus the other layouts. This article focuses on creating chart report using ‘Advanced layout’. Crystal Report provides four main general categories (layouts) of graphs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |