Jump to content

XML Datasource - "The document has no pages"


2005 IR Help

Recommended Posts

By: Sð²¥® Mogensen - soeren_mogensen

XML Datasource - "The document has no pages"

2005-01-05 05:00

Hi....

 

I'm trying to make my first report i iReport.

I'm using an XML Datasource, and I have created a singel field. But when I run my report (with my XML datasource connection) I get a "The document has no pages" error??? I hvae also tried to run my report using an empty datasource, and the result here is a report that has a 'null' field where I have put my field.

 

Does anybody have a solution to my problem? Am I doing anything wrong?

 

 

 

 

By: Wal Millard - walmillard

RE: XML Datasource - "The document has no pag

2005-01-05 17:00

 

The document has no pages most likely becuase your XML datasource selection expression doz not "select" any data items to output in the Field(s) objetcs available in your report.

 

Have you read my post here...

 

http://sourceforge.net/forum/message.php?msg_id=2838171

 

This is the XML Datasource example that is part of the jasperreports-0.6.ndemosamplesxmldatasource that ships within the jasperreport.zip file you downloaded. You should be able to get this working.

 

 

and here... This is the XML Address book example. from the website (http://ireport.sourceforge.net/cap7.html). This is a little more complex as it deals with xml tag attributes.

 

http://sourceforge.net/forum/message.php?msg_id=2841492

 

luck

walmillard

 

 

 

 

By: Sð²¥® Mogensen - soeren_mogensen

RE: XML Datasource - "The document has no pages"

2005-01-06 04:18

Hi again.....

 

I still can't get it to work.

My XML-document look like this (sorry but the tags are in danish):

 

<?xml version="1.0" encoding="UTF-8" ?>

<forsikringsoverisgt>

<husstand>

<adresse>Nyvangen</adresse>

</husstand>

</forsikringsoverisgt>

 

What I want to display on my report is the content of the 'adresse' tag.

 

My XML-datasource expression is:

/forsikringsoversigt/husstand

 

I have also made a field, that has the description '+adresse'. I have also tried whith an field description like /forsikringsoversigt/husstand+adresse, but that didn't work either.

 

I place my field in the detail-band on the report, and when i run the report, I get the "Document has no pages" error.

 

I can't see what I'm doing wrong.

I hope you guys can help me a little.

 

Bye

Sð²¥®

 

 

 

 

By: Wal Millard - walmillard

RE: XML Datasource - "The document has no pag

2005-01-09 15:18

Soren,

 

You are very close.

 

Try removing the + in the field description, to set the field description to

 

adresse

 

only. In xpath expressions the + is used to add xml tag values. = is the same as == in java, and != is not equal to.

 

Also you may like to try setting the Selection Expression to

 

/forsikringsoversigt/husstand[adresse=Nyvangen]

 

with your field description 'adresse' as above. This will ensure your data contains atleast one record.

 

/forsikringsoversigt/husstand[adresse!='']

 

This expression will return all adresse tag data where the value is not equal to null ('' are double single ').

 

if you set the expression to

 

/forsikringsoversigt/husstand

 

as you have it, and set the description correctly you should get a result.

 

You can read about xpath expressions and operators here (english)...

 

http://www.w3schools.com/xpath/xpath_expressions.asp

 

and examples here

 

http://www.w3schools.com/xpath/xpath_examples.asp

 

luck

walmillard

Link to comment
Share on other sites

  • 1 year later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I have a strange one. I used to be able to run a report (based on an xml source) from iReports. I kind of exported the whole environment to a different computer. After that (same environment as the first computer) the messagebox with "The document has no pages" popped up, and there is no difference in the way the datasource is set up (I think).
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...