Crystal Reports Showing Graphical Representation of Data

Here in this example I will show data from a ResourceManagement Table design as below.

table design view
                                                         Image 1.

The following is the data in my table.

Data in my table
                                       Image 2.

Now open Visual Studio then select File -> New -> Web Site. Then select ASP.Net website then click OK.

Select ASP dotNet website
                                                                              Image 3.

Now right-click on the project in Solution Explorer then select Add New Item then select Crystal Report.

Select Crystal Report
                                                                              Image 4.

crystal report
                                                   Image 5.

Here click on Create New Connection then select OLE DB (ADO) then double-click here then a dialog window will open.

Popup window
                                                                              Image 6.

Select Microsoft OLE DB Provider for SQL Server here.

oledb provider
                                                                              Image 7.

Here provide your SQL Server information and select your DB.

connectin information
                                                               Image 8.

local identifier
                                                                  Image 9.

Now select your DB then select your Data Table and move it to the right side.

Data Table
                                                                              Image 10.

Now select your Data Column and click Finish.

Data Column
                                                                                 Image 11.

Now we will do some setting to show the data graphically. Right-click on Page Header and Details and click on Suppress to hide because we are showing here only a chart.

Not in Menu then select Crystal Reports -> Insert -> Chart.

Chart
                                                                           Image 12.

In the Type tab uncheck (de-seelct) Automatically set chart options. Now here select Bar.

Automatically set chart options
                                                                           Image 13.

Now click Data. Here select onChange.

Now select your fields to show in the chart.

show in chart
                                                                              Image 14.

Now Select Axes and make the following settings.

 Select Axes
                                                                             Image 15.

Now select Options and select format.

Options and select format
                                                                        Image 16.

resourceManagement
                                                                           Image 17.

Now set Text font and so on.

set Text font
                                                                        Image 18.

Now run application:

Run application
                                                                                 Image 19.

If your chart is not displaying then in the web.config make the following change.

  1. <httpHandlers>  
  2.    <add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />  
  3. </httpHandlers>  

 


Similar Articles