Wednesday, June 2, 2010

Some behavior of the crystal reports

Here are some of the behaviors of the crystal reports that can not be done by using it.

1.There is no option to display all the dates between the date ranges that passed through the parameters
2.If data is not available Bar chart will be empty, even axis will not be populated.
3.Cross tab reports is good choice for displaying categorized counts as vertical columns, but if any of the category is not present for a given time period, it will suppress the entire column even not leave a empty column and records marked as zero
For a case, we want how many applications received through internet and post .
we can get it as

Date       Internet      Post
01/01           5                2
02/01           3                6
03/01           8               12
04/01           6               10

if none of the dates having count under Post, the whole column will not be printed even the header
like this,
Date   Internet

01/01       5

02/01       3
03/01       8
04/01       6
4. Business objects enterprise repository server, There is an option to schedule the reports when to run(i mean the day,weekly, monthly), but there is no option for what date limts it has to fetch automatically.

That is weekly reports i can schedule to run on every sunday, but i can't specify the dates that monday to saturday data's it has to fetch.

Oracle query to display all the dates in a month or date ranges

In some requirements we have to show all the dates between the date range though a particular date entry is not  present in the DB. We can not acheive it in the crystal report straight forwardly. The only the way is writting query to bring all the dates in the data ranges and make left outer join with your core resultset by joining the dates.

For an example we need to find day wise count of particular entity,

SELECT
         TEMP.TEMP_DATE,
         (
           SELECT COUNT(ENTITY.ID) FROM
                (SELECT ENTITY.ID ....... YOUR CORE CONDITIONS ) INLINEVIEW  
           WHERE INLINEVIEW.DATE(+)=TEMP.TEMP_DATE
        )ENTITY_COUNT
FROM
  ( SELECT ({?FROMDATE}-1)+ LEVEL TEMP_DATE
     FROM DUAL CONNECT BY LEVEL <= ({?TODATE})-({FROMDATE}-1)  )TEMP
 GROUP BY TEMP.TEMP_DATE
 ORDER BY TEMP.TEMP_DATE

Crystal reports: Can we use two different queries in a report

We cannot use two queries in a report unless we make a join between those two queries.
In this case crystal reports will make cartesian product as that of the database makes cartesian product while using two tables without having any join between them.

Solution to use two different queries in a report:
                                                                       We can acheive it by an option called Sub-report.
Sub report is a report which is created normally as any other report, and it can be included in the calling report.once inserted (using insert option) the sub report will stay inside the main report though we delete the actual report which is about to be inserted as sub report and can be treated single report.