Hei,

Sorry I I was not able to explain you. 
now here 
I have created a saperate project creted html file with google chart and 
used this url 

*
http://192.168.0.1:8081/InvoicePortalReportService.svc/client?client=Client01&fromDate=01.jan.2011&toDate=01.jan.2013&dateFormat=d<http://localhost:8081/InvoicePortalReportService.svc/client?client=Client01&fromDate=01.jan.2011&toDate=01.jan.2013&dateFormat=d>
*
*
*
*or *
*
*
*
http://localhost:8081/InvoicePortalReportService.svc/client?client=Client01&fromDate=01.jan.2011&toDate=01.jan.2013&dateFormat=d
*
*
*
I can not access the data. it shows notthing.

so I have created a html file in the same project where I am getting the 
data (webservice project)
with this url

*
InvoicePortalReportService.svc/client?client=Client01&fromDate=01.jan.2011&toDate=01.jan.2013&dateFormat=d<http://localhost:8081/InvoicePortalReportService.svc/client?client=Client01&fromDate=01.jan.2011&toDate=01.jan.2013&dateFormat=d>
*
*
*
now i can access the data and able to display it on .......

I hope you understand....

Thanks. 


On Thursday, March 7, 2013 7:02:15 PM UTC+1, asgallant wrote:
>
> What exactly is the problem you are seeing or error you are getting?  You 
> should be able to use JSONp (you have to set the AJAX dataType parameter to 
> "jsonp" instead of "json").
>
> On Thursday, March 7, 2013 3:17:24 AM UTC-5, Sikandar Hayat wrote:
>>
>> Hei,
>>
>> Is there any way I can access data from remote. I have used Jsonp
>>
>> *
>> http://192.168.0.1:8081/InvoicePortalReportService.svc/client?client=Client01&fromDate=01.jan.2011&toDate=01.jan.2013&dateFormat=d<http://localhost:8081/InvoicePortalReportService.svc/client?client=Client01&fromDate=01.jan.2011&toDate=01.jan.2013&dateFormat=d>
>> *
>>
>> any idea?
>>
>>
>>
>> On Thursday, March 7, 2013 9:15:29 AM UTC+1, Sikandar Hayat wrote:
>>>
>>> Hei,
>>>
>>> thanks you so much I have learned new thing. I have updated the code and 
>>> its working. the problem is it does not get from this link
>>>
>>> *
>>> http://localhost:8081/InvoicePortalReportService.svc/client?client=Client01&fromDate=01.jan.2011&toDate=01.jan.2013&dateFormat=d
>>> *
>>> *
>>> *
>>> but I have to use *
>>> /InvoicePortalReportService.svc/client?client=Client01&fromDate=01.jan.2011&toDate=01.jan.2013&dateFormat=d
>>> *
>>> *
>>> *
>>> I have created html file in the same project now i am able to get the 
>>> data. before I had saparate project which get data from localhost or ip 
>>> link.
>>>
>>> The code is 
>>>
>>>
>>>  // Load the Visualization API and the piechart package.
>>>         google.load("visualization", "1", { "packages": ["corechart"] });
>>>
>>>         // Set a callback to run when the Google Visualization API is 
>>> loaded.
>>>         google.setOnLoadCallback(drawChart);
>>>
>>>         function 
>>> drawChart(print,Client_Text,Client_value,fromdate,todate,format) {
>>>
>>>             var dataTable = new google.visualization.DataTable();
>>>
>>>             dataTable.addColumn("string", "ProcesssingTime");
>>>             dataTable.addColumn("number", "Sucess");
>>>             dataTable.addColumn("number", "Fail");
>>>
>>>             var serverurl = 
>>> "InvoicePortalReportService.svc/client?client=" + Client_value + 
>>> "&FromDate=" + fromdate + "&TODATE=" + todate + "&dateFormat=" + format;
>>>
>>>             if (Client_value == "All") {
>>>                 serverurl = 
>>> "InvoicePortalReportService.svc/all?FromDate=" + fromdate + "&TODATE=" + 
>>> todate + "&dateFormat=" + format;
>>>             }
>>>
>>>             var jsonData;
>>>             $.ajax({
>>>                 url: serverurl,
>>>                 dataType: "json",
>>>                 async: false,
>>>                 error: function (xhr, status, errorThrown) {
>>>                     console.log(status + ': ' + errorThrown);
>>>                 },
>>>                 success: function (data) {
>>>                     jsonData = data;
>>>                 }
>>>             });
>>>
>>>             dataTable.addRows(jsonData.length);
>>>            
>>>             var i = 0;
>>>             $.each(jsonData, function () {
>>>
>>>                 dataTable.setValue(i, 0, this.ProcesssingTime);
>>>                 dataTable.setValue(i, 1, this.Total_OK);
>>>                 dataTable.setValue(i, 2, this.Total_Fail);
>>>                 i++;
>>>             });
>>>
>>>             var dataView = new google.visualization.DataView(dataTable);
>>>             
>>>
>>>             var chart = new 
>>> google.visualization.LineChart(document.getElementById('chart_div1'));
>>>             var options = {
>>>                   width: 800
>>>                 , height: 540
>>>                 , pointSize: 2
>>>                 , 'title': 'Graph for Client (' + Client_Text + ')'
>>>                 , 'curveType':'function'
>>>                 , vAxis: { title: "Invoices Total" }
>>>                 , hAxis: { title: "Processing Time"  }
>>>
>>>             };
>>>             if (print == "show")
>>>             chart.draw(dataView, options);
>>>
>>>
>>>         }
>>>
>>>
>>> On Tuesday, March 5, 2013 5:56:24 PM UTC+1, asgallant wrote:
>>>>
>>>> Unless MS is doing something funny in the background, I don't think you 
>>>> should be getting a JScript error, since you are using C# and javascript 
>>>> (JScript is related to, but is not the same as, javascript).  In any 
>>>> event, 
>>>> there should be more information about which line, specifically, is 
>>>> throwing the error.
>>>>
>>>> On Tuesday, March 5, 2013 4:04:31 AM UTC-5, Sikandar Hayat wrote:
>>>>>
>>>>> Hei,
>>>>>
>>>>> Thanks for kind effort.
>>>>>
>>>>> it gives 
>>>>>
>>>>> Microsoft JScript runtime error: Not a valid 2D array. 
>>>>>
>>>>> and it not displaying anything.
>>>>>
>>>>>
>>>>> On Monday, March 4, 2013 6:32:56 PM UTC+1, asgallant wrote:
>>>>>>
>>>>>> I tested the code against the data sample you posted above.  There is 
>>>>>> an error in the "foreach" line, because "foreach" isn't a javascript 
>>>>>> function (*facepalm*), it should be:
>>>>>>
>>>>>> for (var x in json[0]) {
>>>>>>
>>>>>> Other than that, everything works fine for me.  When you try the 
>>>>>> code, what line is the error thrown on?
>>>>>>
>>>>>> On Monday, March 4, 2013 5:14:54 AM UTC-5, Sikandar Hayat wrote:
>>>>>>>
>>>>>>> Hei,
>>>>>>>
>>>>>>> In Google Chrome it shows
>>>>>>> Uncaught SyntaxError: Unexpected token { 
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Monday, March 4, 2013 11:04:49 AM UTC+1, Sikandar Hayat wrote:
>>>>>>>>
>>>>>>>> Hei,
>>>>>>>>
>>>>>>>> Thanks for the code but it is not showing any thing. it show page 
>>>>>>>> has error on     line Char some where at var temp = [];
>>>>>>>>
>>>>>>>> Here is the code 
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>  <script type="text/javascript">
>>>>>>>>         google.load('visualization', '1', { 'packages': 
>>>>>>>> ['corechart'] });
>>>>>>>>         google.setOnLoadCallback(drawChart);
>>>>>>>>        
>>>>>>>> function drawChart() {
>>>>>>>>     var json = $.ajax({
>>>>>>>>         url: "
>>>>>>>> http://localhost:8081/InvoicePortalReportService.svc/all?FromDate=20100101&TODATE=20131201&dateFormat=M
>>>>>>>> ",
>>>>>>>>         dataType: "json",
>>>>>>>>         async: false
>>>>>>>>     }).responseText;
>>>>>>>>     
>>>>>>>>
>>>>>>>>     var rows = [];
>>>>>>>>     var temp = [];
>>>>>>>>     
>>>>>>>>     foreach (x in json[0]) {
>>>>>>>>         temp.push(x);
>>>>>>>>     }
>>>>>>>>     rows.push(temp);
>>>>>>>>     
>>>>>>>>  
>>>>>>>>     for (var i = 0; i < json.length; i++) {
>>>>>>>>         rows.push([json[i][rows[0][0]], json[i][rows[0][1]], 
>>>>>>>> json[i][rows[0][2]]]);
>>>>>>>>     }
>>>>>>>>     
>>>>>>>>     var data = google.visualization.arrayToDataTable(rows);
>>>>>>>>
>>>>>>>>             var chart = new 
>>>>>>>> google.visualization.LineChart(document.getElementById('chart_div'));
>>>>>>>>             chart.draw(data, { width: 400, height: 240 });
>>>>>>>>         }
>>>>>>>>
>>>>>>>>     </script>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Monday, March 4, 2013 10:44:21 AM UTC+1, asgallant wrote:
>>>>>>>>>
>>>>>>>>> The easy way to parse is this:
>>>>>>>>>
>>>>>>>>> function drawChart() {
>>>>>>>>>     var json = $.ajax({
>>>>>>>>>         url: "
>>>>>>>>> http://localhost:8081/InvoicePortalReportService.svc/all?FromDate=20100101&TODATE=20131201&dateFormat=M
>>>>>>>>> ",
>>>>>>>>>         dataType: "json",
>>>>>>>>>         async: false,
>>>>>>>>>     }).responseText;
>>>>>>>>>     
>>>>>>>>>     var rows = [];
>>>>>>>>>     var temp = [];
>>>>>>>>>     foreach (var x in json[0]) {
>>>>>>>>>         temp.push(x);
>>>>>>>>>     }
>>>>>>>>>     rows.push(temp)
>>>>>>>>>     
>>>>>>>>>     for (var i = 0; i < json.length; i++) {
>>>>>>>>>         rows.push([json[i][rows[0][0]], json[i][rows[0][1]], 
>>>>>>>>> json[i][rows[0][2]]]);
>>>>>>>>>     }
>>>>>>>>>     
>>>>>>>>>     var data = google.visualization.arrayToDataTable(rows);
>>>>>>>>>
>>>>>>>>>     // Instantiate and draw our chart, passing in some options.
>>>>>>>>>     var chart = new 
>>>>>>>>> google.visualization.PieChart(document.getElementById('chart_div'));
>>>>>>>>>     chart.draw(data, {
>>>>>>>>>         width: 400,
>>>>>>>>>         height: 240
>>>>>>>>>     });
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> On Monday, March 4, 2013 3:55:34 AM UTC-5, Sikandar Hayat wrote:
>>>>>>>>>>
>>>>>>>>>> Hei,
>>>>>>>>>>
>>>>>>>>>> Thanks, How can I Parse for google chart. any idea?
>>>>>>>>>>
>>>>>>>>>> On Friday, March 1, 2013 4:03:53 PM UTC+1, asgallant wrote:
>>>>>>>>>>>
>>>>>>>>>>> The DataTable constructor expects input in a very specific 
>>>>>>>>>>> format<https://developers.google.com/chart/interactive/docs/reference#dataparam>,
>>>>>>>>>>>  
>>>>>>>>>>> which your JSON string does not adhere to.  You have two options to 
>>>>>>>>>>> fix 
>>>>>>>>>>> this; either change things on your server-side to put the data in 
>>>>>>>>>>> the 
>>>>>>>>>>> appropriate JSON format, or take the JSON as is and parse it into a 
>>>>>>>>>>> manually constructed DataTable.
>>>>>>>>>>>
>>>>>>>>>>> On Friday, March 1, 2013 7:40:58 AM UTC-5, Sikandar Hayat wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> *my c# webservice code is*
>>>>>>>>>>>> .........
>>>>>>>>>>>> using System.Data;
>>>>>>>>>>>>
>>>>>>>>>>>> namespace QuickWebservice.InvoicePortalServiceApplication
>>>>>>>>>>>> {
>>>>>>>>>>>>     // NOTE: You can use the "Rename" command on the "Refactor" 
>>>>>>>>>>>> menu to change the interface name "IInvoicePortalReportService" in 
>>>>>>>>>>>> both 
>>>>>>>>>>>> code and config file together.
>>>>>>>>>>>>     [ServiceContract]
>>>>>>>>>>>>     public interface IInvoicePortalReportService
>>>>>>>>>>>>     {
>>>>>>>>>>>>
>>>>>>>>>>>>         [WebGet(UriTemplate = 
>>>>>>>>>>>> "all?fromDate={fromDate}&toDate={toDate}&dateFormat={dateFormat}", 
>>>>>>>>>>>> ResponseFormat = WebMessageFormat.Json)]
>>>>>>>>>>>>         List<IpClientInvoicesProcessedTotal> 
>>>>>>>>>>>> GetAllInvoicesProcessStatusTotal(string FromDate, string ToDate, 
>>>>>>>>>>>> string 
>>>>>>>>>>>> dateFormat);
>>>>>>>>>>>>
>>>>>>>>>>>>         [WebGet(UriTemplate = 
>>>>>>>>>>>> "client?client={InvoiceProviderIdentifier_ClientId}&fromDate={fromDate}&toDate={toDate}&dateFormat={dateFormat}",
>>>>>>>>>>>>  
>>>>>>>>>>>> ResponseFormat = WebMessageFormat.Json)]
>>>>>>>>>>>>         List<IpClientInvoicesProcessedTotal> 
>>>>>>>>>>>> GetClientInvoicesProcessStatusTotal(string 
>>>>>>>>>>>> InvoiceProviderIdentifier_ClientId, string FromDate, string 
>>>>>>>>>>>> ToDate, string 
>>>>>>>>>>>> dateFormat);
>>>>>>>>>>>>
>>>>>>>>>>>> ..................... its a webservice that return data
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> *Url*: 
>>>>>>>>>>>> http://localhost:8081/InvoicePortalReportService.svc/all?FromDate=20100101&TODATE=20131201&dateFormat=M
>>>>>>>>>>>>
>>>>>>>>>>>> *Return data;*
>>>>>>>>>>>>
>>>>>>>>>>>> [{"ProcesssingTime":"jan.2011","Total_Fail":0,"Total_OK":1},{"ProcesssingTime":"feb.2011","Total_Fail":1,"Total_OK":0},{"ProcesssingTime":"jan.2012","Total_Fail":0,"Total_OK":1},{"ProcesssingTime":"feb.2012","Total_Fail":0,"Total_OK":1},{"ProcesssingTime":"mar.2012","Total_Fail":0,"Total_OK":1},{"ProcesssingTime":"apr.2012","Total_Fail":2,"Total_OK":0},{"ProcesssingTime":"jan.2013","Total_Fail":0,"Total_OK":5},{"ProcesssingTime":"feb.2013","Total_Fail":6,"Total_OK":32}]
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> *Google chart 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>
>>>>>>>>>>>>     <title></title>
>>>>>>>>>>>>     
>>>>>>>>>>>>    <script type="text/javascript" 
>>>>>>>>>>>> src="https://www.google.com/jsapi";></script>
>>>>>>>>>>>> <script type="text/javascript" 
>>>>>>>>>>>> src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js";></script>
>>>>>>>>>>>>  <script type="text/javascript" 
>>>>>>>>>>>> src="https://www.google.com/jsapi";></script>
>>>>>>>>>>>>     <script type="text/javascript" 
>>>>>>>>>>>> src="http://code.jquery.com/jquery-1.9.1.js";></script>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>     <script type="text/javascript">
>>>>>>>>>>>>
>>>>>>>>>>>>         // Load the Visualization API and the piechart package.
>>>>>>>>>>>>         google.load('visualization', '1', { 'packages': 
>>>>>>>>>>>> ['corechart'] });
>>>>>>>>>>>>
>>>>>>>>>>>>         // Set a callback to run when the Google Visualization API 
>>>>>>>>>>>> is loaded.
>>>>>>>>>>>>         google.setOnLoadCallback(drawChart);
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>         function drawChart() {
>>>>>>>>>>>>    
>>>>>>>>>>>>         var data = $.ajax({
>>>>>>>>>>>>                  url: 
>>>>>>>>>>>> "http://localhost:8081/InvoicePortalReportService.svc/all?FromDate=20100101&TODATE=20131201&dateFormat=M";,
>>>>>>>>>>>>                  dataType: "json",
>>>>>>>>>>>>                  async: false,
>>>>>>>>>>>>                  }).responseText;
>>>>>>>>>>>>         
>>>>>>>>>>>>             // Create our data table out of JSON data loaded from 
>>>>>>>>>>>> server.
>>>>>>>>>>>>             var data = new google.visualization.DataTable(data);
>>>>>>>>>>>>
>>>>>>>>>>>>             // Instantiate and draw our chart, passing in some 
>>>>>>>>>>>> options.
>>>>>>>>>>>>             var chart = new 
>>>>>>>>>>>> google.visualization.PieChart(document.getElementById('chart_div'));
>>>>>>>>>>>>             chart.draw(data, { width: 400, height: 240 });
>>>>>>>>>>>>         }
>>>>>>>>>>>>
>>>>>>>>>>>>     </script>
>>>>>>>>>>>>             
>>>>>>>>>>>> </head>
>>>>>>>>>>>> <body>
>>>>>>>>>>>>  <div id="chart_div"></div>
>>>>>>>>>>>> </body>
>>>>>>>>>>>> </html>
>>>>>>>>>>>>
>>>>>>>>>>>> *
>>>>>>>>>>>> *
>>>>>>>>>>>>
>>>>>>>>>>>> *
>>>>>>>>>>>> *
>>>>>>>>>>>>
>>>>>>>>>>>> *Getting Table has no columns*
>>>>>>>>>>>>
>>>>>>>>>>>> *
>>>>>>>>>>>> *
>>>>>>>>>>>>
>>>>>>>>>>>> *can you tell me why?*
>>>>>>>>>>>>
>>>>>>>>>>>> *
>>>>>>>>>>>> *
>>>>>>>>>>>>
>>>>>>>>>>>> *thanks.*
>>>>>>>>>>>>
>>>>>>>>>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to