Solved

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

Posted on 2011-09-13
4
368 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

There is a huge demand for CodeIgniter among the PHP web developers due to its dynamic features and benefits these days. It is one of most popular and agile open source PHP framework for creating robust web applications in PHP web development field.…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now