Running report on JasperServer from C#

前端 未结 2 1143
旧巷少年郎
旧巷少年郎 2021-02-12 23:25

Jasper Reports is a superb open source alternative to Crystal Reports. It\'s great for single page PDF pages such as letters & invoices to multi-page reports. However it\'s

相关标签:
2条回答
  • 2021-02-12 23:45

    Jasper gives a Web Services API which you already have found, I suppose. For that being a Web Services using XML, it can be accessed through any language, like C# in this case, when you convert the service description (WSDL) to a service stub on that language.

    On that given link there can be found Jasper Reports wsdl file locations and after having access to them your task is to create the stub, which is a code level access to the given XML interface. For Mono this can be done with a simple command line command according to this tutorial and the rest of the work is to use this code how ever you want to use it.

    The exact command can be found through these two links with not much magic, but it is something as easy as one command running wsdl.exe with the given path (eg. http://localhost:8080/jasperserver/services/repository?wsdl) as argument and then compiling the result with a command similar to mcs /target:library SomeService.cs -r:System.Web.Services where you replace SomeService.cs with the name of the file that was the output of the previous command.

    That's it!

    0 讨论(0)
  • 2021-02-12 23:53

    I ran into the same problem not in mono but using Visual Studio. I always get error 500. That's because the answer of jasperserver according to the microsoft/mono code is not SOAP complient. ASP.NET expects a text/xml structure, and jasperserver sends a multipart structure back with the xml as the first part and the report as an attachment in the second part.

    ASP.NET gives an exception on that. I am now trying to do a similar thing using REST, but I've not succeeded so far.

    Addition: 2012-03-09 Figured out using REST, see Get report from jasperserver using REST webservice and asp.net C#

    By the way, that is also working in Mono! (I develop in Visual Studio, but deploy on Mono)

    0 讨论(0)
提交回复
热议问题