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

how to call jasper reports from .NET platform?


adshocker

Recommended Posts

hi,

 

i'm using VB.Net express as my front end and is planning to use Jasper Reports. i have installed Jasper Server 3.0 and is using iReport 3.0 to create report templates (jrxml) then upload them on Jasper Server. i am able to run the report successfully in jasper server but i was wondering if anyone can help me run report from vb.net forms.

 

so far, i have added the wsdl of jasper server to my .net application but having problem with the runReport since it doesn.t have it. the URL for the wsdl i'm using is http://localhost:8080/jasperserver/services/repository?wsdl. then when adding this web service as a web reference is my .net application, i only get runReportCompletedEventArgs and runReportCompletedEventHandler.

 

are there any guides / documents/ articles that i can read about this?

 

thanks.

Link to comment
Share on other sites

  • Replies 13
  • Created
  • Last Reply

Top Posters In This Topic

i've somehow found a way to call the report but i am getting the error when doing so.

 

see my code below.

 

the error i'm getting is..

 

Client found response content type of 'multipart/related; type="text/xml"; start="<22108A0FFCC1846DF9E59A2F921274EC>";     boundary="----=_Part_4_25969376.1227076879703"', but expected 'text/xml'.
The request failed with the error message:
--

------=_Part_4_25969376.1227076879703
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: binary
Content-Id: <22108A0FFCC1846DF9E59A2F921274EC>

<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:runReportResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://axis2.ws.jasperserver.jaspersoft.com"><runReportReturn xsi:type="xsd:string"><?xml version="1.0" encoding="UTF-8"?>
<operationResult version="2.0.1">
    <returnCode><![CDATA[0]]></returnCode>
</operationResult>
</runReportReturn></ns1:runReportResponse></soapenv:Body></soapenv:Envelope>
------=_Part_4_25969376.1227076879703
Content-Type: application/pdf
Content-Transfer-Encoding: binary
Content-Id: <report>

%PDF-1.4
%????
5 0 obj <</Filter/FlateDecode/Length 726>>stream
x???Qo?0 ???+??IU? ;q?? .d
    ???M{?(eL?H[?j?~6)+ ?@?mB?  > ???0?????? 5 ?? '????2????w????i;???f4?
? ?O???? P ???d??P< ??t?97? ?*???? ???? %???d-9 >??    s???p ?????,?9???? kA??59???X???g? ?? ?I?O??p ?1    ???8??/????[?G??_/W??_???? ???k??!78??M???!????b]?!??z2OM|?d????&YqWd     ?t0,? ? $0??3???I/-? Q,TgX#]N
2J?4K? ; c?*G??$???U???P?;? aN???l ??#F? uh?? *? ??Q ?b  R ? !? P??7j???%???F???k?`R  O?
? i0`???c????? @/?p` J-??DG????R?`  ??p?1 ?e2???? ???? ????? {?f?8?]  ? rr   ???b-@?ko?? ?????   b?!????H?? ;??V  a??8  ??:4B?c0n?q??(??F ?????$T? ?F
? ?i ? ??? ?5 y iMp?!?e?` 2P"
la'????   #?  Ub??Kw ??b B?????t?! ?Pd T?qZ ??qw  *?H  ???? ?J0? ???[???.? ?@? ?R??[  ?& a? ?M????f<?k???? m  Y?? ]?S?? ???9 ?????m?C3c  ? ?? F??54? hM??
endstream
endobj
1 0 obj<</Type/Page/Contents 5 0 R/Parent 6 0 R/Resources<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]/Font<</F1 2 0 R/F3 4 0 R/F2 3 0 R>>>>/MediaBox[0 0 595 842]>>
endobj
7 0 obj[1 0 R/XYZ 0 854 0]
endobj
2 0 obj<</Type/Font/BaseFont/Helvetica/Subtype/Type1/Encoding/WinAnsiEncoding>>
endobj
3 0 obj<</Type/Font/BaseFont/Helvetica-Bold/Subtype/Type1/Encoding/WinAnsiEncoding>>
endobj
4 0 obj<</Type/Font/BaseFont/Helvetica-Oblique/Subtype/Type1/Encoding/WinAnsiEncoding>>
endobj
6 0 obj<</Count 1/Type/Pages/Kids[1 0 R]>>
endobj
8 0 obj<</Names[(JR_PAGE_ANCHOR_0_1) 7 0 R]>>
endobj
9 0 obj<</Dests 8 0 R>>
endobj
10 0 obj<</Type/Catalog/Pages 6 0 R/Names 9 0 R>>
endobj
11 0 obj<</CreationDate(D:20081119144119+08'00')/Producer(iText1.3.1 by lowagie.com (based on itext-paulo-154))/Creator(JasperReports (Employees))/ModDate(D:20081119144119+08'00')>>
endobj
xref
0 12
0000000000 65535 f
0000000808 00000 n
0000001016 00000 n
0000001103 00000 n
0000001195 00000 n
0000000015 00000 n
0000001290 00000 n
0000000982 00000 n
0000001340 00000 n
0000001393 00000 n
0000001424 00000 n
0000001481 00000 n
trailer
<</ID [<6e4a705411e2b3d417478962399f3e93><6e4a705411e2b3d417478962399f3e93>]/Root 10 0 R/Size 12/Info 11 0 R>>
startxref
1674
%%EOF

------=_Part_4_25969376.1227076879703--

--.

 

don't have a clue what it means. can someone help?

 

thanks

Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click  Dim n As New ManagementServiceService  Dim c As New System.Net.NetworkCredential("jasperadmin", "jasperadmin")  n.Credentials = c  n.runReport(TextBox1.Text)End SubTextBox1.Text has the ff:<?xml version="1.0" encoding="UTF-8"?><request operationName="runReport" locale="en"><argument name="RUN_OUTPUT_FORMAT">PDF</argument><resourceDescriptor name="" wsType="" uriString="/reports/EmployeesReport" isNew="false"><label>null</label></resourceDescriptor></request>
Link to comment
Share on other sites

You need to dig into how .NET deals with SOAP responses that include a multi-part response.

JasperServer returns the generated report as an attachment to the SOAP message.

You need to interpret this attachment and then display or save it as needed.

 

Sherman

Jaspersoft

Link to comment
Share on other sites

  • 4 weeks later...

hi,

 

thanks for the response... the link you gave me brings me to a page that shows this url: http://jasperforge.org/svn/repos/moonstone-.netwebservicesclient

 

when i try to go to that page, i enter my login credentials but then it takes me to a page:

 

The page you requested cannot be found:

 

• There may be a misspelling in the URL you entered.

• The page or file you are looking for has been moved or is no longer available.

 

can someone please verify if the link is still active.

 

thanks

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...

hi again, i've downloaded and used tortoisesvn but can't seem to check out the code. i get a server request error of some sort and the download doesn't push thru. can you suggest any working subversion tool that i can use to get the source? thanks



Post Edited by A.D. Shocker at 02/10/09 07:17
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...