run jasper report using rest request in C# asp.net -
i have been trying days jasper reports integrated .net website. have tried several ways including soap , rest service custom library suggested in post(http://freeze.ro/?q=node/7). know close new , still trying understand how works. people suggest using rest method , found example on here still getting error bad request. code rest request.
webclient httpclient = new webclient(); httpclient.credentials = new networkcredential("username", "password"); httpclient.headers.add("content-type", "application/x-www-form-urlencoded"); // build resourcedescriptor string requestxml; requestxml = "<resourcedescriptor name=\"invoice\" wstype=\"reportunit\" uristring=\"/reports/nosreports/invoice\""; requestxml += " isnew=\"false\">"; requestxml += " <parameter name=\"invoiceid\">1016242</parameter>n"; requestxml += "</resourcedescriptor>"; // send put, requestallresult contains above <report>... string requestallresult = httpclient.uploadstring("http://srv9:8080/jasperserver/rest/report/reports/nosreports/invoice?run_output_format=pdf", "put", requestxml); // extract uuid , file system.xml.xmldocument doc = new system.xml.xmldocument(); doc.loadxml(requestallresult); xmlnode node = doc.documentelement.selectsinglenode("uuid"); string uuid = node.innertext; //build url string reporturl = "http://srv9:8080/jasperserver/rest/resources/report/"; reporturl += uuid; reporturl += "?file=report"; // report string report; report = httpclient.downloadstring(reporturl);
any appreciated have read , read , ready give up, hate try , switch new reporting service @ point in project.
thank ovan have helped me. unfortunately have switched crystal reports no longer need this.
if has problem check link posted ovan.
Comments
Post a Comment