Home » Developer & Programmer » Forms » report problem (oracle 10g, win 7.)
report problem [message #589230] Wed, 03 July 2013 09:48 Go to next message
reallyoldturtle
Messages: 15
Registered: June 2013
Junior Member
Hi!

I have a payment table that has the ids of cds that has being sold in the past month. From there I want to make a demand wise report. I am aware of the report wizard in the oracle forms but I dont want to use it. Any tips? Here are the tables in a bit more details.

payment: id_cd, price, dateofsell
cd_details: id_cd, name, price, language.



Re: report problem [message #589231 is a reply to message #589230] Wed, 03 July 2013 09:52 Go to previous messageGo to next message
Littlefoot
Messages: 21811
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
You want a report, but talk about Forms. What do you want, then? A form (using Forms Builder), or a report (using Reports Builder)? What would "a demand wise report" be? How do you want to "demand" it?
Re: report problem [message #589232 is a reply to message #589231] Wed, 03 July 2013 09:58 Go to previous messageGo to next message
reallyoldturtle
Messages: 15
Registered: June 2013
Junior Member
A demand wise report will be a report generated of the demands. For example, the biggest selling cd's name will be first in the list, followed by 2nd biggest selling and so on.. is there any way to do it? and yes, i want to display this in a form.
Re: report problem [message #589233 is a reply to message #589232] Wed, 03 July 2013 10:04 Go to previous messageGo to next message
Littlefoot
Messages: 21811
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
One option is to create a view (which would join two tables you mentioned) and display data in a manner you are interested in. Then, in a form, you'd create a (data) block based on that view. Another, control block, would be used for a list of "demands"; for example, sort by number of sold copies, sort by prices ascending/descending, etc. You'd use radio buttons to do that. Based on a selection, using SET_BLOCK_PROPERTY, you'd set datablock's ORDER BY property and, finally, execute query.
Re: report problem [message #589234 is a reply to message #589233] Wed, 03 July 2013 10:21 Go to previous messageGo to next message
reallyoldturtle
Messages: 15
Registered: June 2013
Junior Member
The problem is I'll have to display records from the cd_details table in according to the descending order of count(id_cd) of the payment table ! How to do that ? For eg, if id_cd =1 has 5 entries and id_cd=2 has 4 entries in the payment table then the output will be :

id_cd name language price
1 dark knight english 599
2 mama mia english 477
Re: report problem [message #589238 is a reply to message #589234] Wed, 03 July 2013 10:34 Go to previous messageGo to next message
Littlefoot
Messages: 21811
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I told you - SET_BLOCK_PROPERTY & its ORDER_BY property. You'll have to create order by clause for every demand you have (yes, it means a little bit of programming). List of demands depends on you. Therefore, create a view which already contains possible demands. Here, you'd (for example)
create view v_cd as
select id_cd, name, language, price, count(*) cnt
from ...
group by ...
and - in a form - apply "order by cnt desc" to that block.
Re: report problem [message #589239 is a reply to message #589234] Wed, 03 July 2013 10:35 Go to previous message
cookiemonster
Messages: 13925
Registered: September 2008
Location: Rainy Manchester
Senior Member
As littlefoot already said - create a view.
count(id_cd) will be one of the columns of the view.
Then you can just set the order by property of the block.
Previous Topic: Search from db problemyp
Next Topic: Insert image through dialog box into oracle forms
Goto Forum:
  


Current Time: Thu Jun 13 05:13:39 CDT 2024