Home » Developer & Programmer » Forms » genertaing report through forms
genertaing report through forms [message #125684] Tue, 28 June 2005 11:42 Go to next message
kcoreyl
Messages: 8
Registered: June 2005
Junior Member
Hi everyone,

I am trying to generate reports through Oracle Forms. I have already devloped the reports. Basically, what i want to do is have the user select a report from a list box and, when they select it, click the push button to run the report. I have already defined the list by manually typing in the names of the reports using the "Elements in List" property. I just need to know how to pass the List Item Value assoicated with the name of the report i typed in to the push button in order for the user to generate the selected report.

Kendric
Re: genertaing report through forms [message #126651 is a reply to message #125684] Wed, 06 July 2005 02:02 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Put the information into a second column with which you can then populate an item field. Then use this item field to build your run report statement.

David
Re: genertaing report through forms [message #126654 is a reply to message #125684] Wed, 06 July 2005 02:27 Go to previous messageGo to next message
kv_anitha
Messages: 3
Registered: July 2005
Location: Bangalore
Junior Member
Hi,
say u have 3 reports R1,R2 and R3 in the listbox.
Declare a variable X.
On change of listbox or on selection of report move some id to the variable.
eg. if u select report R1 then move value to X as R1.
similarly for report R2, value of X=R2.
On pushbutton, when button pressed
if x=R1 then
run_report(call the report R1)
else
run_report(call the report R2)
end if;

Pls try the above and let me know. Hope this is what u need.

All the best.

Regards
Ani
Re: genertaing report through forms [message #127979 is a reply to message #126654] Thu, 14 July 2005 08:05 Go to previous messageGo to next message
kcoreyl
Messages: 8
Registered: June 2005
Junior Member
Hey, a couple of questions...

1) Do I declare the X variable in the WHEN-LIST-CHANGED or the WHEN-BUTTON-PRESSED.

2) How would I call the List Item Value of R1 (the value associated with the name in my listbox) in my push button or in the WHEN-LIST-CHANGED. I understand moving R1, R2, or R3 into some declared variable, but how do you call R1?
Re: genertaing report through forms [message #128069 is a reply to message #127979] Thu, 14 July 2005 18:00 Go to previous messageGo to next message
Another Arbitrary Name
Messages: 23
Registered: July 2005
Junior Member
It looks like you have already done the hard bit and created the dynamic List items (although I would put the data into a database table where its more maintainable!).

place the code on either:
WHEN_BUTTON_PRESSED for your button
WHEN_LIST_CHANGED for an automatic selection

but the only code you need is:
MESSAGE(:r1); --check its what you think it is first.
RUN_REPORT(:R1); --please check syntax.

This will pass the value of the LISTITEM to the RUN_PRODUCT builtin.
Re: genertaing report through forms [message #128085 is a reply to message #127979] Thu, 14 July 2005 23:03 Go to previous messageGo to next message
kv_anitha
Messages: 3
Registered: July 2005
Location: Bangalore
Junior Member
Hi u need to declare a global variable and use it accross the when button clicked and when list changed trigger.

regards
Ani
Re: genertaing report through forms [message #128190 is a reply to message #128085] Fri, 15 July 2005 11:01 Go to previous messageGo to next message
Another Arbitrary Name
Messages: 23
Registered: July 2005
Junior Member
kv_anitha wrote on Thu, 14 July 2005 23:03

Hi u need to declare a global variable and use it accross the when button clicked and when list changed trigger.

regards
Ani



You could, but the list item (should) already hold the value that you would place in the Global, I would just use that.

or am I missing something? (I haven't used client-server for a while)

:listitem
List item label#1: "REPORT 1"
List item value#1: "rep1.rdf"
List item label#2: "REPORT 2"
List item value#2: "rep2.rdf"

WHEN_ITEM_CHANGED:
RUN_REPORT(:listitem); --:listitem = "repX.rdf"
Re: genertaing report through forms [message #128193 is a reply to message #128190] Fri, 15 July 2005 11:15 Go to previous messageGo to next message
kcoreyl
Messages: 8
Registered: June 2005
Junior Member
ok, so i kinda got things going. for the WHEN-LIST-CHANGED, i have it to where a message comes up telling me the value of the report i'm highlighting in my list box. and for WHEN-BUTTON-PRESSED, i have:

IF :LIST = 'R1' (the value of the list element) THEN
report_id := find_report_object('REPORT13');
ReportServerJob := run_report_object(report_id);

But now I'm having ANOTHER issue (i swear if it's not one thing, it's another). I found out that RUN_PRODUCT is not supported by Forms 10g, so i had to figure out how to use RUN_REPORT_OBJECT. But this is generating an error:

FRM-92101: There was a failure in the Forms Server during startup. This could happen due to invalid configuration...

Anyone have a lead as to what I could be doing wrong? I appreciate your help thus far =)
Re: genertaing report through forms [message #128330 is a reply to message #128193] Mon, 18 July 2005 01:05 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Can you get any report to run under 10g? For example, the test report?

David
Re: genertaing report through forms [message #128423 is a reply to message #128330] Mon, 18 July 2005 08:11 Go to previous messageGo to next message
kcoreyl
Messages: 8
Registered: June 2005
Junior Member
the reports themselves run just fine, it's jus calling it from Forms is where the issue lies...
Re: genertaing report through forms [message #128476 is a reply to message #128423] Mon, 18 July 2005 17:36 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
If you are using 10g then look at using 'web.show_document'. Your report server is probably not running and running the report using run_report_object does not start it.

Search for show_document in this forum or google. Eg. http://www.orafaq.com/forum/m/124016/67467/?srch=show_document#msg_124016 and http://www.orafaq.com/forum/m/85496/67467/?srch=show_document#msg_85496

David

[Updated on: Mon, 18 July 2005 17:39]

Report message to a moderator

Previous Topic: Iconic Push Buttons in 6i
Next Topic: Precedence of Database SP and Forms Procedures
Goto Forum:
  


Current Time: Thu Sep 19 20:21:20 CDT 2024