iReport – Removing Pagination
I have been trying to save some old data off of a database, before the database server is decommissioned. I was hoping to save the data out in a .csv file, but the first problem that I ran into was that some of the columns that I wanted to keep contained carriage returns and newline characters. When the data was saved out to .csv, the carriage returns and newlines would appear as the end of a record, causing said records to break. Eventually, I was able to solve that issue.
Once issue was solved, I ran into a new one that took a while (way too long) to figure out. The problem was, when I would save out a .csv file, I was still getting some records that were broken. It appeared that there were STILL carriage returns and newlines within my records!
After a fair amount of research, I figured out that iReport itself was adding the offending characters when it was saving the data as a .csv. Basically, wherever it was adding a page break within the report on the screen, it was adding a carriage return and newline within the .csv file. Not very handy. Fortunately, it was an extremely easy problem to solve. All I needed to do, was set that particular report to not do pagination.
To disable pagination (page breaks) within iReport:
1> Right-click on the report that you want to remove page breaks from and click on “properties”.
2> Scroll down until you find “ignore pagination” and simply check the box.
3> Close the window and you should be ready to go.
What you end up with is one continuous list of records – just like you need for a .csv file. I used this, along with the previously mentioned replace() function and was able to save out 47.000 individual records fairly cleanly. Granted, I ran into 15-20 records that were still broken when I tried to import the .csv file into MySQL, but I would consider that a success!
Jeff Eske
3 Comments
RSS feed for comments on this post.
Sorry, the comment form is closed at this time.
[…] This solved part of my problem. Within my iReport report, the columns looked right and complete. At that point, I was ready to save everything out as a .csv file. That ended up being a minor problem also. […]
Thanks , this solved my problem !!!! .
I’m glad to hear that.
Jeff