0

I need to display jasperreport in my webApp, I'm using rest api to get report result (v2_rest) as HTML. I'm able to do this via IFRAME just pointing iframe src to rest URL.

I want to find a solution without iframe. I tried to get report result as dojo GET query:

dojo.xhrGet({
url: ...reportURL...,
handleAs:"text",
load: function(data) {},
error: function(error,params) {}
});

save it to javascript variable and use as <div> innerHTML. But I'm always getting RequestError: Unable to load ...reportURL... status: 0 as a GET response (error function is calling). THe URL is correct because the same works for iframe.

Also I tried to use the same URL as dojo ContentPane href. But I'm getting the same result as in case of GET query.

Can someone help me with this? Maybe I need to use some other solution.

Alex K
  • 22,315
  • 19
  • 108
  • 236
E_Gurin
  • 21
  • 6

1 Answers1

1

There some libraries to get reports programaticly. you can use them. they get report as file then you can open and read them as text. then you can append whereever you want

if you are using dotnet you can use DotNetJasper(this site have an sql exception rightnow but I found the solution here)
for java here an example
for php using Jasper reports in a PHP website


I know too many then :)

Community
  • 1
  • 1
Ismail Sahin
  • 2,640
  • 5
  • 31
  • 58