Solved

How do I use SQL and ASP.Net to dynamically create charts on a web page?

Posted on 2011-09-13
4
370 Views
Last Modified: 2012-05-12
Hi
I am investigating a web-based db driven system for a client who currently has everything stored in spreadsheets.  The currently use SQL Server 2005.  What do I need to enable them to dynamically create charts based on the data in the DB?  I've never used SSRS so I just need to be sure that this will satisfy their needs.  By what I've read it looks like there are components which will enable me to display the charts on ASP.Net web pages.  I have also come across OLAP Reporting Services 2008 but I don't know whether the client will be prepared to upgrade their version of SQL server.  Advice would be appreciated.
0
Comment
Question by:Lorna70
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
carsRST earned 150 total points
ID: 36528710
There's a ASP.NET chart control available for download from Microsoft.   Once you install it, it shows up in your toolbox as a control to select.  Easy to use, looks nice.

Download:
http://weblogs.asp.net/scottgu/archive/2008/11/24/new-asp-net-charting-control-lt-asp-chart-runat-quot-server-quot-gt.aspx

Code below is an example of its use
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:AM14ConnectionString %>" 
        SelectCommand="Select * from.... ">
</asp:SqlDataSource>


<asp:Chart ID="Chart1" runat="server" 
    BackColor="#EEFAFD"
    BackSecondaryColor="128, 128, 255" 
    BorderlineColor="White" 
    BorderlineDashStyle="Solid"
    BorderlineWidth="3" 
    DataSourceID="SqlDataSource1"
    
        Style="height: 350px; width: 400px;">
    <Titles>
        <asp:Title Name="Title1" 
            Text="Cars" 
            Font="Arial 12pt, style=Bold">
        </asp:Title>
    </Titles>
    <Series>
        <asp:Series Name="Series1"  
            XValueMember="Region" 
            YValueMembers="ACTUAL COUNT">
        </asp:Series>
    </Series>
    <ChartAreas>
        <asp:ChartArea Name="ChartArea1">
            <Area3DStyle Enable3D="True" />
            <AxisY Title="Dollars">
                <MinorGrid Enabled="True" />
                <LabelStyle Format="{0:C}" />
            </AxisY>
        </asp:ChartArea>
    </ChartAreas>
</asp:Chart>

Open in new window

0
 
LVL 16

Expert Comment

by:carsRST
ID: 36528717
Keep in mind, the control must also be installed on the server to use.
0
 
LVL 7

Expert Comment

by:Kishan Zunjare
ID: 36535051
You can go with Third party charts i.e. Fusion charts.
http://www.fusioncharts.com/free/

FusionCharts Free is a completely free and open-source Flash charting component. By using javascript, XML you can do this. I have very good experience with this for Rich UI(specially dynamic charts)

0
 
LVL 7

Assisted Solution

by:mr_nadger
mr_nadger earned 100 total points
ID: 36535491
Reporting services will do the charts easily, and giving them access to the report builder would allow them to build different charts on the fly; you could dynamically display all or some of the reports on your page afterwards through the reportviewer control.
If they're using Sharepoint, you can point web parts directly to the reports to make distribution even easier.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Error in SSIS while executing  - Potential data loss 4 23
SQL Error - Query 6 24
Better way to make a query with date filter. 5 23
asp.net mvc5 6 14
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Recently I spent hours debugging an issue in a Rails project where ActiveRecord was causing MySQL errors trying to create a User object of a class at the top level of a Single Table Inheritance model structure.  It turns out `.create` behaves differ…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

806 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question