Jump to content
JasperReports Library 7.0 is now available ×

2005 IR Help

Recommended Posts

By: karthika - karthika

datasource

2004-07-07 23:05

i have a class file.There is method in it.it dealing some complicated calculation .I have to pass two parameter from report

(its a query based report)

it s possible

 

 

 

 

 

By: C-Box - c-box

RE: datasource

2004-07-08 00:50

Sounds like scriptlet usage....

 

with using scriptlet you can do any calculation with any field-, variablevalues of the report do different times (beforedetail, beforegroup, beforepage etc)

 

Just look at the scriptlet example how to use it.

 

hth

C-Box

 

 

 

 

By: karthika - karthika

RE: datasource

2004-07-08 02:28

My report look like this

detail band

----------------------

code name , date, amount

10 karthika 22/10/2004 (the double value from the class after passing the date and amount)

11 c-box 23/10/2004

 

-----------------

I want to pass date and code to my class

 

 

 

 

 

By: Chuck Deal - cdeal

RE: datasource

2004-07-08 05:36

Yes, it is possible.

 

If you make the class file available to the Report engine (put on the classpath). Then, you should be able to call the method (in this case static method) by using the fully qualified name:

 

com.name.app.MyClass.specialMethod($P{parm1}, $F{field1})

 

Now, you might have to work with that syntax a bit, but that should be possible.

 

If the method is not static, then you could create a Scriptlet that "wrapped" your functionality. The Scriplets method would get a handle to a MyClass object and call specialMethod(...) on it.

 

Either way should work.

 

 

 

 

By: karthika - karthika

RE: datasource

2004-07-08 06:03

can u give me an example program.it should help me

 

 

 

 

By: Chuck Deal - cdeal

RE: datasource

2004-07-08 07:21

Are you paying by that typed character? I find it very difficult to help if you don't give me more information. I gave you two options!

 

Here is how to use a static method:

 

<textField isStretchWithOverflow="true" isBlankWhenNull="true">

<reportElement positionType="Float" x="10" y="15" width="80" height="1">

</reportElement>

 

<textElement>

<font reportFont="TimesBold"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[com.name.app.MyClass.specialMethod('$F{code}', '$F{date}')]]></textFieldExpression>

</textField>

 

Let me know how that turns out. I have not tested it, but it looks like it should work. If it does not, be sure to include enough information for someone to help you. FULL Stacktrace, etc

 

 

 

 

By: karthika - karthika

RE: datasource

2004-07-08 07:40

Chuck

Thanks. I am troubling you again.In the Webapp

(the example shipped with jasperereport

).Actually its reads data from an array object .How can i convert this application to read data from database

thanks

karthika

 

 

 

 

 

By: karthika - karthika

RE: datasource

2004-07-10 02:59

Regarding scriptlet

 

My Method is not a static method .So how can i access this class by using scriptlet.And I want to display the Returned amount in detail band.I checked the scriptlet sample.

 

 

 

 

 

By: karthika - karthika

RE: datasource

2004-07-10 03:08

adding .........

what is beforeDetailEval()

afterDetailEval()

thanks

 

 

 

 

 

By: C-Box - c-box

RE: datasource

2004-07-10 05:54

Ohh Karthika... you are a quite complicated guy....

 

much more easier Teodor can't describe the methods...

The ScriptletMethod "beforeDetailEval" is a method within your scriptlet-class that is called each time before a new record causes a new entry for the detailband... so for each record that method is fired once....

 

and also the other one "afterDetailEval"....

 

perhaps you should stop posting EVERY simple question that could VERY EASY be found on JasperReports-Homepage, or with the SearchFunction of that board or perhaps just with:

 

SWITCH ON YOUR BRAIN!!!!!!!!!!!!!!!!

 

 

hth + think about, what Chuck and me told you in the other thread.... the web lives from giving AND taking not just taking/leeching!!!!!

C-Box

Link to comment
Share on other sites

  • Replies 0
  • 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...