0

I am in the process of deploying a set of Google Charts into SharePoint 2013. I am running into this issue where it isn't loading my data. I have tested it out in just a standard application page and it works perfectly. I will show my code below:

 <script type="text/javascript">
     //approver chart
     var chartDataApprover; // globarlvariable to hold chart data
     google.load("visualization", "1", { packages: ["corechart"] });

     $(document).ready(function () {

         $.ajax({
             url: "Chart_Application_Page.aspx/GetChartDataApprover",
             data: "",
             dataType: "json",
             type: "POST",
             contentType: "application/json; chartset=utf-8",
             success: function (data) {
                 chartDataApprover = data.d;
             },
             error: function () {
                 alert("Error loading data! Please try again.");
             }
         }).done(function () {
             //after data is loaded
             google.setOnLoadCallback(drawChartApprover);
             drawChartApprover();
         });
     });
</script>

     //approver function
     function drawChartApprover() {
         var data = google.visualization.arrayToDataTable(chartDataApprover);

         //groups chart data by name
         var resultApprover = google.visualization.data.group(data, [0], [{ 'column': 1, 'aggregation': google.visualization.data.sum, 'type': 'number' }]);

         var options = {
             title: "",
             pointSize: 5
         };
         var pieChartApprover = new google.visualization.PieChart(document.getElementById('chart_div_approver'));
         pieChartApprover.draw(resultApprover, options);
     }

I believe my error is coming on the line where I am setting the content type. I am deploying this into SharePoint 2013 via an Application Page... with code behind in C#.

Can anyone help me out with this issue?

Error:

"Message":"Could not load file or assembly \u0027EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\u0027 or one of its dependencies. The system cannot find the file specified.","StackTrace":"   at WebCharts.Layouts.WebCharts.Web_Chart_Page.GetChartDataApprover()","ExceptionType":"System.IO.FileNotFoundException"}
  • What is the error you are getting. You can check browser console for that. – Amal Hashim Nov 7 '14 at 16:26
  • have you tried using a web application relative url instead of the page url? it may be that the pagemethod needs to be accessed slightly differently? – Mauro Nov 7 '14 at 16:38
  • I just posted my error above... @AmalHashim – programmerGuy Nov 7 '14 at 16:41
  • What do you mean? @Mauro – programmerGuy Nov 7 '14 at 16:41
  • Install EntityFramework in the SharePoint farm – Amal Hashim Nov 7 '14 at 16:42
0

"Message":"Could not load file or assembly \u0027EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\u0027 or one of its dependencies. The system cannot find the file specified.",

To fix this error make sure

  1. Entity Framework is installed on the Farm
  2. Add following web configuration entries

    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    
    <connectionStrings>
        <!--Define Entity Connection String-->    
    </connectionStrings>
    
    <entityFramework>
       <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
       <providers>
            <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
        </providers>
     </entityFramework>
    
  • the way I get to my file is C: -> Program Files -> Common Files -> Microsoft Shared -> Web Server Extensions -> 15 -> Template -> Layouts. There is not a web.config file in there.... – programmerGuy Nov 7 '14 at 17:02
  • 1
    Post the complete URL of the page http://... – Amal Hashim Nov 7 '14 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.