Jump to content
We've recently updated our Privacy Statement, available here ×

ashn

Members
  • Posts

    1
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by ashn

  1. Hi, I want to call the jasper report in ASP.NET web application. So I done the following implementation 1. Created Test Report (TestReport.jrxml file) in Jasper Report Studio. Currently report has no parameter. 2. Added report in Jasper Report Server. 3. Tested above report in Jasper Report Server. It loads the data properly. 4. Now, I want to call that report in Asp.net, so added following code public void DownloadReport() { WebClient httpclient = new WebClient(); //Authentication credentials httpclient.Credentials = new NetworkCredential("jasperadmin", "jasperadmin"); httpclient.Headers.Add("Content-Type", "application/x-www-form-urlecoded"); string requestXml; /*Report without parameter*/ requestXml = "<resourceDescriptor name="TestReport" wsType="reportUnit" uriString= "/jasperserver/rest/reports/TestReport""; requestXml += " isNew="false">"; requestXml += "</resourceDescriptor>"; string uploadReport = "http://localhost:8080/jasperserver/rest/reports/TestReport?RUN_OUTPUT_FORMAT=PDF"; //Sent PUT string requestAllResult = httpclient.UploadString(uploadReport, "PUT", requestXml); //Extract uuid, filename is always report System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.LoadXml(requestAllResult); XmlNode node = doc.DocumentElement.SelectSingleNode("uuid"); string uuid = node.InnerText; //Build GET Url string reportURL = "http://localhost:8080/jasperserver/rest/reports/"; reportURL += uuid; reportURL += "?file=report"; //Get Report string report; //Get Session Cookie string session = httpclient.ResponseHeaders.Get("Set-Cookie"); //Set Session Cookie httpclient.Headers.Add("Cookie", session); //Get Report report = httpclient.DownloadString(reportURL); } But after running code, 405 Method not allowed error is occurred at following line. string requestAllResult = httpclient.UploadString(uploadReport, "PUT", requestXml); Please refer below error message I also refer following link, but nothing is working for me. https://community.jaspersoft.com/questions/824432/using-rest-service-aspnet I am new to Jasper Report. So may be I am doing something wrong here. Please assist. Thanks
×
×
  • Create New...