Showing posts with label reporting. Show all posts
Showing posts with label reporting. Show all posts

Sunday, January 23, 2011

Recovering a Report Server when you have SQL Server rights

Simply change the executing service account of your report server. Make sure that account has full access to sql server. Afterwards login with that account and access your Report Manager URL. Simple isn't it?

You might need to restart the machine for it to work though :)

Sunday, May 24, 2009

BIRT Report Scheduler

I am considering writing a BIRT report scheduler for a recent project.

I already have a working system in place using what I learnt from the following:
http://digiassn.blogspot.com/2005/10/birt-report-server-pt-2.html

It works pretty neat. I did need to make a couple of modifications to make it work on solaris (needless to say). First wget is not in system path therefore I needed to do the following :

WGET="/usr/sfw/bin/wget"

And later on:

$WGET "$RUNURL=RegionDailyPeak.rptdesign&__format=doc&Region=Central" -O "$EXPORTDIR/CentralDailyPeak.doc" -q

I also hid the server birt viewer url into a variable as :
RUNURL="http:///ReportXViewer/run?__report"

and EXPORTDIR as the path where I want the download.

Also I wrote some code to send emails as well and used that as a script. Additionally I needed to used the zip command to zip large reports before mailing them :

e.g.:
zip $EXPORTDIR/TCHGPRSTraffic.zip $EXPORTDIR/TCHGPRSTraffic.xls

and then mailed the zip file. Its working fine . Any parameters needing any form of dynamic nature were put into the report using a method I posted previously.


I am thinking of encapsulating all these cool things into a web server application using flex?

Anyone interested in such an application?

The following is a list of the features:

  • A simple admin login screen
It is intended to be a single user application. One admin password
  • Server Settings
Lists:
  1. adminusername / adminpassword.
  2. BIRT report viewer url (the run url... to which only report and further parameters will be passed as shown above)
  3. The report folder url.
  4. Notification email address
  5. mailer settings:
servername, Username, password, from , port, ssl

  • A simple report schedules list screen.:
This will have a list of schedules setup into a data grid with two columns. Crontab scheduling string, and a schedule name. Click on any one and select edit (other options: delete, new, duplicate)

  • Options for scheduling:
  1. crontab string,
  2. Select report from a combo box
  3. outputfolder
  4. zip or not to zip
  5. notify of running by email
  6. format : valid formats : pdf, doc, ppt, xls..... but not html. A simple downloader that will download a single url will be used. (KISS)
  7. mail to. (comma seperated destination addresses)
  8. append a date string to ( low priority )
  9. A parameters table. Which lists parameter vs. value. Nothing dynamic about it. You need to know the paramter names yourself to be able to use it. (low priority .... make parameters list available once you select the report)
  • A reports management screen:
Lists the .rptdesign files in the reports directory. With options of upload, delete, download, rename, copy

Seems simple enough :) But requires dedicated time.... which I am short on right now.... I need motivation... anyone interested in giving me some?

Optimizing Birt Viewer for solaris in simple steps

I was working on BIRT in windows. The performance in windows was awesome but when I moved the code to our solaris server a report that would take round about 10 seconds on windows took over a minute!

Here is how I improved the performance: (Note that I prefer jetty to tomcat due to its lightweight nature ..... Actually I use hightide ... but that's another story)
  • Make the default memory allocation greater:
open your tide.sh in the bin directory (hightide.sh in my case). Find and modify the following:

# JAVA_OPTIONS

# Extra options to pass to the JVM

TO:

JAVA
_OPTIONS="-server -Xmx3800 -Xms3800"

this basically tells the JVM to run in server mode i.e. -server (slower startup time.... faster execution time :)) and to start of with a default of 4GB ram with a max of 4GB ram (Xmx and Xms) . Change this to how much RAM you want allocated to JVM by default

  • Update your BIRT runtime to the latest and greatest version
I am telling you.... don't take this as a joke! :)

  • Update your JDK to the latest version
Again ... no kidding. Solaris 10 comes with JDK 5 by default. JDK 6 is so much better. Just download the .sh file for jdk from the sun website and install it. It is a simple command line script. You do not even need root privledges to run it. All you need is access to a folder you can write to (your home dir ?) and thats it.

After installation it note the location of your installation dir
e.g. /home/bla/Desktop/1.6.13_10
or whatever.

again modify jetty.sh (or hightide.sh) changing:

# JAVA_HOME
# Home of Java installation.

to :

JAVA_HOME="/home/bla/Desktop/1.6.13_10"

Thats all. Now give BIRT a spin. My runtime went from 10 secs to 7 secs :)!!

Monday, May 18, 2009

BIRT dynamic parameters

BIRT is simply amazing. There is no denying that. The best thing about it is that it is open source and free to use. This makes it simply an amazing solution to work with. It is really great as long as they keep the normal report rendering api free and open source :)

This post is about a particular scenario in reporting. It relates to time reporting. Most commonly we need trend analysis of the past week to better analyze the data. But you dont want to put in the date / time of the last week manaually. Using oracle BI Publisher I am used to taking care of these using sysdate inside of SQL Queries. But BIRT provides a better way.

Heres a step by step howto.

Create two report parameters. One for start and one for the stop time:

Remeber to uncheck the Is Required property:

This is because we are going to generate the value dynamically in case the parameters are not set :)

Needless to say you need to link these to your query (data set) parameters:


Now click the main surface of your report in the layout tab:


Then click the script tab and add the following code to the initialze event handler as shown:


function getdateBehindByDays(days)
{

var cal = java.util.Calendar.getInstance();
cal.add(java.util.Calendar.DAY_OF_MONTH, -days);
return (cal.get(java.util.Calendar.MONTH) + 1 ) + "/" + cal.get(java.util.Calendar.DAY_OF_MONTH) + "/" + cal.get(java.util.Calendar.YEAR);

}

if (params["StartTime"].value == null)
{
params["StartTime"].value = getdateBehindByDays(7);
}

if (params["StopTime"].value==null)
{
params["StopTime"].value = getdateBehindByDays(0);
}


What this code is doing is that it is sending the start date back by one week and the stop time to today :). Just change the values '7' and '0' to what you require :)

Now just run the report and set the parameters you want to be made dynamic to null:

Viola! welcome to the wonderful world of automated reporting :)