Click here to Skip to main content
15,906,455 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi,

I am trying to use HTML5 infragistic report viewer. But I get this error in java script "Object doesn't support property or method 'igReportViewer'" at this line $("#viewer").igReportViewer
Kindly tell me how to fix this issue. following is my code


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        
        <script src="Scripts/modernizr.min.js" type="text/javascript"></script>  

        <link href="Styles/CSS/structure/jquery-ui-1.8.17.custom.css" rel="stylesheet" type="text/css"/>
       
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
        <script src="Scripts/jquery-ui.min.js" type="text/javascript"></script>
        <script src="Scripts/js/infragistics.loader.js" type="text/javascript"></script>


             <title>test</title>
    </head>

    <body>
        <!-- Report Viewer Loader -->
        <script type="text/javascript">
            var serviceEndpoint = "Services/ReportService.svc/ajaxAddress/";
            $.ig.loader({
                cssPath: 'Styles',
                scriptPath: 'Scripts',
                resources: 'igReportViewer',
                ready: function () {
                    
                    $(function () {
                        $("#viewer").igReportViewer({
                            renderSettings: {
                                definitionUri: "ReportLibrary;component/testReport.igr",
                                serviceEndpointUri: "Services/ReportService.svc/ajaxAddress/"
                            },
                            width: 720,
                            height: 520,
                            pageFit: 'fitToWidth'
                        });
                    });
                }
            });
        </script>
        <div id="viewer" >
        loading . . .
        </div>
    </body>
</html>
Posted
Updated 1-Jun-14 21:34pm
v4

Looks like an error message from the component (infragistic report viewer?).. You are probably better of checking the documentation.

What you can try is to add a console.log($("#viewer")) above the problematic line, and to look at the properties of that object. If it's not a problem within the component itself, you probably have forgotten to initialize it on that div#viewer, or you have to add some special class to it.

I hope that helps a bit.
 
Share this answer
 
Comments
Waqas Ahmad Abbasi 2-Jun-14 2:22am    
I have followed every step they have provided.
I checked properties of $("#viewer"). and didn't find any method with name igReportViewer.

http://www.infragistics.com/products/reporting/sample/viewers/html-viewer
Philip.F 2-Jun-14 3:15am    
Did you include the same version of JQuery (seems to be a difference when I look at your code)? Do you get some other javascript errors?
Waqas Ahmad Abbasi 2-Jun-14 3:36am    
yes it was different Jquery version, but i have updated with same jquery version now they are using but still getting same error. no other error is coming except this one.
Philip.F 2-Jun-14 3:58am    
Than probably sth with your scriptpath is messed up.. check for http request ending with a 404 or 5xx..
Waqas Ahmad Abbasi 2-Jun-14 4:26am    
checked path, no issue found in path
Problem was script path which i mentioned in default.html was ok, but these files have dependent scripts files and they were in different folder. checked in google chrome console and found problem files.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900