Generate a report with three table

hi Friends,
i have three table
1-
CREATE TABLE "TRANSACTION_DETAILS"
(     "S_NO" NUMBER,
     "BILL_NO" NUMBER,
     "BILL_DATE" DATE,
     "PARTY_NAME" VARCHAR2(1000),
     "VEHICLE_NO" VARCHAR2(20),
     "ITEM_NAME" VARCHAR2(500),
     "DESCRIPTION" VARCHAR2(4000),
     "QTY" NUMBER,
     "RATE" NUMBER,
     "AMOUNT" NUMBER,
     CONSTRAINT "TRANSACTION_DETAILS_CON" PRIMARY KEY ("S_NO") ENABLE
2-
CREATE TABLE "LAB_WORK_DTL"
(     "ID" NUMBER,
     "BILL_NO" NUMBER,
     "BILL_DATE" DATE,
     "PARTY_NAME" VARCHAR2(1000),
"VEHICLE_NO" VARCHAR2(20),
     "WORK_DETAIL" VARCHAR2(4000),
     "LABOUR_AMT" NUMBER,      
     CONSTRAINT "LAB_WORK_DTL_PK" PRIMARY KEY ("ID") ENABLE
3-
CREATE TABLE "JOB_CARD_DETAILS"
(     "ID2" NUMBER,
     "BILL_NO" NUMBER,
     "BILL_DATE" DATE,
     "PARTY_NAME" VARCHAR2(1000),
     "VEHICLE_NO" VARCHAR2(20),
     "AMOUNT" NUMBER,
     CONSTRAINT "JOB_CARD_DETAILS_CON" PRIMARY KEY ("ID2") ENABLE
i want to generate a Report of total amout of bill No Like
BILL_NO,BILL_DATE,VEHICLE_NO,SUM(AMOUNT) ,SUM(LABOUR_AMT),SUM(AMOUNT)
I AM USING
select a.BILL_NO,a.BILL_DATE,a.PARTY_NAME,a.VEHICLE_NO,SUM(a.AMOUNT),SUM(b.LABOUR_AMT),SUM(c.AMOUNT) from TRANSACTION_DETAILS a,LAB_WORK_DTL b,JOB_CARD_DETAILS c where a.PARTY_NAME =b.PARTY_NAME and a.PARTY_NAME=c.PARTY_NAME and a.PARTY_NAME =:P38_PARTY_NAME group by a.bill_no,a.BILL_DATE,a.PARTY_NAME,a.VEHICLE_NO,b.bill_no,b.BILL_DATE,b.PARTY_NAME,b.VEHICLE_NO,c.bill_no,c.BILL_DATE,c.PARTY_NAME,c.VEHICLE_NO
ACCORDING TO THIS CODE sum of these column SUM(a.AMOUNT),SUM(b.LABOUR_AMT),SUM(c.AMOUNT) are not correct and there are one more problem if BILL_NO is not in LAB_WORK_DTL JOB_CARD_DETAILS these table then result shows NO DATA FOUND but BILL_NO is avalable in
TRANSACTION_DETAILS this table.
How can i generate this report .
Thanks
Manoj Kaushik

1-
CREATE TABLE  "TRANSACTION_DETAILS"
(     "S_NO" NUMBER,
     "BILL_NO" NUMBER,
     "BILL_DATE" DATE,
     "PARTY_NAME" VARCHAR2(1000),
     "VEHICLE_NO" VARCHAR2(20),
     "ITEM_NAME" VARCHAR2(500),
     "DESCRIPTION" VARCHAR2(4000),
     "QTY" NUMBER,
     "RATE" NUMBER,
     "AMOUNT" NUMBER,
      CONSTRAINT "TRANSACTION_DETAILS_CON" PRIMARY KEY ("S_NO") ENABLE
2-
CREATE TABLE  "LAB_WORK_DTL"
(     "ID" NUMBER,
     "BILL_NO" NUMBER,
     "BILL_DATE" DATE,
     "PARTY_NAME" VARCHAR2(1000),
"VEHICLE_NO" VARCHAR2(20),
     "WORK_DETAIL" VARCHAR2(4000),
     "LABOUR_AMT" NUMBER,      
      CONSTRAINT "LAB_WORK_DTL_PK" PRIMARY KEY ("ID") ENABLE
3-
CREATE TABLE  "JOB_CARD_DETAILS"
(     "ID2" NUMBER,
     "BILL_NO" NUMBER,
     "BILL_DATE" DATE,
     "PARTY_NAME" VARCHAR2(1000),
     "VEHICLE_NO" VARCHAR2(20),
     "AMOUNT" NUMBER,
      CONSTRAINT "JOB_CARD_DETAILS_CON" PRIMARY KEY ("ID2") ENABLE
/Can you define the relation between these three tables. I see in your sql you are joining the three table with the column PARTY_NAME. Is that the proper joining condition? Can you explain that.
And also when you say this
ACCORDING TO THIS CODE sum of these column SUM(a.AMOUNT),SUM(b.LABOUR_AMT),SUM(c.AMOUNT) are not correct What exactly do you mean. What is not correct? Can you show some sample data.
And also it would be of great help to all the people here if you format your SQL and use {noformat}{noformat} tag to preserve the format of your code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Report using three tables on group basis

    Hi,
    I wish to know a clue for the follwing report among three tables either using join or sub-query or PL/SQL Script as per the below desired output.
    Top 10 games by uniques / by volume
    It should produce something like this:
    Game     Uniques     Volumes     Game Start     Game End     Mins on Air     
    Top 5 movies beginning with "D"     2734     7924     9/24/06 9:59 PM     9/24/06 10:41 PM     42     
    Top 5 One Hit Wonders     2355     6471     9/24/06 9:07 PM     9/24/06 9:48 PM     41     
    Things you find in The Kitchen     1336     3600     9/24/06 10:41 PM     9/24/06 10:59 PM     18     
    Twisted Title Men in Black     770     1435     9/24/06 9:53 PM     9/24/06 9:59 PM     6     
    Anagram Lance Armstrong     884     1350     9/24/06 9:48 PM     9/24/06 9:53 PM     5     
    A.Bucks Jack and Jill...     593     824     9/24/06 8:59 PM     9/24/06 9:04 PM     4     
    Missing link ANY101     649     815     9/24/06 9:04 PM     9/24/06 9:07 PM     3     
    Parameters should be startDate and endDate.
    This query can be obtained from using the following tables: Calls, Games, Events, Event_Types
    Calls have a timestamp.
    Every game has event, such as start game or end game (see Event_Types), with its timestamp
    Volumes: Number of calls received for each game between start game date and end date
    Uniques: Unique Number of calls received for each game between start game date and end date
    (distinct cli)
    Mins on air: differences between start call and end call
    Relationship:
    The ID column from games table and game_id from events table is common.
    Assume if the event type id is 2 then it starts game and if 3 then game ends. Other type is irrelevant for this query.
    The id from event_type is mentioned in another table event_types as master with description. But it is not required to establish relationship with this table. As this code ( 2 or 3) is alredy availbel with event_type_id in the events table.
    Please assume the CLI number as dummy data.
    I have provided the structure and query to generate tables and populate testing data to sort out this issue at the earliest.
    I tried to perform this query but I wish to compare the result with the script given by experts as I’m not a core developer.
    1) desc calls
    Name Null? Type
    CLI NOT NULL VARCHAR2(255)
    CALL_DATE NOT NULL TIMESTAMP(6)
    insert into values('&CLI','&call_date')
    select substr(CLI,1,10),substr(call_date,1,22) from calls
    SUBSTR(CLI SUBSTR(CALL_DATE,1,22)
    0662740929 22-SEP-06 05.22.44.123
    0662740973 22-SEP-06 05.22.47.123
    0662740956 22-SEP-06 05.22.46.123
    0662740980 22-SEP-06 05.22.47.123
    0662740936 09-MAY-06 05.22.44.123
    0762740954 22-SEP-06 05.22.45.123
    0762740936 09-MAY-06 05.22.47.123
    0762740921 22-SEP-06 05.22.44.123
    0113456789 22-SEP-06 05.47.04.082
    0987654321 22-SEP-06 06.16.29.727
    0 22-SEP-06 06.17.28.141
    SUBSTR(CLI SUBSTR(CALL_DATE,1,22)
    0123456789 09-MAY-06 06.27.51.224
    0112740929 22-SEP-06 06.28.43.398
    0123456789 09-MAY-06 06.30.10.830
    0044791475 24-SEP-06 04.38.08.564
    0044791475 24-SEP-06 04.40.05.777
    0123456789 24-SEP-06 05.32.22.267
    0147258369 24-SEP-06 05.34.25.652
    0852147963 24-SEP-06 05.52.56.992
    0123456789 25-SEP-06 01.34.17.157
    0683379112 25-SEP-06 01.35.19.461
    0 25-SEP-06 03.09.12.347
    SUBSTR(CLI SUBSTR(CALL_DATE,1,22)
    0141411683 25-SEP-06 03.21.07.402
    0141411683 25-SEP-06 03.21.38.519
    0618769562 02-JUN-06 03.22.12.807
    0123456789 02-JUN-06 03.24.11.387
    0 25-SEP-06 03.25.13.152
    0141412179 25-SEP-06 03.25.38.424
    0123456789 02-JUN-06 03.26.57.687
    0607069617 02-JUN-06 03.27.02.720
    0014141168 26-SEP-06 03.30.55.290
    0618769562 25-SEP-06 03.31.21.141
    0141411683 25-SEP-06 03.31.45.952
    SUBSTR(CLI SUBSTR(CALL_DATE,1,22)
    0607069617 25-SEP-06 03.32.14.542
    0618769562 25-SEP-06 03.32.30.433
    0 25-SEP-06 03.32.43.292
    0141412179 25-SEP-06 03.33.07.166
    0 25-SEP-06 03.33.56.086
    0 25-SEP-06 03.34.03.918
    0123456789 26-SEP-06 03.34.21.193
    0 25-SEP-06 03.34.25.484
    0 25-SEP-06 03.34.39.126
    0 25-SEP-06 03.34.40.354
    0 25-SEP-06 03.34.51.231
    2)
    SQL> desc events
    Name Null? Type
    EVENT_TYPE_ID NOT NULL NUMBER(19)
    EVENT_DATE NOT NULL TIMESTAMP(6)
    GAME_ID NUMBER(19)
    insert into events values ('&EVENT_TYPE_ID','&EVENT_DATE',&GAME_ID')
    SQL> select substr(event_type_id,1,10),substr(event_date,1,20),substr(game_id,1,10) from events where game_id in (1918,1919,1920,1939,1958,1979,1999,2018,2040,2041,2061)
    SUBSTR(EVE SUBSTR(EVENT_DATE,1, SUBSTR(GAM
    3 26-APR-06 06.11.50.8 1939
    4 26-APR-06 06.12.05.6 1939
    5 26-APR-06 06.16.13.5 1939
    3 09-MAY-06 06.18.59.7 1920
    4 09-MAY-06 06.22.43.7 1920
    3 12-MAY-06 04.24.46.2 1920
    4 12-MAY-06 04.46.22.5 1920
    3 12-MAY-06 04.29.07.4 1920
    4 12-MAY-06 04.39.31.1 1920
    3 12-MAY-06 04.29.35.3 1920
    4 12-MAY-06 04.30.02.8 1920
    SUBSTR(EVE SUBSTR(EVENT_DATE,1, SUBSTR(GAM
    3 26-SEP-06 12.19.27.6 1958
    4 26-SEP-06 12.29.37.9 1958
    5 01-JUN-06 12.26.37.2 1958
    3 02-JUN-06 11.53.49.0 1979
    6 02-JUN-06 11.54.00.5 1979
    4 02-JUN-06 11.54.55.5 1979
    3 02-JUN-06 11.55.03.7 1979
    4 02-JUN-06 11.57.40.7 1979
    3 02-JUN-06 11.57.43.5 1979
    4 02-JUN-06 11.59.47.2 1979
    3 14-SEP-06 02.24.13.8 1999
    SUBSTR(EVE SUBSTR(EVENT_DATE,1, SUBSTR(GAM
    4 14-SEP-06 02.55.18.7 1999
    3 14-SEP-06 06.44.40.1 1999
    4 14-SEP-06 06.52.57.9 1999
    3 22-SEP-06 04.05.09.5 2018
    4 22-SEP-06 05.24.14.7 2018
    5 22-SEP-06 05.24.25.0 2018
    4 24-SEP-06 03.17.54.8 2018
    3 24-SEP-06 03.19.00.1 2018
    3) INSERT INTO games VALUES ('&ID'.'&NAME')
    SQL> desc games
    Name Null? Type
    ID NOT NULL NUMBER(19)
    NAME NOT NULL VARCHAR2(255)
    select substr(id,1,10),substr(name,1,25) from games;
    SUBSTR(ID, SUBSTR(NAME,1,25)
    1918 Copy of QN27030628
    1919 Copy of Copy of QN0104061
    1920 Copy of Copy of Copy of Q
    1939 Alex Game 8
    1958 QN27030628 Lee
    1979 Copy of QN01040611 9
    1999 Ale's Game
    2018 TF1 Game test 1
    2040 Test Game TF1sarah
    2041 BTAgilemedia Game Test
    2061 Copy of Copy of QN0104060
    Your help would be highly appreciated.
    Thanks
    Jayesh

    Hi,
    I am sending herewith SQL statement for populating data into the concern tables
    To make easier for further testing your script.
    insert into calls values (0772740929, 22-SEP-06 05.22.44.123)
    insert into calls values (0882740929, 22-SEP-06 05.22.44.123)
    insert into calls values (0772740929, 25-SEP-06 05.22.44.123)
    insert into calls values (0662740929, 27-SEP-06 05.22.44.123)
    insert into calls values (0452740929, 22-SEP-06 05.22.44.123)
    insert into calls values (0992740929, 24-SEP-06 05.22.44.123)
    insert into calls values (0992740929, 26-SEP-06 05.22.44.123)
    insert into events values (3, 22-SEP-06 05.22.44.123,1918)
    insert into events values (4, 22-SEP-06 05.32.44.123,1918)
    insert into events values (3, 24-SEP-06 05.22.44,1920)
    insert into events values (4, 24-SEP-06 05.42.44,1920)
    insert into events values (3, 26-SEP-06 05.22.44,1958)
    insert into events values (4, 26-SEP-06 05.52.44,1958)
    Insert into games values (1918,’ Copy of QN27030628’)
    Insert into games values (1920,’ Test Game TF1sarah’)
    Insert into games values (1958,’ Test Car Race’)
    Thanks
    jayesh

  • How to generate complex reports with JHeadStart?

    I have data from a DataSourceSet process in the infoTable (I use BC4J 9.0.3.10.7, JHeadStart 9.0.3.58, Oracle MVC R.Candidate 2.0, UIX 2.1.9).I need to generate a report with this data in a UIX Table. Actually, I show the data as retrieved from the ViewObject(Whole query in a table). One of the columns has Numbers and I add them at the bottom row with a GetTotalsRow process.
    Now I need to have subtotals in the same table as if I do a GROUP BY but without modifying the query (I have to do this using data stored in infoTable). I also have to add complex calculations for each row.
    Any idea?
    PD: I'm thinking in reading data from infoTable and in a custom process create DataObjectList with all details.
    is it a good approach?
    is there something better?

    Ariel,
    I think I already answered this question on the internal mailing list. Is this correct?
    If you are an Oracle employee, please use the internal mailing list.
    Thanks,
    Steven Davelaar.
    JHeadstart team.

  • Generating sub reports with XML Datasource in Jasper Report

    Hi ,
    I have a query related to report generation using Jasper Reports. I have managed to generate main report with XML as a datasource but am unable to do so for subreport. I tried serching through Google but in vain. If by chance I've missed out any of the links, i would be grateful for that. Sample code woukd really make my life better.
    Sorry in advance if i 've posted in wrong forum.(if it hurta anyone)

    Hello there,
    I am new to JasperReports and am having a similar problem. Were you able to find out how to do this. Any help is appreciated.
    Thanks in Advance
    Regards
    Sriram

  • How to generate a customized report with a table

    I have a table with two columns: month, count. The values are like the following:
    Jan-2007 50
    Feb-2007 46
    Mar-2007 55
    Apr-2007 76
    Jan-2009 67
    Feb-2009 86
    Mar-2009 55
    I want to generate a report like this:
    Month 2007 2008 2009
    January 50 76 67
    Febuary 46 45 86
    How to do that?
    Thanks.
    Jen

    Jen,
    This is the best way I could come up with. It is a little clunky but it gets the job done. Basically it buckets each group by month and then unions each month together. I used the column names and formats you specified so you should only have to change the table name.
    EDIT
    You may want to do a nvl on each decode that way the sums will work correctly for nulls. Also, you could generate this sql statement procedurally and save yourself some maintenance time. This was just to show you how it could be approached.
    SELECT 'January' "Month",
           SUM(DECODE(substr(month,5,4),2000,count)) "2000",
           SUM(DECODE(substr(month,5,4),2001,count))"2001",
           SUM(DECODE(substr(month,5,4),2002,count))"2002",
           SUM(DECODE(substr(month,5,4),2003,count))"2003",
           SUM(DECODE(substr(month,5,4),2004,count))"2004",
           SUM(DECODE(substr(month,5,4),2005,count))"2005",
           SUM(DECODE(substr(month,5,4),2006,count))"2006",
           SUM(DECODE(substr(month,5,4),2007,count))"2007",
           SUM(DECODE(substr(month,5,4),2008,count))"2008",
           SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
      WHERE substr(month,1,3) = 'JAN'
      GROUP BY 'January'
    UNION ALL
    SELECT 'February' "Month",
           SUM(DECODE(substr(month,5,4),2000,count)) "2000",
           SUM(DECODE(substr(month,5,4),2001,count))"2001",
           SUM(DECODE(substr(month,5,4),2002,count))"2002",
           SUM(DECODE(substr(month,5,4),2003,count))"2003",
           SUM(DECODE(substr(month,5,4),2004,count))"2004",
           SUM(DECODE(substr(month,5,4),2005,count))"2005",
           SUM(DECODE(substr(month,5,4),2006,count))"2006",
           SUM(DECODE(substr(month,5,4),2007,count))"2007",
           SUM(DECODE(substr(month,5,4),2008,count))"2008",
           SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
      WHERE UPPER(substr(month,1,3)) = 'FEB'
      GROUP BY 'February'
    UNION ALL
    SELECT 'March' "Month",
           SUM(DECODE(substr(month,5,4),2000,count)) "2000",
           SUM(DECODE(substr(month,5,4),2001,count))"2001",
           SUM(DECODE(substr(month,5,4),2002,count))"2002",
           SUM(DECODE(substr(month,5,4),2003,count))"2003",
           SUM(DECODE(substr(month,5,4),2004,count))"2004",
           SUM(DECODE(substr(month,5,4),2005,count))"2005",
           SUM(DECODE(substr(month,5,4),2006,count))"2006",
           SUM(DECODE(substr(month,5,4),2007,count))"2007",
           SUM(DECODE(substr(month,5,4),2008,count))"2008",
           SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
      WHERE substr(month,1,3) = 'MAR'
      GROUP BY 'March'
    UNION ALL
    SELECT 'April' "Month",
           SUM(DECODE(substr(month,5,4),2000,count)) "2000",
           SUM(DECODE(substr(month,5,4),2001,count))"2001",
           SUM(DECODE(substr(month,5,4),2002,count))"2002",
           SUM(DECODE(substr(month,5,4),2003,count))"2003",
           SUM(DECODE(substr(month,5,4),2004,count))"2004",
           SUM(DECODE(substr(month,5,4),2005,count))"2005",
           SUM(DECODE(substr(month,5,4),2006,count))"2006",
           SUM(DECODE(substr(month,5,4),2007,count))"2007",
           SUM(DECODE(substr(month,5,4),2008,count))"2008",
           SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
      WHERE UPPER(substr(month,1,3)) = 'APR'
      GROUP BY 'April'
    UNION ALL
    SELECT 'May' "Month",
           SUM(DECODE(substr(month,5,4),2000,count)) "2000",
           SUM(DECODE(substr(month,5,4),2001,count))"2001",
           SUM(DECODE(substr(month,5,4),2002,count))"2002",
           SUM(DECODE(substr(month,5,4),2003,count))"2003",
           SUM(DECODE(substr(month,5,4),2004,count))"2004",
           SUM(DECODE(substr(month,5,4),2005,count))"2005",
           SUM(DECODE(substr(month,5,4),2006,count))"2006",
           SUM(DECODE(substr(month,5,4),2007,count))"2007",
           SUM(DECODE(substr(month,5,4),2008,count))"2008",
           SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
      WHERE substr(month,1,3) = 'MAY'
      GROUP BY 'May'
    UNION ALL
    SELECT 'June' "Month",
           SUM(DECODE(substr(month,5,4),2000,count)) "2000",
           SUM(DECODE(substr(month,5,4),2001,count))"2001",
           SUM(DECODE(substr(month,5,4),2002,count))"2002",
           SUM(DECODE(substr(month,5,4),2003,count))"2003",
           SUM(DECODE(substr(month,5,4),2004,count))"2004",
           SUM(DECODE(substr(month,5,4),2005,count))"2005",
           SUM(DECODE(substr(month,5,4),2006,count))"2006",
           SUM(DECODE(substr(month,5,4),2007,count))"2007",
           SUM(DECODE(substr(month,5,4),2008,count))"2008",
           SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
      WHERE UPPER(substr(month,1,3)) = 'JUN'
      GROUP BY 'June'
    UNION ALL
    SELECT 'July' "Month",
           SUM(DECODE(substr(month,5,4),2000,count)) "2000",
           SUM(DECODE(substr(month,5,4),2001,count))"2001",
           SUM(DECODE(substr(month,5,4),2002,count))"2002",
           SUM(DECODE(substr(month,5,4),2003,count))"2003",
           SUM(DECODE(substr(month,5,4),2004,count))"2004",
           SUM(DECODE(substr(month,5,4),2005,count))"2005",
           SUM(DECODE(substr(month,5,4),2006,count))"2006",
           SUM(DECODE(substr(month,5,4),2007,count))"2007",
           SUM(DECODE(substr(month,5,4),2008,count))"2008",
           SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
      WHERE substr(month,1,3) = 'JUL'
      GROUP BY 'July'
    UNION ALL
    SELECT 'August' "Month",
           SUM(DECODE(substr(month,5,4),2000,count)) "2000",
           SUM(DECODE(substr(month,5,4),2001,count))"2001",
           SUM(DECODE(substr(month,5,4),2002,count))"2002",
           SUM(DECODE(substr(month,5,4),2003,count))"2003",
           SUM(DECODE(substr(month,5,4),2004,count))"2004",
           SUM(DECODE(substr(month,5,4),2005,count))"2005",
           SUM(DECODE(substr(month,5,4),2006,count))"2006",
           SUM(DECODE(substr(month,5,4),2007,count))"2007",
           SUM(DECODE(substr(month,5,4),2008,count))"2008",
           SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
      WHERE UPPER(substr(month,1,3)) = 'AUG'
      GROUP BY 'August'
    UNION ALL
    SELECT 'September' "Month",
           SUM(DECODE(substr(month,5,4),2000,count)) "2000",
           SUM(DECODE(substr(month,5,4),2001,count))"2001",
           SUM(DECODE(substr(month,5,4),2002,count))"2002",
           SUM(DECODE(substr(month,5,4),2003,count))"2003",
           SUM(DECODE(substr(month,5,4),2004,count))"2004",
           SUM(DECODE(substr(month,5,4),2005,count))"2005",
           SUM(DECODE(substr(month,5,4),2006,count))"2006",
           SUM(DECODE(substr(month,5,4),2007,count))"2007",
           SUM(DECODE(substr(month,5,4),2008,count))"2008",
           SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
      WHERE substr(month,1,3) = 'SEP'
      GROUP BY 'September'
    UNION ALL
    SELECT 'October' "Month",
           SUM(DECODE(substr(month,5,4),2000,count)) "2000",
           SUM(DECODE(substr(month,5,4),2001,count))"2001",
           SUM(DECODE(substr(month,5,4),2002,count))"2002",
           SUM(DECODE(substr(month,5,4),2003,count))"2003",
           SUM(DECODE(substr(month,5,4),2004,count))"2004",
           SUM(DECODE(substr(month,5,4),2005,count))"2005",
           SUM(DECODE(substr(month,5,4),2006,count))"2006",
           SUM(DECODE(substr(month,5,4),2007,count))"2007",
           SUM(DECODE(substr(month,5,4),2008,count))"2008",
           SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
      WHERE UPPER(substr(month,1,3)) = 'OCT'
      GROUP BY 'October'
    UNION ALL
    SELECT 'November' "Month",
           SUM(DECODE(substr(month,5,4),2000,count)) "2000",
           SUM(DECODE(substr(month,5,4),2001,count))"2001",
           SUM(DECODE(substr(month,5,4),2002,count))"2002",
           SUM(DECODE(substr(month,5,4),2003,count))"2003",
           SUM(DECODE(substr(month,5,4),2004,count))"2004",
           SUM(DECODE(substr(month,5,4),2005,count))"2005",
           SUM(DECODE(substr(month,5,4),2006,count))"2006",
           SUM(DECODE(substr(month,5,4),2007,count))"2007",
           SUM(DECODE(substr(month,5,4),2008,count))"2008",
           SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
      WHERE substr(month,1,3) = 'NOV'
      GROUP BY 'November'
    UNION ALL
    SELECT 'December' "Month",
           SUM(DECODE(substr(month,5,4),2000,count)) "2000",
           SUM(DECODE(substr(month,5,4),2001,count))"2001",
           SUM(DECODE(substr(month,5,4),2002,count))"2002",
           SUM(DECODE(substr(month,5,4),2003,count))"2003",
           SUM(DECODE(substr(month,5,4),2004,count))"2004",
           SUM(DECODE(substr(month,5,4),2005,count))"2005",
           SUM(DECODE(substr(month,5,4),2006,count))"2006",
           SUM(DECODE(substr(month,5,4),2007,count))"2007",
           SUM(DECODE(substr(month,5,4),2008,count))"2008",
           SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
      WHERE UPPER(substr(month,1,3)) = 'DEC'
      GROUP BY 'December'Edited by: Tyson Jouglet on Mar 17, 2009 9:27 AM

  • Generate PDF report with HTML data

    Hi All,
    I am using BI Publisher to generate my reports but I stumbled on a big problem...
    I have a table with a column TASK_DESCRIPTION. This column is a CLOB containing a simple HTML coded page. When a user works with the application he sees a nicely formatted page but when I generate a report I get all the html tags in it (< html > < h4 > ...etc...)
    Is it possible to somehow convert the source data from the table (which is html code) into readable formatted text when generating the report?
    ANY ideas are very welcome!
    Regards,
    Pawel.

    Yes you can do this with an XSL template converting HTML to Formatting objects.
    There are a few catches however. First, you must be sure your markup-fragment is valid XHTML, that is all tags must be closed. Luckily the builtin standard HTML-editor does this.
    I wasn't able to call BI-publisher from within Apex without the XHTML-fragment being escaped, but i managed to create a query on a table containing the fragment within BI-publisher itself. This leaves the fragment intact, producing a valid XML-document.
    This is very important because the XSL attached to the RTF-template must be able to match and convert the XHTML-tags to FO.
    Basic setup :
    Create a datasource (query) within BIP.
    Create the RTF-template and add an extra field (at the top) containing : <?import:file:///C:\xhtml-to-xslfo.xsl?> or whatever location the XSL-file resides.
    Now, layout your report using the wizard and change the field containing the XHTML-fragment into <xsl:apply-templates select="TASK_DESRIPTION"/>
    There are a few XSL-templates out there converting XHTML to FO. One I found particularly useful : http://www.ibm.com/developerworks/library/x-xslfo2app/xhtml-to-xslfo.xsl
    You might want to change the .xsl so it matches tags case insensitive (eg. <xsl:template match="a|A"> )
    Another caveat is the html-entities for special characters. When the XML from the datasource is parsed by BIP it doesn't recognise entities like &Agrave ; .
    This can be solved by creating a pl/sql function converting these characters to numeric entities like &#192 ;. and use this function in the select statement of your datasource. see http://www.w3schools.com/tags/ref_entities.asp
    Now you can call the report from Apex using an URL to the report definiton (see BIP docs for URL syntax and parameter passing)
    Not a 'really' integrated solution but I had some nice results.
    It would be nice though if we could specify a .dtd containing the references for HTML-entities and a sort of flag wheter the report column should be escaped or not, from within Apex. This would allow us to embed XML-fragments within the XML that Apex produces, resulting in a valid XML doc. Using XSL, you can then match the tags of the XML-fragment and convert it to FO.
    Good luck !
    Maarten

  • How to generate a report from crm table to find out user status changes

    Dear all,
    Could you please help me on generating a report from SAP CRM table level
    to find out user status changes in crm orders for a specific period of time?
    Thanks in advance,
    Regards,
    Shaik

    Hi Shaik.
    You would not need to write report for this. You need to create a Table view mainenance for the CRMD_ORDERADM_H or CRMD_ORDERADM_I for whichever  you need.
    Follow the below or search on google for more on table view maintenance.
    Go to SE11, give the table name and click on change. Then Go to utilities--> Table maintenance generator.
    In the table maintenance generator screen, you should give Authorization Group,
    Function Group name (Function Group name can be same as table name),
    Maintenance type can be one step or two step, usually you will create with one
    step. You should give maintenance screen number. After clicking on create button,
    a table maintenance generator will be created.
    To check it go to SM30 . In SM30, you find display, Maintain options.
    You can view the table contents by choosing Display and  supplying the selection criteria of dates.
    Regards
    Apoorva

  • Error while generating  BI Reports with Formules From Oracle 10g reports

    Hi Team,
    I had a problem of viewing reports in Bi Publisher. I will explain what i am doing
    I an taking an example table emplyee to generate the reports
    create or replace package body tstPkg as
    I am creating Package Header as Below
    function check_role(p_sal number) return varchar2 as
    v varchar2(100);
    begin
    if p_sal > 2000 then
    v := 'MGR';
    else
    v := 'EXEC';
    end if;
    return v;
    end;
    and I am creating Package Body
    create or replace package tstPkg as
    function check_role(p_sal number) return varchar2;
    end;
    after creation i am generating a report by using the formulae so that in paper layout it will generate 14 pages
    with an extra column in a passage format.
    After this i saved it in specific folder
    Then i am converting to XML by using "Reports Converter" Tool to xml.
    By using ConvetionTool ioracle.apps.xdo.rdfparser.BIPBatchConversion , i converted the xml file and it generated .Pls files , template files and the rest..
    After this i cpoied the folder structure into bi publisher reports, then i refreshed the metadata and i changed the defualt data source. but it showing the error as
    ORA-00923: FROM keyword not found where expected
    and my quetry is like this in data template
    select *,EmpSal.cf_1formula(emp.SAL) CF_1 from emp
    How to resolve the above problem?
    Regards
    Bhuvan
    end;
    Edited by: 867649 on Jun 22, 2011 6:38 AM

    Hi,
    When i tried to compile below packages. It gave 'Warning: Package altered with compilation errors.' message for both.
    DBMS_SWRF_REPORT_INTERNAL
    DBMS_SWRF_INTERNAL
    Again i came back to original position. Now again all 4 objects are in INVALID state. Please advice.
    Regards

  • CRVS2010 Beta - Report with many tables

    Hi,
    I was developing my application first with a test Database with few tables. Now that I am changing to the actual database (with about 200 tables) I noticed that the ReportDocument takes a really long time to load when I tried to access the DataDefinition for the first time.
    Is there one way to avoid this?? The tables are all there because I need to have the option the select the table that I wanna use in the application, but after this I just use the table chosen and the linked tables in the Report.
    thanks

    OK where to start...
    First the act of adding 200 tables, and I assume none of them are linked is the first problem you are going to have. CR is a relational database reporting tool. Not linking tables generates multiple SELECT statements.
    If you only need one or two then use RAS to add the tables and then the fields, Bascially you are creating the report designer for your users. All of the user interface needs to be created by you.
    There may be one option that could help but what you are doing is likely never going to be fast....
    Open regedit32.exe and go to:
    HKEY_CURRENT_USER\Software\SAP BusinessObjects\Suite XI 4.0\Crystal Reports Designer Component\DatabaseOptions
    In there you'll find a key called - DoAutoSmartLinking
    Set the value to No
    What that key does is when a report is open CR tries to link all tables and all fields.
    Good luck
    Don

  • Generate HTML report with ANT

    Hello,
    I'm  new to FlexPMD. I have just generated my firsts reports. I try to generate HTML reports.
    I browse the documentation, this forum and the web and I find informations to :
    - generate documentation with Hudson
    - generate documentation with Maven
    - generate documentation with XSLT pmd.xml -> html
    Ok, I try to keep it simple. So I don't want to use Hudson.
    I'm using ANT, and I currently don't want to install/learn Maven.
    I'm using FlexUnit with ANT. And It's really simple to generate reports :
    <junitreport todir="${report.flexunit.loc}">
                <fileset dir="${report.flexunit.loc}">
                    <include name="TEST-*.xml" />
                </fileset>
                <report format="frames" todir="${report.flexunit.loc}/html" />
    </junitreport>
    I'm really new to FlexPMD, so I don't have currently a big knowledge, but it seems impossible to generate a HTML report just like junitreport. (1 line in an ANT task)
    I test the XSLT transformation found on this forum (thread "XSLT pmd.xml -> html"). It's really cool. But it's seems difficult, for example, to extract the wrong code part and add it to the HTML page.
    So, what is the simpler solution to generate HTML report just with FlexPMD/ANT ?
    Thanks !

    Hello,
    Currently you generate a PMD report with ANT  like this :
    <! -- define taskdef  -->
    < taskdef name="pmd"  classname="com.adobe.ac.pmd.ant.FlexPmdAntTask"  classpath="${build.pmd.loc}/flex-pmd-ant-task-${flexpmd.version}.jar">
             < classpath>
                 < path refid="flexpmd.base" />
                 < pathelement  location="${build.pmd.loc}/commons-lang-2.4.jar" />
                 < pathelement  location="${build.pmd.loc}/flex-pmd-core-${flexpmd.version}.jar" />
                 < pathelement  location="${build.pmd.loc}/flex-pmd-ruleset-api-${flexpmd.version}.jar"  />
                 < pathelement  location="${build.pmd.loc}/flex-pmd-ruleset-${flexpmd.version}.jar"  />
                 < pathelement  location="${build.pmd.loc}/plexus-utils-1.0.2.jar" />
             < /classpath>
    < /taskdef>
    then generate XML  report like this :
    < pmd  sourceDirectory="${src.loc}" outputDirectory="${report.loc}"  ruleSet="${build.pmd.loc}/rules.xml"/>
    The  XML contains some file nodes :
    < file  name="/Users/user/workspace/AS3_UTILS/src/utils/align/gridAlignSpaceNumber.as">
           < violation beginline="22" endline="22" begincolumn="0"  endcolumn="27" rule="adobe.ac.pmd.rules.naming.TooShortVariable"  ruleset="All Flex Rules" package="utils.align"  class="gridAlignSpaceNumber.as" externalInfoUrl="" priority="5">This  variable name is too short (3 characters minimum, but 1 actually).  Detects when a field, local, or parameter has a very short name<  /violation>
    < /file>
    The  message is in the text node  < violation>TEXT< /violation>
    For  me, we miss an important part of the message : the portion of the "bad"  code.
    It could be very usefull if PMD can generate  something like this :
    < file  name="">
           < violation beginline="" endline="" begincolumn=""  endcolumn="" rule=""  ruleset="" package=""  class="gridAlignSpaceNumber.as" externalInfoUrl="" priority="">
            < description>TEXT< /description>
            < code><CDATA[MY CODE
    MY CODE
    MY CODE]>< /code>
        <  /violation>
    < /file>
    With this, we can  generate "full" HTML report with XSLT transform easily.
    I  understand that it modify the standard XML schema of the output.
    So,  perharps it could be an option like this :
    < pmd fullDescription="true"  sourceDirectory="${src.loc}"  outputDirectory="${report.loc}"  ruleSet="${build.pmd.loc}/rules.xml"/>
    What do you think ?
    Thanks !

  • Problem with SUBMIT report [ WITH SELECTION-TABLE ] or [ IN range ]

    Hello Everybody,
    I am trying to call transaction F.80 for mass reversal of FI documents by using SUBMIT sentence and its parameters like this:
      LOOP AT i_zfi013 INTO wa_zfi013.
        PERFORM llena_params USING 'BR_BELNR' 'S' 'I' 'EQ' wa_zfi013-num_doc ''.
    range_line-sign   = 'I'.
    range_line-option = 'EQ'.
    range_line-low    = wa_zfi013-num_doc.
    APPEND range_line TO range_tab.
    endloop.
    Line: -
          SUBMIT sapf080
            WITH br_bukrs-low = p_bukrs
            WITH SELECTION-TABLE it_params  [ same  problem with -  WITH BR_BELNR IN range_tab]
            WITH br_gjahr-low = p_an1
            WITH stogrd = '05'
            WITH testlauf = ''
            AND RETURN.
    My problem is that  when the report is executed the BR_BELNR only delete one document of the all the inputs in the selection criteria from the loop. if I add the statement [ VIA SELECTION-SCREEN] in the SUBMIT if open the multiple selection criteria in the screen I can check that all the documents are set in it from the ABAP code in the loop from it I just need to push F8 to copy them and run the program processing all the documents normally .
    Can some one help me with this? is there a way to execute the transaction BY the SUBMIT with the multiple selection criteria for the Document Number working well?
    Thank for you time and help.

    This is my code:
      TYPES: BEGIN OF T_ZFI013,
              BUKRS     TYPE BUKRS,
              GJAHR     TYPE GJAHR,
              MONAT     TYPE MONAT,
              ANLN1     TYPE ANLN1,
              ANLN2     TYPE ANLN2,
              NUM_DOC     TYPE BELNR_D,
              DATE     TYPE DATUM,
              TIME  TYPE UZEIT,
              USER     TYPE SYUNAME,
             END OF T_ZFI013.
       DATA: I_ZFI013  TYPE STANDARD TABLE OF T_ZFI013,
             WA_ZFI013 TYPE T_ZFI013,
      DATA: br_belnr       TYPE BELNR_D,
            rspar_tab  TYPE TABLE OF rsparams,
            rspar_line LIKE LINE OF rspar_tab,
            range_tab  LIKE RANGE OF br_belnr,
            range_line LIKE LINE OF range_tab."range_tab.
      LOOP AT i_zfi013 INTO wa_zfi013.
        range_line-sign   = 'I'.
        range_line-option = 'EQ'.
        range_line-low    = wa_zfi013-num_doc.
        APPEND range_line TO range_tab.
      ENDLOOP.
      SUBMIT sapf080
        WITH br_bukrs-low = p_bukrs
        WITH br_belnr IN range_tab
        WITH br_gjahr-low = p_an1
        WITH stogrd = '05'
        WITH testlauf = ''.
    This is the RANGE_TAB table before submit:
    1     I     EQ     1001xxxxxx
    2     I     EQ     1002xxxxxx
    3     I     EQ     1003xxxxxx
    4     I     EQ     1004xxxxxx
    5     I     EQ     1005xxxxxx
    6     I     EQ     1006xxxxxx
    7     I     EQ     1007xxxxxx
    8     I     EQ     1008xxxxxx
    I think this wont work for some reason so I will start to do this by a BDC.
    Many thanks for your help.

  • Submit report with internal table

    Hi Experts !
    I have a requirement where report is showing output in ALV1. Based user action I need to process further in background mode.
    I have developed a report which I am submitting for this background mode.
    I am opening a Job sumbitting created report with return. Job close.
    This created report is in scheduled status in SM37. I have to go there and release it.
    To pass parameters to newly created report I have used WITH field names with developed report name. But I am not getting parameters at new report. Similarly used import/export --- set/get but still not getting parameters at submitted report.
    Is it because it is in background mode? If so how can I achieve this functionality. Can anybody suggest me something ?

    Hi,
    IMPORT and EXPORT from memory doesn't work here.
    Have a look into the SAP documentation:
    When the program is scheduled in the background task, the selections specified by the user or in the additions for filling the selection screen are stored in an internal variant. When the program is executed in the background request, it is processed fully but the selection screen is processed in the background. The system triggers all events, including that for selection screen processing. The variant stored internally is transferred to the selection screen between the INITIALIZATION and AT SELECTION SCREEN OUTPUT events.
    The transfer of the parameters should work, if you don't have any statements that clear those parameters. Maybe parameters with SET/GET parameters also will cause a problem. But it should work with this internal variants. Before you start the jov, please have a look in those generated variants, whether the parameters have the right values.
    Regards,
    Klaus
    Edited by: Klaus Babl on Feb 8, 2011 6:58 AM

  • Need to create form on a table with report with a table has NO primary key

    Hi, I tried to created some insert/update/delete form+report in an application, it works fine only if the table has primary key. Does anyone know how to create the same functionality with a table with no primary key? I saw an application is built on older version of htmldb that is using tables with no primary keys at all.
    Here are the specific issues that I am facing:
    - I am building some Form on a table with Report, it requires the table with primary key for form to update. Is there a workaround that I can use tables that has no primary keys at all?
    - Say if primary key is necessary in the previous report+form, but the maximum number of columns that I can use to composed a primary is only 2 for that Form-Report, I cannot find anything handling > 2 primary key. Do you know if there are some ways to composite a primary key from many columns together?
    Your help is really appreciated.
    Thanks,
    Angela

    Sorry to ask response so late. I had no time to get back to that issue before.
    Regarding the triggers, I can make it work for the update, but not the insert.
    Here is my trigger:
    create or replace trigger STATUS_T1
    instead of insert on STATUS
    begin
    insert into STATUS ("LABEL", "AREA", "OWNER", "TEST_NAME", "STATUS", "REMARKS", "BUGS", "DEV_MGR", "TEST_BY_DATE")
    values(:new.LABEL, :new.AREA, :new.OWNER, :new.TEST_NAME, :new.STATUS, :new.REMARKS, :new.BUGS, :new.DEV_MGR, :new.TEST_BY_DATE);
    end;
    by any chance, you can notify what is wrong?
    I already skip the ROWID when inserting to the view STATUS, but I cannot figure out what is wrong when inserting a new record to that view.
    It gave me the following errors:
    ORA-06550: line 1, column 38: PL/SQL: ORA-00904: "ID": invalid identifier ORA-06550: line 1, column 7: PL/SQL: SQL Statement ignored
    Error Unable to process row of table STATUS
    Then, I turned to debug mode, I am thinking that maybe because I use a HIDDEN item to hold the value of ROW_ID as I use the rowid (called ID in the view) to retrieve the record as a column link from previous page. What do you think?
    Thanks again,
    Angela

  • Generic Extraction By Using function Module with Three Table fields?

    Hi,
    I need to bring the data from three tables by using function module.
    Tables: VBAK, VBAP, VBUK.
    Fields are: VBELN, ERDAT, NETWR, WEARK, POSNR, MATNR, FKART, FKTYP.
    i referred some of the documents in SDN, it explained by using two table fields.
    Please help me.

    hi, the below pseudo code should help you on creating the logic. It's based on the how to paper. So i just used the parts of intrest. You need to copy the rest form the document. Please notice that this is pseudo code. if you just copy/paste, it will not work.
    IF s_counter_datapakid = 0.
    OPEN CURSOR WITH HOLD s_cursor FOR
           SELECT fields       FROM table1         WHERE condition
          ENDIF.                             "First data package ?
    * Fetch records into interface table.
    *   named E_T_'Name of extract structure'.
          FETCH NEXT CURSOR s_cursor
                    INTO  TABLE e_t_data
                    PACKAGE SIZE s_s_if-maxsize.
         IF sy-subrc EQ 0.
           SELECT fields      FROM table2      WHERE condition into itab2 for all entries in e_t_data
           SELECT fields      FROM table3       WHERE condition into itab3 for all entries in e_t_data    
         loop at e_t_data
              read itab2. move corresponding fields to e_t_data
              read itab3. move corresponding fields to e_t_data
              collect e_t_data.
         endif.
    IF sy-subrc <> 0.
           CLOSE CURSOR s_cursor.
           RAISE no_more_data.
         ENDIF.
         s_counter_datapakid = s_counter_datapakid + 1.
       ENDIF.              "Initialization mode or data extraction ?

  • Multi step form with three tables

    Hi:
    I have a database with 3 tables. Table 1 has one-to-many
    relationship with two others. Infact in table 1 user should enter
    his basic info and details will be submited itno two other tables.
    Is there any easy way to make it with DW/colfusion?
    I know that session may help but it is needed that each page
    can submit information (if the user doesn't fill the last form them
    I may loose data with session)
    I thought of sending information to other page with form
    action="page.cfm" but my problem is I don't know how to submit
    information in the second form that the primary key of table one
    becoms the foreign key of the next page. Please please I really
    need this. I really need it.
    Thanks
    Benign

    Hi:
    Thanks for the reply. In fcat I have to put them in different
    pages because they have many many fields.
    Is there any easy way to do it?
    My project is about patients registration database. I am a
    medical doctor and know some about coldfusion and some about SQL. I
    am doing this project for the patient and free of charge and I can
    not hire any professional programmer. My research center has boght
    a Coldfusion Web server (Webserve.ca) and we are in hurry to
    register the patients and organize their data to manage their
    cancer problems or alarming them for future personal/familial
    follow ups.(purchasing the host was a problem then {because of the
    money shortage}but solved fortunately)
    The cancer information tables are about 10 tables and a
    parent table for patients general/personal information.
    I tried to build it with coldfusion/dreamweaver wizards but I
    have many problems. There is no coldfusion expert avaiable as I
    said (as you know there is a shortage of money in research centers)
    and the solution is something that the patients really need.
    It will be great if some one helps me. Surely the name of the
    this project savior (you are really a savior of many if you help)
    will be a part of the prject.
    Thanks
    Benign

Maybe you are looking for

  • Using Multiple Apple TV's with One Account

    I am thinking of installing multiple Apple TV's in my home so we can rent/buy movies in different rooms. Is their any limitation of how many can be logged in at one time? Can I be downloading to multiple ATV's at the same time using the same account?

  • Ipod shuffle second gen won't sync properly

    Does anyone else have an Ipod and a Netgear SC101? It appears there is a conflict with the drivers. Unfortunately I can't really afford to replace the SC101 with an alternate form of storage and there really isn't a replacement for the shuffle on the

  • Down Payment in Deferred Service tax Scenario

    Hello all Has any1 come across a scenario where there is a Down Payment reciept from the customer, then an invoice is raised for the same and clearing is done and the balance amount is recieved from the customer in F-28. Then the T.Code S_AC0_5200064

  • Color mismatch Windows 8.1 and Acrobat X and XI Pro

    I am creating a PDF from Excel 2013 using both Acrobat X and Acrobat XI on my ASUS laptop running Windows 8.1.  Text that is blue in Excel 2013 looks purple both in the PDF and when viewing the uploaded PDF in Internet Explorer.  The text in the PDF

  • The book "" was not copied to the iPad because it requires a newer version of ibooks

    Hi - i've been working on a textbook in iboos author for a week and have been using preview as well as the "file / Export" function to copy the book to my ipad 3. Now all of a sudden, I am getting this strange "..requires a newer version of ibooks" e