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

iReports unable to Execute (with active connection


mbonner

Recommended Posts

Hello,

I have created a very simple .jrxml file using a sample xml file I found at http://msdn.microsoft.com/en-us/library/ms762271(VS.85).aspx

I have been able to set my report query and drag and drop fields into my report.

I can Execute the file fine without using the active connection, but when I go to Execute it using the active connection a warning dialog saying

"The document contains no pages."

The Finished [book_report.rjxml] console area contains:

"
Setting com.jaspersoft.jrx.query.JRXPathQueryExecuterFactory as Query Executer Factory for language: xpath2
Compiling to file... ./book_report.jasper -> /Applications/iReport-2.0.5/bin/Untitled_report_1.java
Compilation running time: 713.
Filling report...
Locale: English (United States)
Time zone: Default
Report fill running time: 138. (pages generated: 0)
Viewing with JasperReports Viewer
Export running time: 6
"

no errors appear in the console window, just "The document contains no pages.", which is a java exception, right? If an exception is generated why is no error report in the the Finished [book_report.rjxml] console area? Is there anywhere else I can look at for more details about this error?

[file name=book_report.jrxml size=4532]

Link to comment
Share on other sites

  • Replies 16
  • Created
  • Last Reply

Top Posters In This Topic

So has anybody out there perhaps seen this message? Any suggestions on what it is? Where I should look for details concerning it? Is it a system problem or installation problem?

 

I googled it and saw that other people had encountered it, but it seemed to me in the case that I found that that person had the wrong encoding selected for their document, mine is correct (I think), although if that was the problem that would seem to be something you could check for and maybe produce an error specific to it.

 

Anyways, again, if anybody at all could help me I would be very very appreciative, I am totally stuck, iReport&JasperReports look like great tools and I really really would like to use them, I dont want to go back to laying out my reports w/ code, not fun at all.

Link to comment
Share on other sites

So has anybody out there perhaps seen this message? Any suggestions on what it is? Where I should look for details concerning it? Is it a system problem or installation problem?

 

I googled it and saw that other people had encountered it, but it seemed to me in the case that I found that that person had the wrong encoding selected for their document, mine is correct (I think), although if that was the problem that would seem to be something you could check for and maybe produce an error specific to it.

 

Anyways, again, if anybody at all could help me I would be very very appreciative, I am totally stuck, iReport&JasperReports look like great tools and I really really would like to use them, I dont want to go back to laying out my reports w/ code, not fun at all.

Link to comment
Share on other sites

Hi,

I'm struggling as little with Xpath...

That file worked for me as follows:-

Is your Xpath2 selection set to /catalog/book/*

All field description are child::text()
except
book id which should be ancestor::book/@id

See attached.

Regards

Denis


[file name=bookstore.jrxml size=4400]

Link to comment
Share on other sites

Thank you for your help, unfortunately that didnt solve my problems, bizarre, I am still getting 'The document has no pages' dialog. I modified my rjxml file and I used yours---same error. I think I will try installing on my old pc to see how things differ.

 

Thanks again

Link to comment
Share on other sites

I installed iReport on my pc, I am using the same xml file, w/ the same report query.

 

I have the same problem...

 

I can only think I have no idea how to use iReport w/ an xml file.. which I dont really, most everything I know how to do I learned here http://aspalliance.com/1229_Creating_and_Designing_Report_Using_iReport__Part_1

 

... so seriously, is all I do drag the fields from over on the left into the document on the right and hit execute? Seriously, thats really really too easy, I really want there to be something else out there I have to do (plus it may work) or im missing something very obvious in learning how to do this.

Link to comment
Share on other sites

> is all I do drag the fields from over on the left into the document on the right and hit execute?

 

When you say 'execute' , I assume you mean compile ?

You can compile with an EMPTY datasource, in which case it does not read the datasource, but normally will print the format with NULL , as a place holder for the data. You can also compile with the 'ACTIVE CONNECTION'. It will look at the connection defined in the list box in the toolbar ,and try to extract the data from it , based on the XPATH2 query you have defined in the query window which pops up after you select DATA REPORT QUERY. Are you selecting XPATH2? Are you entering a query in the query box ? ie. see image attached

 

Denis

Link to comment
Share on other sites

> is all I do drag the fields from over on the left into the document on the right and hit execute?

 

When you say 'execute' , I assume you mean compile ?

You can compile with an EMPTY datasource, in which case it does not read the datasource, but normally will print the format with NULL , as a place holder for the data. You can also compile with the 'ACTIVE CONNECTION'. It will look at the connection defined in the list box in the toolbar ,and try to extract the data from it , based on the XPATH2 query you have defined in the query window which pops up after you select DATA REPORT QUERY. Are you selecting XPATH2? Are you entering a query in the query box ? ie. see image attached

 

Denis

 

Post edited by: denis_mahony, at: 2008/05/13 18:58

Post edited by: denis_mahony, at: 2008/05/13 19:26

Link to comment
Share on other sites

I meant execute

The first three options in my 'Build' menu are:

Compile

Execute (empty data source)

Execute (with active connection)

 

Query language is set to xpath2

the query string is /catalog/book/*

Fields are appearing and I have dragged them into the Field area of the report query dialog

 

All I do then is from the main window, expand the fields tab on the left and drag a value or two into the detail section of my report.

 

I think hit compile

this is the only output from compilation:

 

Setting com.jaspersoft.jrx.query.JRXPathQueryExecuterFactory as Query Executer Factory for language: xpath2

Compiling to file... ./book_report.jasper -> /Applications/iReport-2.0.5/bin/Untitled_report_1.java

Compilation running time: 811

 

 

I then go to the build menu and execute with an empty data source, this is the output:

 

Filling report...

Locale: English (United States)

Time zone: Default

Using report virtualizer...JRFileVirtualizer Size: 100 Swap directory: .;

Report fill running time: 153. (pages generated: 1)

Viewing with JasperReports Viewer

Export running time: 105

 

I then go to execute with the active the active connection. The 'The document has no pages' warning dialog pops up. The only output is:

 

 

Setting com.jaspersoft.jrx.query.JRXPathQueryExecuterFactory as Query Executer Factory for language: xpath2

Compiling to file... ./book_report.jasper -> /Applications/iReport-2.0.5/bin/Untitled_report_1.java

Compilation running time: 89.

Filling report...

Locale: English (United States)

Time zone: Default

Using report virtualizer...JRFileVirtualizer Size: 100 Swap directory: .;

Report fill running time: 24. (pages generated: 0)

Viewing with JasperReports Viewer

Export running time: 6

Link to comment
Share on other sites

Yes I have seen that, but I didnt think it applied to me since I was not trying to use a watermark. Does japser/iReport use cfdocument? I didnt think I even had a "C:JRun4serversSERVERNAMEcfusion.earcfusion.warWEB-INFcfusionlib directory" directory
Link to comment
Share on other sites

Sorry :( . That was a bum steer.

 

There is a long thread about using Jasper/iReports with Rails at :

 

http://www.ruby-forum.com/topic/139453#new

 

Somewhere in there, is a reference to the error you are getting. It was suggested that it was caused by passing the wrong Xpath in the send doc () method.

It *must* match the Xpath2 query you used when creating the report.

Let's see your line of code that calls send_doc()

 

QUOTE:

....On Feb 8, 10:01 am, FlexRails <her...@intermatics.be> wrote:

 

> 1) In which banner have you put your static 'Hello world' text,

> because when I put it in the title banner, or in detail, and I try to

> run it from within iReport I get a message 'The document has no

> pages.' The compilation however succeeds. In that case of course there

> will be no output when you call the report from rails.

> If you really got a report preview in iReport but no output in rails

> you might look for a file called XmlJasperInterface.log somewhere in

> your rails application and see if you find some more information

> there. I had the same problem untill I copied the iReport lib files to

> my rails/app/jasper/lib directory. So you might double check if you

> have missed any of the lib files.

END QUOTE

 

Denis

Link to comment
Share on other sites

I had taken a look at that posting as well, the bit you copied would lead me to believe that if you get the 'The document has no pages.' error there was no way your jasper would work from your rails app...

 

so just to humour myself and to do something different I went off and finished the rails implementation according to http://wiki.rubyonrails.org/rails/pages/howtointegratejasperreports

 

At first it did not work, but then I went and took a look at the log file mentioned in what you pasted, took a look at it and found out I was not saving my .jasper file in the same directory as my .jrxml file. I went and changed that and all of a sudden I can produce reports w/ the info from my rails data source, but I still cannot generate the same report in iReport (ie I still get the no pages error)

 

So thats good enough for me, Im also noticing if I change that query string it wont work as mentioned in that discussion as well.

 

Thank you very much for responding, I really appreciate you working me thought this, unfortunately the original iReport problem has not been solved. I do believe its a java error, hopefully in the future it will be easier to tell what that error is w/ iReport.

Link to comment
Share on other sites

I'm pleased for you that you got a positive result.

I have not been able to solve my problem. While I've got it (rails)to work for simple reports, and produce PDFs, it is inconsistent, and fails when ever the record count changes to a count different from the node count in iReports at design time. A silly situation, i know.

My general perspective on trying to get rails to interface with iReport, at this time, is that it is too demanding on my time, and the results do not justify it.

Too many people seem to have failed to get it to work satisfactorily. A pity, since iReport is so brilliant.

 

I did succeed in designing integrated Master and Subreports- (your next hurdle), but I could never get them to work in Rails.

 

If you do get a report to work consistently with dynamic data from a URL source (Localhost). i would be interested.

 

At this point, I going to investigate Ruport and leave iReport aside for the present.

 

Good luck with your project :)

 

Denis

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...