Home » Archived » BIRT » Deployment and calculation examples
Deployment and calculation examples [message #11979] |
Tue, 01 March 2005 03:14  |
Eclipse User |
|
|
|
Originally posted by: sheldonli.hotmail.com
Hello:
I downloaded the M1 release. Thanks. It is great.
I have two questions:
1) Can someone answer how to deploy to the reporting engine after we
finish designing the report in the designer?
2) Is there any example to show how to do simple calculations like count,
sum, max, min for a column within a report?
Thanks
Sheldon
|
|
| |
Re: Deployment and calculation examples [message #12968 is a reply to message #12938] |
Thu, 03 March 2005 01:41   |
Eclipse User |
|
|
|
Originally posted by: sheldonli.hotmail.com
Hi Wenbin:
Thanks for your reply. What I am looking for is after I design a report
(something like the report definition), it can be deployed to a report
engine, which, at the request time via a viewer, will fetch the data and
generate the report in the formats of HTML or PDF, etc..
I am not sure I understand the BIRT architecture. Is the report engine
part of a J2EE which will fetch data and render the report? The designer is
just to define a report defnition.
I looked at the viewer directory, I don't see any html page. There are
some jsp. Are these JSP generated by the designer?
The second question: I am not sure Javascript can accomplish that task,
because JS is a client side code. Let's suppose I have 1000 rows, but a
HTML page only displays 100 rows. Now if I want to do sorting or sum within
a column, the JS code only is able to handle 100 rows on the client side
(maybe you can cache some extra), but certainly not all of them. So in my
humble opinion, sorting and calculation have to be done on the server side.
It involves a roundtrip.
Regards,
Sheldon
"Wenbin He" <whe@actuate.com> wrote in message
news:d06a70$lka$1@www.eclipse.org...
> Hi Sheldon:
>
> For the first question, BIRT report engine is already embedded in the
> report
> designer. When the "preview" tab is clicked, the report is deployed to the
> embedded web based report viewer which will invoke the report engine to
> execute the report. You can also preview the report through browser by
> clicking the toolbar "Preview in HTML" or "Preview in PDF" within BIRT
> designer.
>
> To integrate the BIRT report into your j2ee application, you can simply
> copy
> the report viewer (under org.eclipse.birt.report.viewer/viewer) and deploy
> it to any j2ee application server. Look into the web.xml inside viewer
> for
> deployment details.
>
> For the second question, you can simply drag a data element into your
> report. This operation will invoke the expression builder which allows you
> to build formulas to perform simple calculation as you mentioned. Actually
> the expression builder support full JavaScript syntax. You can create very
> complex script for the data expression field if needed.
>
> regard,
>
> Wenbin He
>
> BIRT ERD Lead
>
>
>
>
> "Sheldon Li" <sheldonli@hotmail.com> wrote in message
> news:d0189o$c93$1@www.eclipse.org...
>> Hello:
>> I downloaded the M1 release. Thanks. It is great.
>> I have two questions:
>> 1) Can someone answer how to deploy to the reporting engine after we
>> finish designing the report in the designer?
>> 2) Is there any example to show how to do simple calculations like
> count,
>> sum, max, min for a column within a report?
>>
>> Thanks
>>
>> Sheldon
>>
>>
>
>
|
|
|
Re: Deployment and calculation examples [message #13053 is a reply to message #12968] |
Thu, 03 March 2005 07:38   |
Eclipse User |
|
|
|
Originally posted by: sschafer.innoventsolutions.com
Hi Sheldon,
I believe this javascript IS executed on the server side.
I haven't tried this but I'm saying it here because I want to be
corrected if I'm wrong. For aggregation I think one would need to
accumulate into a variable like this: total += row["foobar"] perhaps
in one of the events of the control. Then in the summary area your
value expression would just be total. Fortunately, in javascript, the
variable total doesn't need to be declared. Presumably groupings could
be handled by zeroing total in one of the events of the table group.
Perhaps someone can provide specific examples?
Also, is this javascript documented anywhere?
Steve
Sheldon Li wrote:
> Hi Wenbin:
> Thanks for your reply. What I am looking for is after I design a report
> (something like the report definition), it can be deployed to a report
> engine, which, at the request time via a viewer, will fetch the data and
> generate the report in the formats of HTML or PDF, etc..
> I am not sure I understand the BIRT architecture. Is the report engine
> part of a J2EE which will fetch data and render the report? The designer is
> just to define a report defnition.
> I looked at the viewer directory, I don't see any html page. There are
> some jsp. Are these JSP generated by the designer?
>
> The second question: I am not sure Javascript can accomplish that task,
> because JS is a client side code. Let's suppose I have 1000 rows, but a
> HTML page only displays 100 rows. Now if I want to do sorting or sum within
> a column, the JS code only is able to handle 100 rows on the client side
> (maybe you can cache some extra), but certainly not all of them. So in my
> humble opinion, sorting and calculation have to be done on the server side.
> It involves a roundtrip.
>
> Regards,
>
> Sheldon
>
> "Wenbin He" <whe@actuate.com> wrote in message
> news:d06a70$lka$1@www.eclipse.org...
>
>>Hi Sheldon:
>>
>>For the first question, BIRT report engine is already embedded in the
>>report
>>designer. When the "preview" tab is clicked, the report is deployed to the
>>embedded web based report viewer which will invoke the report engine to
>>execute the report. You can also preview the report through browser by
>>clicking the toolbar "Preview in HTML" or "Preview in PDF" within BIRT
>>designer.
>>
>>To integrate the BIRT report into your j2ee application, you can simply
>>copy
>>the report viewer (under org.eclipse.birt.report.viewer/viewer) and deploy
>>it to any j2ee application server. Look into the web.xml inside viewer
>>for
>>deployment details.
>>
>>For the second question, you can simply drag a data element into your
>>report. This operation will invoke the expression builder which allows you
>>to build formulas to perform simple calculation as you mentioned. Actually
>>the expression builder support full JavaScript syntax. You can create very
>>complex script for the data expression field if needed.
>>
>>regard,
>>
>>Wenbin He
>>
>>BIRT ERD Lead
>>
>>
>>
>>
>>"Sheldon Li" <sheldonli@hotmail.com> wrote in message
>>news:d0189o$c93$1@www.eclipse.org...
>>
>>>Hello:
>>> I downloaded the M1 release. Thanks. It is great.
>>>I have two questions:
>>> 1) Can someone answer how to deploy to the reporting engine after we
>>>finish designing the report in the designer?
>>> 2) Is there any example to show how to do simple calculations like
>>
>>count,
>>
>>>sum, max, min for a column within a report?
>>>
>>>Thanks
>>>
>>>Sheldon
>>>
>>>
>>
>>
>
>
|
|
|
Re: Deployment and calculation examples [message #13285 is a reply to message #12968] |
Thu, 03 March 2005 16:36   |
Eclipse User |
|
|
|
Sheldon,
Sorry for the delay in responding; EclipseCon has been keeping me busy...
As Wenbin says, the BIRT engine is just a JAR file and can be deployed
anywhere you use Java classes. For preview, the engine is deployed to an
instance of Tomcat. You can also deploy it to your own app server.
Of course, that statement is a bit too general a statement for the use of
building an app. I've got an action item to add a material to the BIRT web
site to explain how to do this in more detail. I hope to have it up in the
next couple of weeks.
The JSP files you saw are part of the "example viewer" used to do preview
within Eclipse. You can use them as examples for how to create your own J2EE
app that submits & views reports. There is a simple architecture diagram in
the "Introduction" area.
Next, let's discuss expressions. BIRT uses the JavaScript language for
scripting. JavaScript is just a language. It is, of course, used in the
browser. But, it can also be used elsewhere, and we use it in the BIRT
engine. Hence, any JavaScript expressions you write will execute in the BIRT
engine and will not result in a round-trip to the server.
This means that you can express your calculation using JavaScript syntax,
and that code will execute within the BIRT engine. You've seen the
expression that the GUI creates when you drag & drop a column:
row["columnName"]
Equivalently,
row.columnName
You can do simple calculations using operators:
row.price * row.quantity
Aggregates (totals) use static methods on the Total object. That's a fancy
way of saying to add the term "Total." in front of the aggregate functions:
Total.sum( row.price * row.quantity )
There are many supported aggregates: sum, max, min, first, last, ave, etc.
The expression builder lists all these methods. They are also listed in the
ROM scripting spec (not the most accessible document, but it is a temporary
solution until better documentation becomes available.)
- Paul
Paul Rogers
BIRT PMC
"Sheldon Li" <sheldonli@hotmail.com> wrote in message
news:d06bit$qri$1@www.eclipse.org...
> Hi Wenbin:
> Thanks for your reply. What I am looking for is after I design a report
> (something like the report definition), it can be deployed to a report
> engine, which, at the request time via a viewer, will fetch the data and
> generate the report in the formats of HTML or PDF, etc..
> I am not sure I understand the BIRT architecture. Is the report engine
> part of a J2EE which will fetch data and render the report? The designer
> is just to define a report defnition.
> I looked at the viewer directory, I don't see any html page. There are
> some jsp. Are these JSP generated by the designer?
>
> The second question: I am not sure Javascript can accomplish that task,
> because JS is a client side code. Let's suppose I have 1000 rows, but a
> HTML page only displays 100 rows. Now if I want to do sorting or sum
> within a column, the JS code only is able to handle 100 rows on the client
> side (maybe you can cache some extra), but certainly not all of them. So
> in my humble opinion, sorting and calculation have to be done on the
> server side. It involves a roundtrip.
>
> Regards,
>
> Sheldon
>
> "Wenbin He" <whe@actuate.com> wrote in message
> news:d06a70$lka$1@www.eclipse.org...
>> Hi Sheldon:
>>
>> For the first question, BIRT report engine is already embedded in the
>> report
>> designer. When the "preview" tab is clicked, the report is deployed to
>> the
>> embedded web based report viewer which will invoke the report engine to
>> execute the report. You can also preview the report through browser by
>> clicking the toolbar "Preview in HTML" or "Preview in PDF" within BIRT
>> designer.
>>
>> To integrate the BIRT report into your j2ee application, you can simply
>> copy
>> the report viewer (under org.eclipse.birt.report.viewer/viewer) and
>> deploy
>> it to any j2ee application server. Look into the web.xml inside viewer
>> for
>> deployment details.
>>
>> For the second question, you can simply drag a data element into your
>> report. This operation will invoke the expression builder which allows
>> you
>> to build formulas to perform simple calculation as you mentioned.
>> Actually
>> the expression builder support full JavaScript syntax. You can create
>> very
>> complex script for the data expression field if needed.
>>
>> regard,
>>
>> Wenbin He
>>
>> BIRT ERD Lead
>>
>>
>>
>>
>> "Sheldon Li" <sheldonli@hotmail.com> wrote in message
>> news:d0189o$c93$1@www.eclipse.org...
>>> Hello:
>>> I downloaded the M1 release. Thanks. It is great.
>>> I have two questions:
>>> 1) Can someone answer how to deploy to the reporting engine after we
>>> finish designing the report in the designer?
>>> 2) Is there any example to show how to do simple calculations like
>> count,
>>> sum, max, min for a column within a report?
>>>
>>> Thanks
>>>
>>> Sheldon
>>>
>>>
>>
>>
>
>
|
|
|
Re: Deployment and calculation examples [message #13362 is a reply to message #13053] |
Thu, 03 March 2005 17:07  |
Eclipse User |
|
|
|
Steve,
Good meeting you at EclipseCon!
While roll-your-own aggregates will certainly work, it is more convenient
and efficient to use the build-in aggregates using the Total.func syntax:
Total.sum, Total.ave, etc. Doing aggregates this wall lets the BIRT Data
Transform Engine (DTE) do the work for you.
See the ROM Scripting Spec (available in reference area on the BIRT web
site: www.eclipse.org/birt/ref). It's not the most accessible document in
the world, but it has the info.
JavaScript itself is described in any good JavaScript book. I like
"JavaScript, the Definitive Guide" by Flanagan published by O'Reilly. Focus
on the first half of the book: JavaScript language, and ignore the second
part: browser scripting.
Thanks,
- Paul
Paul Rogers
BIRT PMC
"Steve Schafer" <sschafer@innoventsolutions.com> wrote in message
news:d070h3$umg$1@www.eclipse.org...
> Hi Sheldon,
>
> I believe this javascript IS executed on the server side.
>
> I haven't tried this but I'm saying it here because I want to be corrected
> if I'm wrong. For aggregation I think one would need to accumulate into a
> variable like this: total += row["foobar"] perhaps in one of the events
> of the control. Then in the summary area your value expression would just
> be total. Fortunately, in javascript, the variable total doesn't need to
> be declared. Presumably groupings could be handled by zeroing total in
> one of the events of the table group.
>
> Perhaps someone can provide specific examples?
>
> Also, is this javascript documented anywhere?
>
> Steve
|
|
|
Goto Forum:
Current Time: Wed Apr 16 07:56:53 EDT 2025
Powered by FUDForum. Page generated in 0.02939 seconds
|