# Oracle Portal and Oracle BI Publisher

If you are using Oracle Portal and are used to using the Portal Forms Builder, you may want to create parameter forms for your BI reports in the Portal Forms Builder. This article provides a methodology for generating and redirecting to the BI Publisher URL from a Portal Form.  
  
Step 1: Create a package that will do the redirect for you given the appropriate parameters.  
  

> \--  
> \--  
> create or replace  
> package bip1 as  
> g\_url varchar2(32767);  
>   
> \-- add additional parameters as required  
> procedure bip\_r  
> (  
> p\_xf IN VARCHAR2 DEFAULT NULL,  
> p\_custom1name IN VARCHAR2 DEFAULT NULL,  
> p\_custom1val IN VARCHAR2 DEFAULT NULL,  
> p\_custom2name IN VARCHAR2 DEFAULT NULL,  
> p\_custom2val IN VARCHAR2 DEFAULT NULL);  
> end;  
> /  
>   
> \--  
> create or replace  
> package body bip1 as  
>   
> procedure bip\_r  
> (  
> p\_xf IN VARCHAR2 DEFAULT NULL,  
> p\_custom1name IN VARCHAR2 DEFAULT NULL,  
> p\_custom1val IN VARCHAR2 DEFAULT NULL,  
> p\_custom2name IN VARCHAR2 DEFAULT NULL,  
> p\_custom2val IN VARCHAR2 DEFAULT NULL)  
> as  
> \-- for information on determining the URL below, see  
> \-- http://blogs.oracle.com/xmlpublisher/2006/07/accessing\_xmlp\_enterprise\_repo.html  
> l\_url varchar2(32767) := 'http://\[Your\_BIP\_Server\]:9704/xmlpserver/\[your\_folder\]/\[your\_report\]/\[your\_report\].xdo?\_xpf=&\_xpt=1&...';  
> begin  
> l\_url := l\_url || '&\_xf=' || p\_xf || '&'  
> || p\_custom1name || '=' || p\_custom1val || '&'  
> || p\_custom2name || '=' || p\_custom2val ;  
>   
> bip1.g\_url := l\_url;  
> end;  
> end;  
> /  

  
  
Step 2: Create a Portal Form against a procedure and choose the bip1.bip\_r procedure.  
  
Step 3: Modify the Portal Form  
  

> a. p\_xf is the allowable output formats: html, pdf, csv, etc.  
> b. p\_custom1name (and all p\_custom#name items) should be hidden and should be the name of your BI Publisher report variables  
> c. p\_custom1val (and all p\_custom#val items) are the values you want your users to enter, associated with the corresponding p\_custom#name  
> d. At the Portal Form level, where you see the text area following  
> 
> > On successful submission of a form, execute this PL/SQL block or PL/SQL procedure:  
> > Hint:  
> > You can redirect your browser to a PL/SQL procedure, for example a procedure that creates a Web page, using either of these methods:  
> >   
> > 1\. call('', '');  
> > Redirects the browser to the procedure and passes a parameter containing the URL back to the form.  
> > 2\. go('');  
> > Redirects the browser to the procedure but does not pass a URL to return to the form.
> 
>   
>   
> Enter: go(bip1.g\_url);

  
  
Running this form will redirect you to the correct BI Publisher URL.
