SRW.RUN_REPORT Passing parameter

Hello,
I am calling a report from another report.
Like the example in help, I have my call in the before report trigger.
If I call a report that does not need a parameter, it works great. However I cannot make it work when passing a parameter in.
here is what I have:
srw.run_report('report=h:\reports\GQR003GL batch=yes destype=printer p_break='||:break||' p_group_quote_iid='||:group_quote_iid);
Why is this not working?

Hello Chris,
You can have a SRW.RUN_REPORT call in your BeforeReport Trigger. Please try coding your trigger something like the one below. Take care to include the white spaces delimiters between consecutive parameters when appending them to the commandline string.
function BeforeReport return boolean is
cmdline varchar2(200);
begin
cmdline := 'BATCH=YES';
cmdline := cmdline || ' DESTYPE=PRINTER';
cmdline := cmdline || ' DESFORMAT=DFLT';
cmdline := cmdline || ' REPORT=<report_file>';
cmdline := cmdline || ' P_GROUP_QUOTE_IID=' || :group_quote_iid;
cmdline := cmdline || ' P_BREAK=' || :break;
srw.run_report(cmdline);
return (TRUE);
end;
Thanks,
The Oracle Reports Team.

Similar Messages

  • How to skip the spaces, ' etc when passing the parameter to srw.run_report?

    Hi, I have got problem with passing parameter to srw.run_report. It seems it doesn't take the special symbols such as space, ', etc.. the statement is like:
    srw.run_report('report=test1 p_name='&#0124; &#0124;:p_title);
    if :p_title is "JOE", there is no problem to pass it, but if the :p_title is "JOE LI", then the value of the parameter can be passed to p_name.
    Does any one know how to skip those special symbols in the string when passing it to srw.run_report. Thank you very much.
    Joe

    Hi,
    Try this :
    srw.run_report('report=test1 p_name='&#0124; &#0124;
    chr(34)&#0124; &#0124;:p_title&#0124; &#0124;chr(34)
    );

  • How to use srw.run_report without userid parameter in 10g

    I have the following function which works fine when I supply the userid parameter.
    Is it possible to run srw.run_report without the userid? If not is there another way to run a batch report to create a file?
    create or replace
    FUNCTION SUNRESDS(vopersorjudicial varchar2)
    RETURN VARCHAR2 as
    myPlist SRW_PARAMLIST;
    myIdent SRW.Job_Ident;
    BEGIN
    myPlist := SRW_PARAMLIST(SRW_PARAMETER('',''));
    srw.add_parameter(myPlist,'GATEWAY','http://xxx.xx.xxx.xx/reports/rwservlet');
    srw.add_parameter(myPlist,'SERVER','rep_172_FRHome1');
    srw.add_parameter(myPlist,'REPORT','d:\oracle\FRHome_1\forms\sunresds.jsp');
    srw.add_parameter(myPlist,'USERID','username/password@databasename');
    srw.add_parameter(myPlist,'DESTYPE','file');
    srw.add_parameter(myPlist,'DESFORMAT','PDF');
    srw.add_parameter(myPlist,'popersorjudicial',vopersorjudicial);
    srw.add_parameter(myPlist,'DESNAME','d:\Reports\unresolved_discrepancies.pdf');
    myIdent := srw.run_report(myPlist);
    return 'Y';
    EXCEPTION
    when others then
    return ('sunresds ' || sqlerrm);
    END;

    Did you solve your problem? How did you do?

  • FUNCTION IS NOT WORKING WHEN RUN IN SRW.RUN_REPORT, URGENT

    Hi,
    I have a report. it has got 1 Query and 2 groups.
    Q1
    |
    |
    __G1__
    |F1 |
    |F2 |
    |F3 |
    |
    |
    |
    __G2__
    |Items|
    |Sales|
    | Qty|
    |Store|
    |Func4|
    |Func5|
    |Func6|
    The Query looks like above. Now In the report I have a 3 User parameters . For Each record in G2 the functions Func4,Func5 and Func6 adds the value to the user parameters at the report level.
    Now the Func1,Func2,Func3 takes the value of last 4 record for each item at each G1 Level and devides it by 4 and prints . As an example given below
    ITEMS-----SALES-------QTY-----------STORE
    10001-----10000-------200-------------100
    10001-----20000-------500-------------200
    10001-----15000-------350-------------175
    10001-----45000-------650-------------225
    10001-----50000-------700-------------300
    AVERAGE==>32500-------550-------------225 ==> Calculated by F1,F2,F3
    20001-----70000-------900-------------400
    20001-----30000-------600-------------350
    20001-----20000-------500-------------300
    20001-----25000-------450-------------275
    20001-----35000-------550-------------225
    20001-----65000-------800-------------400
    AVERAGE==>36250-------650-------------300 ==> Avg of last 4 records
    This report takes an parameter which is part of the Where condition of the Query Q1. If I run this report from the report builder and provide the value for the parameter then the report runs fine printing the exact values. If I run the report from another report(which I have to do, due to circumstances) using SRW.Run_Report and pass the parameter in the same command. The the function FUNC4, FUNC5, FUNC6 does not do the addition, as a result the Func1,Func2,Func3 returns 0. I dont know why this is happenning .
    This is very very URGENT, My project manager is on my head to finish it ASAP. Please help.
    Thanks
    Feroz

    Hi Toby and Danny,
    Thanks for the quick reply. I dont think I am having an interdependancy of the functions. Here is an sample what two functions do at each level
    Func6 =========> This function at group level G2
    begin
    -- To initialize the user parameter for each new item.
         If :CNT = 1 Then
              :Wk4_Pos_Qty := 0;
         End If;          
    -- to add the qty value to the user parameter for last 4 records. Uchange is the no of records for each item     
    If :CNT >= :UCHANGE - 3 Then
         :Wk4_Pos_Qty := :Wk4_Pos_Qty + :Qty;
    End If;     
    return 0;
    end;
    Func3 ======> this function at group level G1
    Begin
    -- if no of records are less than 4 then devide by the no of records or devide by 4.
         If :UChange < 4 Then
                   return((:Wk4_Pos_Qty + :Qty) / :UChange);
         Else
                   return((:Wk4_Pos_Qty + :Qty)/ 4);     
         End If;     
    end;
    Here Wk4_Pos_Qty is the User parameter created to hold the calue for the Um of last 4 records Qty.
    I tried to modify the Func3 so that it looks like this
    Func3
    begin
    srw.reference(:Wk4_Pos_Qty);
         If :UChange < 4 Then
                   return((:Wk4_Pos_Qty + :Qty) / :UChange);
         Else
                   return((:Wk4_Pos_Qty + :Qty)/ 4);     
         End If;     
    end;
    But it does not effect anything. I mean its the same. The Wk4_Pos_Qty returns 0 and Func3 returns 0.
    Any Suggestions .
    Thanks
    Feroz

  • SRW.Run_Report is not working in Reports from 6i to 10g

    Hi,
    I have a report .rdf file that submits another .rdf report using the SRW.Run_Report. This code was working fine in Reports 6i version. We are upgrading the Reports 6i to Reports 10g, and did a small change in the call i.e., Removed the server parameter, and it is not working. This is in Oracle E-Business Suite environment. The first report is called as a Concurrent Program. Here is the call that was working fine in Reports 6i (i.e., Oracle Apps 11i environment)
    srw.run_report('report='||l_source_dir||l_parent_shortname||'.rdf'||
    ' p_user_id='||l_user_id||
    ' p_resp_id='||l_resp_id||
    ' p_appl_id='||l_appl_id||
    ' p_conc_request_id='||
    ' batch=yes mode=character destype=file desname='||l_destination_dir||l_filename||
    ' desformat=verp_i012 p_vendor_id='||dealer_list_rec.vendor_id||
    ' p_trx_date_from='||to_char(l_date_from, 'DD-MON-RRRR') ||
    ' p_trx_date_to='||to_char(l_date_to,'DD-MON-RRRR') ||
    ' p_period_name='||l_period_name ||                                                                      
    ' server='||l_server
    It has been modified to the following for Reports 10g (i.e., Oracle Apps R12 environment)
    srw.run_report('report='||l_source_dir||l_parent_shortname||'.rdf'||
    ' p_user_id='||l_user_id||
    ' p_resp_id='||l_resp_id||
    ' p_appl_id='||l_appl_id||
    ' p_conc_request_id='||
    ' batch=yes mode=character destype=file desname='||l_destination_dir||l_filename||
    ' desformat=verp_i012 p_vendor_id='||dealer_list_rec.vendor_id||
    ' p_trx_date_from='||to_char(l_date_from, 'DD-MON-RRRR') ||
    ' p_trx_date_to='||to_char(l_date_to,'DD-MON-RRRR') ||
    ' p_period_name='||l_period_name
    );

    Thank you for your reply.
    Yes, it's done using MOD-PLSQL version 10.1.2.0.2.
    I did as you said: compared the 2 generated HTML files. It's not that it doesn't generate all tags. It generates all tags but some of them are different, that is it screws them up.
    Here it is some example code.
    For example, in 9i I have the following code:
    div id=div_plus_GENERALE style="cursor:hand; display:none;"
    <td> width=8 </td>
    <td id=butt align=left style="font-family:Verdana,Tahoma;
    font-size: 10px; font-weight: 400; color: '#ffffff';
    background-color: '';
    "onClick="if (butt_clicked) butt_clicked.style.cssText=restore_butt_style;
    butt_clicked=this; restore_butt_style=butt_off_lit;
    this.style.cssText=butt_on_lit;
    var x = document.getElementById('Freccia_' + freccia_old);
    x.style.display = 'none';
    Freccia_sitointer_anagrafica_anagrafica_cliente_punto.style.display='block';
    freccia_old='sitointer_anagrafica_anagrafica_cliente_punto';"
    onMouseOver="this.style.cssText=butt_on_lit;"
    onMouseOut="if (butt_clicked != this) this.style.cssText=butt_off_lit;">Anagrafica Fornitura</td></tr>
    <tr>
    <td height=2></td>
    </tr>
    </table>
    In 10g the HTML code looks like this:
    div id=div_plus_GENERALE style="cursor:hand;"
    <td width=8> </td>
    <td align=left style="font-family:Verdana,Tahoma;
    font-size: 10px; font-weight: 400; color: '#ffffff';
    background-color: '';">
    <a href="sitointer.anagrafica.anagrafica_cliente_punto target="frameCenter"
    onClick="var x = document.getElementById('Freccia_' + freccia_old);
    x.Style.visibility='hidden';
    Freccia_sitointer_anagrafica_anagrafica_cliente_punto.Style.visibility='visible';
    freccia_old='sitointer_anagrafica_anagrafica_cliente_punto';"
    onMouseOver="this.style.cssText=butt_on_lit;"
    onMouseOut="if (butt_clicked != this) this.style.cssText=butt_off_lit;">Anagrafica Fornitura</a></td></tr>
    <tr>
    <td height=2></td>
    </tr>
    </table>
    At this point I don't know what should I investigate next.
    Thank you very much.
    Daniela

  • SRW,Run_Report not working on Report Server

    1 The plan is to do a select in the mother report. Get a number of rows, among them a company name, which the SQL is sorted on.
    2 In the data model I have a function that checks if a global variable is the same as the company name. If not, it will set the global variable equal to the company name, and then it will run a global defined function that starts the SRW.Runreport call that generates a PDF for this company.
    3 Next row the same thing will happen, and maybe the function is run again, or maybe it is the same company, in which case the SRW function will be skipped.
    The report runs nicely from reports builder, but when I try running it on the server it fails with error: REP-1401: 'cf_doc_trans_letterformula': Fatal PL/SQL error occurred. ORA-06508: PL/SQL: could not find program unit being called.
    I use following web link to start the “mother” report: http://Rep_server/reports/rwservlet?SERVER=origo_report&USERID=user%2Fpassw%40tns_name&AUTHID=user2%2Fpassw2&DESTYPE=cache&DESFORMAT=rtf&Report=temp.rdf
    In the temp.rdf the following statement is executed: SRW.Run_Report('BATCH=YES DESTYPE=FILE DESFORMAT=pdf DESNAME='||P_Desname||'.pdf REPORT='||P_REPORT||'');
    Are there any special settings I must make, when running on a Reports Server as opposed to the Reports Ruilder? Do I need a SERVER=REP_SERVER in the SRW.Run_Report parameter list?
    Any suggestions at all will be immensely appreciated.

    Hi,
    Top right cornor has a text box. Type "bobj is undefined" & you would find many KBs, forums & blogs.
    http://www.sdn.sap.com/irj/scn/advancedsearch?query=bobjisundefined
    Thanks,
    Saurabh

  • Using srw.run_report in report server

    Dear all,
    I'm running a report (report A) on the report server and after it is running (printing output on screen), I need to run report B at the background and save the output of report B to the file system. In the report A's After Report Trigger, I have a srw.run_report function, the syntax is: srw.run_report('server='||v_serverName||' report='||v_reportName||' batch=yes destype=file desname=/tmp/output.pdf desformat=pdf p_startdate=''12-JUN-2003'' p_enddate=''14-JUN-2003'''). When I run the above syntax (without the server name part) in report builder, it works fine. But I couldn't get it working on the report server. Each time report A runs, report B couldn't be run at all (no job id was given or scheduled). Could anyone give me an idea on whether srw.run_report could be used in the report server?
    Many thanks for your urgent help.
    Rose

    Can I use this build it to run itself? I mean in your case run report A?
    our report is launched from servelet. because of some security issues, I would like to use this built in to change it to command line after user enter all the parameters through the parameter form.
    thanks.

  • Problem while passing parameter from report to report.

    Hi
    I'm using forms and reports 10g, hava a problem while passing the parameter from reports to report.
    i'm using srw.set_hyperlink to call report from report.
    i have created a key value in the cgicmd.dat file called
    faccre802005-2006: report=faccre80 destype=cache desformat=pdf userid=<userid/passwd@cs> server=<servername>
    Now in the format trigger i'm using this key value
    function BTN_DEBITFormatTrigger return boolean is
    temp varchar2(5000);
    IP_ADDRESS VARCHAR2(50);
    SERVER_NAME VARCHAR2(10);
    L_ACCT_CODE VARCHAR2(14);
    begin
    SELECT MAST_INT_DESC,MAST_USER_PGM_ID INTO IP_ADDRESS,SERVER_NAME FROM MAST_INT_INFO WHERE MAST_INT_ID='VISHWA';
    temp := IP_ADDRESS||'?faccre80'||:P_FIN_YEAR||'+server='||server_name;
    temp :=temp ||'+'||'P_PREVIOUS_CODE='''||:ACCT_CODE||''''||'+'||'P_COMPANY_CODE='''||:P_COMPANY_CODE||'''';
    temp :=temp ||'+'|| 'P_FROM_DATE='''||TO_CHAR(:P_FROM_DATE,'DD-MON-RRRR')||''''||'+'|| 'P_TO_DATE='''||TO_CHAR(:P_TO_DATE,'DD-MON-RRRR')||''''||'+'||'P_TRUST_CODE='''|| :P_TRUST_CODE||'''';
    temp :=temp ||'+'|| 'P_UNIT_CODE='''||:P_UNIT_CODE||''''||'+'||' P_FIN_YEAR='''||:P_FIN_YEAR||'''';
    temp :=temp ||'+'|| 'P_LEVEL='''||:P_LEVEL||''''||'+'||'P_HEADER='''||replace(:P_HEADER,' ','%20')||''''||'+'||'P_FORMAT='''||:P_FORMAT||'''';
    SRW.Set_Hyperlink(temp);
    END;
    return (TRUE);
    end;
    Report is coming but not the expected result because parmaeters are not coming from first report to second report.
    If i dont use cgicmd file userid and password are displyed in the URL.
    Pl tell me how to pass parameter from one report to another.
    thanks and regards

    Hi
    I got the solution.
    I forgot to add %* at end of the KEY value.

  • SRW.RUN_REPORT Parameters

    On a non-Web publishing, what would the following parameter be set as in the RUN_REPORT procedure
    Gateway,Server & CMDkey
    I have a report created and I want to call this in the PL/SQL block using SEW package, can I do that without having the HTTP server running. I dont need this report to be called from the Web Browser.
    What would be the values that would be set for the Gateway then?
    Can you please help me.
    TiA,
    Shri

    SRW.RUN_REPORT('report=ports paraform=no'|| :port));
    in above syntax what is the error
    please reply
    You have two closing parenthesis that's why.-------------------------------------------------------------------------------
    Where to put the code:
    normally... You will put the code in before report trigger.
    to define the parameter...
    srw.run_report('parameter1=param_value');
    insert ----> parameter1=param_value <-- somewhere in the comand line, there should be no problem with that.

  • Hide URL using srw.run_report

    I called a report from a form 10g using RUN_REPORT_OBJECT which hides url.
    Now i called a report with in report using srw.run_report which shows hole url in the browser.
    I want to hide url.

    Can I use this build it to run itself? I mean in your case run report A?
    our report is launched from servelet. because of some security issues, I would like to use this built in to change it to command line after user enter all the parameters through the parameter form.
    thanks.

  • Srw.run_report problem. Help needed...Urgent

    Hi,
    I am very new to Oracle Reports. I need some help in using the srw.run_report
    I am having two reports. Rep_A and Rep_B
    I will always invoke the Rep_A first...Rep_B should always be invoked in Rep_A
    In Rep_A, i need to check a parameter P_Param1 and based upon the value i need to proceed as follows
    If P_Param1 = 1 then
    --Rep_A should be generated and returned as stream(cache)
    --Rep_B shouldnt be invoked
    If P_Param1 = 2 then
    --Rep_B should be generated and returned as stream.
    --Rep_A should not be generated
    If P_Param1 = 3 then
    --Rep_A and Rep_B should be generated and returned as stream
    --(Rep_A followed by Rep_B)
    If P_Param1 = 4 then
    --Rep_A and Rep_B should be generated and saved as files in a specified location.(this location is in another machine)
    This is my requirement. I hope I am clear with my requirement.
    How can we achieve these.
    Are there any technical issues?
    Please guide me
    thanks...
    siva

    Hi all,
    just to keep this thread active.
    can anyone help me in using srw.run_report.
    its an urgent requirement.
    thanks...
    siva

  • Problems with SRW.RUN_REPORT on 10gReport Server (9.0.4)

    I have recently upgraded to 10gReport Server (9.0.4) and for the most part have no problems running reports. However, when running reports that call other reports, the srw.run_report server call hangs. Found that this is a bug in 9.0.4. Work around is to not include the server parameter in the run_report string.
    Current string appears this way in the Before Report Trigger:
    srw.run_report('batch=yes report=(reportpath)\comptype.rdf destype=cache desformat=pdf');
    srw.run_report('batch=yes report=(reportpath)\stdomicile.rdf destype=file desformat=pdf');
    However, when running from the calling report, it will render in pdf for the user, but the comptype.rdf and stdomicile.rdf reports error with the following message:
    REP-52251: Cannot get output of job ID 966 you requested on Wed Dec 14 10:17:30 CST 2005.<P>REP-56033: Job 966 does not exist
    REP-52251: Cannot get output of job ID 965you requested on Wed Dec 14 10:17:30 CST 2005.<P>REP-56033: Job 965does not exist
    respectively.
    When checking OH\reports\cache..all reports are available and printable, but for some reason they are not rendering in pdf to the screen. I did not have this problem prior to moving to 9.0.4 report server.
    Does anyone have any ideas as to why the reports will not render correctly? Users cannot get to the cache file to manually print themselves.
    any help will be appreciated.

    We're having the same problem with our upgrade to 10g (9.0.4). I'm getting the REP-52251 error and no report output in Adobe.
    Were you able to resolve your problem?
    Bill Hartenberger
    [email protected]

  • Import statement: pass parameter or variable in import statement ??

    Hi All..
    Is there a way to pass parameter or a variable to a url in the import statement..
    I'll be using a url in the import statement, the url will be having a dynamic .rtf file...something like
    <?import:http://#server#:#port#/xmlpserver/<mySubTemplate>.rtf?>
    where <mySubTemplate> is dynamic..
    I've been searching this thread for a while now and ended up close...
    Import sub template dynamically
    Thanks in Advance..

    Have you tried replacing the mySubtemplate.rtf part with a variable, or replace the entire URL using a variable? Try using the same construct from this example in the Report Designer's guide (page 7-14, 10.1.3.4).
    In Microsoft Word's Format Picture dialog box select the Web tab. Enter the
    following syntax in the Alternative text region to reference the image URL:
    url:{IMAGE_LOCATION}
    where IMAGE_LOCATION is an element from your XML file that holds the full
    URL to the image.
    You can also build a URL based on multiple elements at runtime. Just use the
    concat function to build the URL string. For example:
    url:{concat(SERVER,'/',IMAGE_DIR,'/',IMAGE_FILE)}
    where SERVER, IMAGE_DIR, and IMAGE_FILE are element names from your XML
    file that hold the values to construct the URL.
    This method can also be used with the OA_MEDIA reference as follows:
    url:{concat('${OA_MEDIA}','/',IMAGE_FILE)}

  • Pass parameter from request

    Hi,
    I have 2 pages, in page2 CO2, it passes parameter 'cancel'
    processFormRequest{
    else if("Cancel".equals(pageContext.getParameter("event")))
    pageContext.putParameter("cancel", "Y");
    pageContext.forwardImmediately("OA.jsp?page=/company/oracle/apps/xxg2c/goaling/webui/Xxg2cGoalSheetSearchePG",
    null,(byte)0,null,null,true,null);
    in page1, CO1, I get the parameter 'cancel'.
    processRequest{
    cancel = pageContext.getParameter("cancel");
    Now, if I want pass 'cancel' to processFormRequest of CO1, how should I do it?
    thanks
    Lei

    Lei,
    To get the value in co1, there are two alternatives:
    1)Pass value in hashmap:
    HashMap hmap= new HashMap();
    hmap.put("cancel","Y");
    pageContext.forwardImmediately("OA.jsp?page=/company/oracle/apps/xxg2c/goaling/webui/Xxg2cGoalSheetSearchePG",
    null,(byte)0,null,hmap,true,null);
    in page1, CO1 processRequest, you can get it by
    cancel = pageContext.getParameter("cancel");
    2)Pass param in url itself:
    pageContext.forwardImmediately("OA.jsp?page=/company/oracle/apps/xxg2c/goaling/webui/Xxg2cGoalSheetSearchePG&cancel=Y",
    null,(byte)0,null,null,true,null);
    in page1, CO1 processRequest, you can get it by
    cancel = pageContext.getParameter("cancel");
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Forms 6i & SRW.Run_Report does not work on 10g client

    Hello Sir/Madam,
    I'm using 10g client with Forms & Reports 6i.
    FORMS 6i error => for some reason this combination is prompting FRM-10102 & FRM-40039 errors
    Attempted so far => attached the library, complied, it compiles ok, but somehow loses the library file at runtime
    Reports 6i issue => for Reports seems like it does not recognize SRW.Run_report built-in
    Attempted to run without "srw.run_report" it works..
    Please help me understand if any necessary "*.dll" files are missing? if so what might that be?
    Regards,
    Vani Sonti

    When you install Forms and Reports 6i, the correct Oracle client (8) is installed. I don't know what you did exactly, but you shouldn't try to change that.
    You can install the 10g client, but in a separate Oracle home. This way Forms and Reports still use the 8 client.
    FRM-10102 & FRM-40039 errorsThat looks like a problem in your forms60_path registry setting.

Maybe you are looking for

  • Can I connect to a network drive on powerup/login?

    I am trying to automate backups with psyncx, and want to specify a network drive which sits on an old networked pc's usb port. At the moment, I have to go in finder, click on network, get to the destination drive I want and then it shows up in finder

  • Premiere CS6 skips/does not play first second of vob file - while with vlc all fine

    Hello everyone! I am trying to edit vob files (after being ripped on hdd) and Premiere seems to skip the the first second in the media browser, source monitor etc. after import. When opened with vlc-player the vob file is just fine and the first (mis

  • Spot Healing Brush

    It seems that I must have clicked on something because my Spot Healing Brush does not work like it did before!  When I click on it, I have to click on an area first and cannot change the size of the brush!  At the top it says BRUSH - MODE - SOURCE: S

  • Updating a derived column of a table

    Hi everyone, Can you please help me and give me a solution for this I have 3 columns paydate, expdate, NewRenew in a table.  If the paydate is greater than 90 days than exp date I need to update NewRenew column to N and If the paydate is less than 90

  • BBC iPlayer has stopped working following firmware...

    Hi all I have recently upgraded the firmware on my N97 to 12.0.026 No noticeable difference that I've spotted yet but BBC iPlayer has stopped working.. I get a Script alert saying Type error: undefined value Anyone got the same? .. any solutions .. I