Re: WebDB Dynamic Linking - Success!

From: Jerre Hale <jhale_at_gmu.edu>
Date: 2000/05/01
Message-ID: <390D7E1D.C7689A3D_at_gmu.edu>


Thanks Guys!

                  I appreciate all of you suggestions and advice.  Here is
the result:
                  Function:
                  --
                       -- FUNCTION JHALE.HYPER_LINK2
                       -- created Friday    28-APR-2000 14:35
                       --
                       create or replace
                       function       HYPER_LINK2(
                           action IN VARCHAR2,
                           row_id IN VARCHAR2,
                           html_value IN VARCHAR2)
                       return VARCHAR2
                       is
                       url VARCHAR2(256);
                       begin
                       url := '<A HREF="jhale.jhale_form_' || ACTION ||

'.show?P_ARG_NAMES=_ROWID&P_ARG_VALUES=' ||ROW_ID
                  ||

'">' ||html_value ||'</A>';
RETURN url; end;/ and the SQL Report script: select '<A HREF="JHALE.JHALE_FORM_kjgmu016' || JOBNAME ||'.show?p_arg_names=_rowid&p_arg_values=' ||JOBNUMBER || '">' ||JOBNAME || '</A>' AS "JOBNAME", print jobname ========================================================= --- In WebDB_at_egroups.com, "Jan Z Grootveld" jang2000_at_z... wrote: > Hi, > > If I understand you well, the form you choose after the report in some way > dependes on the data you retrieve. > You should program this decision into a function which takes the parameters > you would use to decide which form to take, and embed this function in the > query on which your report is based. Result of the function is the form you > want to choose, as a part of the anchor tag as described by Leo. > > In Leo's example the form you link to is a parameter. For your problem, if I > understand it well, this is not quite appropriate. The solution is however > near: pass a parameter to the function on which you base the decision, > instead of taking this parameter as target in your URL. > > Try the following example (I've even tested it, it's ready-to-go on a normal > database having a fully equipped scott schema): > [ > Create or replace FUNCTION hyper_link ( p_deptno IN number, > p_row_id IN VARCHAR2, > p_value IN varchar2) > RETURN VARCHAR2 > IS > url VARCHAR2(256); > BEGIN > if p_deptno = 20 > then > -- for example, the research department uses a different form than other > departments > url := '<A HREF="SCOTT.FORM_EMP_U.show' || > '?p_arg_names=_rowid&p_arg_values=' ||p_row_id || > '">' || p_value || > '</A>'; > else > url := '<A HREF="SCOTT.FORM_EMP_S.show' || > '?p_arg_names=_rowid&p_arg_values=' ||p_row_id || > '">' || p_value || > '</A>'; > end if; > RETURN url; > END hyper_link; > / > ] > > And the SQL report: > [ > select > SCOTT.hyper_link(deptno, rowid, ename) Employee > ,job Job > from SCOTT.EMP > ] > Note that you always have to provide a label name for every aggregated field > in a SQL report, otherwise WebDB won't parse it. > > > ----- Original Message ----- > From: jhale_at_g... > To: WebDB_at_egroups.com > Sent: Tuesday, April 25, 2000 9:54 PM > Subject: [WebDB] WebDB Dynamic Linking > > > > Let me try this question again. > > > > Scenario: I have three forms and three reports. I am successful in > > linking individuals reports to individual forms, like report A to > > form > > A, report B to form B and report C to form C. I have also created a > > report that reports the data of all of the forms and linked it to one > > specific form but this is a generic form. > > > > I need to create a report that I can link back to the original form > > in > > which the data was inputted. Example; the report will generate > > Jobnumber, Jobname and other data. Jobnumber is a unique identifier > > that is included in all of the forms. So, if Jobnumber 1 has a > > Jobname of A, I want to link to form A and display the data, if the > > Jobname is B, I want to link to form B and display the data. > > > > As I said before, I can do this from specific report to specific form > > and also from all reports to a specific, generic form, but I cannot > > come up with a solution to dynamically link to the original form and > > display the data. > > > > Please respond, even if you do not have a solution. I need to know > > that someone is really out there. > > > > Thanks, > > > > Jerre > > > > > > > >

Zdenek Zavadil wrote:

> In article <3905F76D.6F80B288_at_gmu.edu>,
>   Jerre Hale <jhale_at_gmu.edu> wrote:
> > Let me try this question again.
> >
> > Scenario:  I have three forms and three reports.  I am successful in
> > linking individuals reports to individual forms, like report A to form
> > A, report B to form B and report C to form C.  I have also created a
> > report that reports the data of all of the forms and linked it to one
> > specific form but this is a generic form.
> >
> > I need to create a report that I can link back to the original form in
> > which the data was inputted.  Example; the report will generate
> > Jobnumber, Jobname  and other data.  Jobnumber is a unique identifier
> > that is included in all of the forms.  So, if Jobnumber 1 has a
 Jobname
> > of A, I want to link to form A and display the data, if the Jobname  is
> > B, I want to link to form B and display the data.
> >
> > As I said before, I can do this from specific report to specific form
> > and also from all reports to a specific, generic form, but I cannot
 come
> > up with a solution to dynamically link to the original form and  display
> > the data.
> >
> > Please respond, even if you do not have a solution.  I need to know
 that
> > someone is really out there.
> >
> > Thanks,
> >
> > Jerre
> >
> >
>
> Hi Jerre!
> If you choose Report from SQL Query, you can build the link as you want.
> Your SELECT could look like:
> SELECT
>   '<A HREF="schema.form_jobname_' || Jobname ||
> '.show?p_arg_names=_rowid&p_arg_values=' || Jobnumber || '">' ||
> Jobname || '</A>' as "Job name",
>   ...
> FROM schema.table
> WHERE ...
>
> So for example, if Jobnumber 1 has a Jobname of A, you will get the
> link to schema.form_jobname_A (in which don't forget to set the
> Alternate ROWID to Jobnumber).
>
> Regards,
>   Zdenek
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Mon May 01 2000 - 00:00:00 CEST

Original text of this message