Jump to content
Changes to the Jaspersoft community edition download ×

Reconstructing data from two fields


Recommended Posts


I am very much a newbie to JasperReports and iReport. I am evaluating whether we can use it as a reporting tool for our library automation system. I've installed iReport and played around with it, but I'm running into a problem that I can't get a handle on.

I am not a programmer, but I am willing to learn. Right now, I need to find out if JasperReports can handle this problem before investing huge amounts of time in setting up a JasperServer / iReport system to replace our current buggy but functional setup. I appreciate any help in this.

Some information in the database is stored in two fields. Punctuation, etc. is stripped out of the field and the text is stored in one field referred to as "processed", while the other data is stored in a second field called "reconst" (for reconstruction).

There is a reconstruct stored procedure in the database, but it returns the result as a variable. If I understand the documentation correctly, iReport / JasperReports cannot make direct use of that - the suggestion is to create a temporary table on the database server, and pull data from it. I would rather not do that for a variety of reasons, so I'm hoping there is another way.

I think there should be a way to do it as an expression, but my lack of programming skills is hampering my ability to do this.

Any replies on forum or directly to me msilver SHIFT-2 prl.ab.ca are welcome, including "You can't do this" and quotes for custom work. (I don't have a huge budget, but right now this looks like the biggest sticking point in going this route.)

Lengthy details:

The format of the reconst field is:


where the ascii character is actually only used for its numerical value, the action code determines what gets done, and the data is the character(s) to insert, etc.

The action codes are:

  • I - insert one character
  • M - insert many characters
  • R - replace one character
  • 2 - replace two characters
  • P - replace pair
  • E - delete one character
  • D - delete many characters
  • C - clobber
  • [/ul]

    Here are three example titles where the first field is the stripped data, second is reconst, and third is what the end result should look like. The double quotes surrounding the fields is not part of the data, but added for clarity.


    Another user has developed a Perl subroutine that handles titles. I can follow the logic to a certain extent, but some of it goes way beyond my understanding. The subroutine is called like so:


    The actual subroutine is

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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