Solved

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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
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.…
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…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 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

23 Experts available now in Live!

Get 1:1 Help Now