ashn Posted January 14, 2020 Share Posted January 14, 2020 Hi,I want to call the jasper report in ASP.NET web application.So I done the following implementation1. 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 codepublic 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-aspnetI am new to Jasper Report. So may be I am doing something wrong here.Please assist.Thanks Link to comment Share on other sites More sharing options...
ajju123 Posted August 13, 2020 Share Posted August 13, 2020 Is there any solution for this ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now