Welcome to YLOAN.COM
yloan.com » Internet » Debugging BIRT Javascript
Games Personal-Tech Data Entry registry cruise torrent mac code virus storage uninstaller systems cisco bugs wireless codes maintenance dell update communication trojan atlanta Data Backup Data Storage Data Protection Data Recovery Anti-Virus Windows Linux Software Hardware Mobil-Computing Certification-Tests Computers & Internet Internet

Debugging BIRT Javascript

I was creating a report in order to answer a query that had been raised by a reader

of BIRT for Beginners where they needed to use the List Box parameter within a report. In order to do this with BIRT I needed to use some Javascript in the beforeOpen event of my data set and I had a problem with the creation of this script. So I needed to find a way to examine the values of variables while the script was running to see what I was dealing with and where my error was coming from.

There are ways to switch on logging from BIRT and dropping values out to a log file, which you can examine after an execution, but this is a little long winded for quickly creating and debugging snippets of Java code, so I wanted to find a faster, more immediate way to interrogate my script variables.

Looking around on the web I came across a method that involves running BIRT in the console mode, which means that you get all output from your script generated immediately to a console window.

This is great because it means that you can tweak your script and learn the results immediately, making debugging a quick and efficient process.


CONSOLE MODE

First we need to launch BIRT in Console mode, so we get to see our console window alongside the main BIRT IDE.

Do this by running eclipsec.exe, using a command line like this:

"C:BIRT 251eclipsec.exe"

Notice that this is different to the usual eclipse.exe with the addition of the letter "c", you will notice that BIRT runs in the normal way, but with a console available too.

THE BASIC REPORT

To demonstrate the use of the console window for output, create a simple listing report based on any data set that you choose. For my example I used the ClassicModels customer table and just listed out all customers.

ACCESSING THE SCRIPT AREA

Next I created a small piece of script in my report, which simply setup a for loop, to display a counter. There are various areas within a BIRT report where you can access the scripting area so for our example I am going to use the data set.

Select your data set and then click on the script tab at the bottom of the main layout window, ensure that beforeOpen is the selected script event.

GENERATING OUTPUT TO THE CONSOLE

Enter this script:

for(int i=1; i
Rolex Watches - Buying & Selling Rolex watches Through the Internet is not Difficult as you Think? Angel Ringtone | Download Akon Angel Ringtone Stutter Ringtone | Download Maroon 5 Stutter Ringtone Please Don't Go Ringtone | Download Mike Posner Please Don't Go Ringtone Get the Best Movies This Season with DISH Network Cursos Java Steps for converting PSD to HTML Let The Sun Shine Ringtone | Download Labrinth Let The Sun Shine Ringtone Get Outta My Way Ringtone | Download Kylie Minogue Get Outta My Way Ringtone Tokyo (Vampires & Wolves) Ringtone | Download The Wombats Tokyo (Vampires & Wolves) Ringtone In The Army Now Ringtone 2010 | Download Status Quo In The Army Now Ringtone Ill Behaviour Ringtone | Download Danny Byrd Ill Behaviour Ringtone Still a Weirdo Ringtone | Download KT Tunstall (Still a) Weirdo Ringtone
print
www.yloan.com guest:  register | login | search IP(216.73.216.146) California / Anaheim Processed in 0.016700 second(s), 7 queries , Gzip enabled , discuz 5.5 through PHP 8.3.9 , debug code: 32 , 2384, 49,
Debugging BIRT Javascript Anaheim