Home » Developer & Programmer » Reports & Discoverer » Problem while generating the report (Windows 7, Oracle Form 6i, Oracle Report 6i)
Problem while generating the report [message #605607] Sat, 11 January 2014 23:20 Go to next message
lock_heart
Messages: 36
Registered: November 2013
Member
I have table named booking_chart with following structures

CREATE TABLE booking_chart  ( book_code     NUMBER
                            , firm_code     NUMBER
                            , firm_name     VARCHAR2(300)
                            , source_one    VARCHAR2(200)
                            , to_desti      VARCHAR2(200)
                            , source_two    VARCHAR2(200)
                            , book_date     DATE
                            , serial_no     NUMBER(10)
                            , seat_no       VARCHAR2(100)
                            , total_seats   VARCHAR2(100)
                            , luggage       VARCHAR2(200)
                            , location      VARCHAR2(200)
                            , amount        NUMBER(10,2)
                            , total_amount  NUMBER(10,2)
                            , CONSTRAINT firm_code_fk FOREIGN KEY (firm_code) REFERENCES firm_info (firm_code) ON DELETE CASCADE
                            )



with the data as follows :-

SELECT  book_code, firm_name, source_one, to_desti, source_two, book_date, serial_no, seat_no, total_seats, luggage, location, amount, total_amount
FROM    booking_chart

1  AXEL BLAZE 	NEY YORK 	LONDON 	NEY YORK 	16-Jan-2014	1	10 	60 	YES NEW YORK 1000	23000
1  AXEL BLAZE 	NEY YORK 	LONDON 	NEY YORK 	16-Jan-2014	2	20 	60 	YES NEW YORK 1000	23000
1  AXEL BLAZE 	NEY YORK 	LONDON 	NEY YORK 	16-Jan-2014	3	30 	60 	YES LONDON   3000	23000
1  AXEL BLAZE 	NEY YORK 	LONDON 	NEY YORK 	16-Jan-2014	4	40 	60 	NO  LONDON   3000	23000



and the screen shot of the form is also given below

/forum/fa/11598/0/

now my question is I want to generate report based on book_code with same format as form
can anyone tell me how to do this...
  • Attachment: report.jpg
    (Size: 121.47KB, Downloaded 2000 times)
Re: Problem while generating the report [message #605614 is a reply to message #605607] Sun, 12 January 2014 03:53 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
That's a simple master-detail report. It requires one query (which will have two groups, one of them containing "master" fields and another one "details") or two joined queries (again, one of them would represent "master" data, another one "details").
Re: Problem while generating the report [message #605618 is a reply to message #605614] Sun, 12 January 2014 05:33 Go to previous messageGo to next message
lock_heart
Messages: 36
Registered: November 2013
Member
Thanks for your reply....
I'll try and tell you the result...
Re: Problem while generating the report [message #605635 is a reply to message #605618] Sun, 12 January 2014 23:23 Go to previous messageGo to next message
dark_prince
Messages: 121
Registered: June 2013
Location: India
Senior Member
Thanks its worked...I got problem in form of booking chart which screen shot i've uploaded in my previous post...
Problem is during updation... I have uploaded the update code

FOR i IN first_rec..last_rec
LOOP
    IF :BOOKING_INFO.serial_no IS NOT NULL
	THEN
	    UPDATE    booking_chart
	    SET       book_code			=	:BOOKING_CHART.book_code
		    , firm_code			=	:BOOKING_CHART.firm_code
		    , firm_name			=	:BOOKING_CHART.firm_name
		    , source_one		=	:BOOKING_CHART.source_one
		    , to_desti			=	:BOOKING_CHART.to_desti
		    , source_two		=	:BOOKING_CHART.source_two
		    , book_date			=	:BOOKING_CHART.man_no
		    , serial_no			=	:BOOKING_INFO.serial_no
		    , seat_no			=	:BOOKING_INFO.seat_no
		    , total_seats		=	:BOOKING_INFO.total_seats
		    , luggage			=	:BOOKING_INFO.luggage
		    , location			=	:BOOKING_INFO.location
		    , amount			=	:BOOKING_INFO.amount
		    , total_amount       	=	:BOOKING_CHART.total_amount
	   WHERE      book_code			=	:BOOKING_CHART.book_code
	   [color=red]AND	      serial_no			=       :BOOKING_INFO.serial_no[/color];
	   next_record;
	END IF;
END LOOP;



Layout Style of BOOKING CHART is FORM and of BOOKING INFO is TABULAR.
If I want to update particular field from booking_info like for luggage YES from NO then it works as because I used AND operator in it but if i want to
add new row in booking info then its not working means i can add row in form but when i commit the data i can't find the new row. If i remove the AND operator then I can add new row but all other data also get changed.
Can anyone tell me whats wrong and sorry for writing the post in REPORTS
Re: Problem while generating the report [message #605640 is a reply to message #605635] Mon, 13 January 2014 00:18 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It appears that you want to change records that are displayed on the screen. You code performs UPDATE of a database table. Why do you do it that way? Aren't those form blocks data blocks (i.e. created on underlying database tables)? If so, why don't you use that fact and modify form items directly and save changes "normally", with Forms' commit? The way you are doing it now, you have to requery the detail block so that it reflects changes you've made with the UPDATE statement.

Also, use what Forms offers: master-detail relationship, "copy value from item" item property and similar stuff, which makes your life easier (i.e. you don't have to write your own code that much).
Re: Problem while generating the report [message #605642 is a reply to message #605640] Mon, 13 January 2014 00:41 Go to previous messageGo to next message
dark_prince
Messages: 121
Registered: June 2013
Location: India
Senior Member
My both data blocks are manually created...so how can i commit the data block without using update statement if i am right...
Both data blocks are part of database table booking_chart
Re: Problem while generating the report [message #605645 is a reply to message #605642] Mon, 13 January 2014 01:40 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It doesn't matter whether you created a block manually or with the Wizard (although, why wouldn't you use Wizard?!?) - what matters is whether these blocks are data blocks or control blocks.
Re: Problem while generating the report [message #605658 is a reply to message #605645] Mon, 13 January 2014 03:30 Go to previous messageGo to next message
dark_prince
Messages: 121
Registered: June 2013
Location: India
Senior Member
Those are control blocks (Database property set to no)
Re: Problem while generating the report [message #605659 is a reply to message #605658] Mon, 13 January 2014 03:41 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
That makes things more difficult than they should be. With data blocks, Forms does many tasks for you. With control blocks, you have to do everything (querying, inserting, updating, deleting) manually. Why did you make such a (bad) decision (i.e. using control blocks)? Although you could "fix" all problems you have, I believe that you'd be - in a long term - much more happy if you just rewrite the form from scratch, using Data Block Wizard this time, letting it create master-detail relationship.
Re: Problem while generating the report [message #605660 is a reply to message #605659] Mon, 13 January 2014 03:54 Go to previous message
dark_prince
Messages: 121
Registered: June 2013
Location: India
Senior Member
Thanks I'll try and tell you the result
Previous Topic: Report Printing Sequence Change?
Next Topic: Unable to Edit
Goto Forum:
  


Current Time: Thu Mar 28 05:25:52 CDT 2024