Use SQL Datasource to populate Charts

8 posts, 1 answers
  1. Eric Klein
    Eric Klein avatar
    183 posts
    Member since:
    Aug 2009

    Posted 18 Dec 2012 Link to this post

    Ok I have looked through alot of the documentation and I just don't get it.  This should be easy.

    I have a sql query that is used in as the datasource for the report.  It displays the data in a a cross tab table.  I then want to take the percentages, some are in the query others are determined at run time of the report.  I want to create a bar chart that has the Categories across the bottom and the percentages as the y.

    I would also like to use the same data set to build a pie chart.  I can set the datasource to the chart but I can not see any way to set the x and y axis to the fields I want displayed
  2. jayanthi
    jayanthi avatar
    111 posts
    Member since:
    Jul 2010

    Posted 19 Dec 2012 Link to this post

    Add a series to Pie chart and then assign DataYCoulmn value.
  3. DevCraft banner
  4. Eric Klein
    Eric Klein avatar
    183 posts
    Member since:
    Aug 2009

    Posted 19 Dec 2012 Link to this post

    I have the crosstab located in groupheader and I have placed the chart in the Details.  I add the sqlDatasource as the chart datasource, I then open the series I add a series I go to the DataYColumn I click the dropdown arrow but there is nothing there.  How do I add the data fields to the columns?
  5. Massimiliano Bassili
    Massimiliano Bassili avatar
    323 posts
    Member since:
    May 2006

    Posted 19 Dec 2012 Link to this post

    Enter the column name manually, the chart series editor would not list them. If you check the Telerik examples, you would notice the same design behavior.
  6. Eric Klein
    Eric Klein avatar
    183 posts
    Member since:
    Aug 2009

    Posted 19 Dec 2012 Link to this post

    I have included the settings I have set in the attachment.

    WHen I run the app I get an error 
         An eorror has occured while processing Chart 'chart1':
        Cannot set Column 'FGID' to be null. Please use DBNull instead.

    I am unsure how it is getting the FGID.
  7. Eric Klein
    Eric Klein avatar
    183 posts
    Member since:
    Aug 2009

    Posted 19 Dec 2012 Link to this post

    Ok it looks like none of the fileds can have a null in, even if it is not used. 
  8. Answer
    Steve
    Admin
    Steve avatar
    10941 posts

    Posted 20 Dec 2012 Link to this post

    Hi Eric,

    This has been fixed in the Q3 2012 version, namely: Fixed: Chart cannot work with null, requires DBNull. Upgrade to resolve the issue.

    Regards,
    Steve
    the Telerik team

    HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

  9. Eric Klein
    Eric Klein avatar
    183 posts
    Member since:
    Aug 2009

    Posted 20 Dec 2012 Link to this post

    Thanks the update fixed the issue.
Back to Top
DevCraft banner