SRW.SET_MAXROW

Hello,
In Reports 6i, I have used SRW.SET_MAXROW in the Before Report Trigger to dynamically limit the number of records fetched from the database as per an user specified parameter value. Say if the query in the data model fetches 25 records, but the user has specified 23 as the parameter value from the parameter form - then I expect 23 records to be displayed in the report.
But I find the behaviour OF SRW.SET_MAXROW to be inconsistent. Running the same report against the same data in the respective tables, I am getting different results. In most runs I am getting the 23 records as expected, but sometimes it is displaying all the 25 records.
Does this point to a problem in the network or problem in the memory of the database server - as the SRW.SET_MAXROW restricts the number of records during parsing. Or has any bugs been reported in this regard which is cause of such problems.
Please let know of any possible solutions or similar problems.
Many Thanks.

Hi,
There are no such issues reported prevously where in some case SRW.SET_MAX_ROWS seems to work and some time it does not. Are you sure your are running report in same way everytime? I suggest you get in touch with Oracle support on this.
thanks,
Rohit

Similar Messages

  • Use of ORDER BY along with SRW.SET_MAXROW

    Hello,
    If there is an ORDER BY clause in the query of the data model in Reports 6i and SRW.SET_MAXROW is used in the Before Report Trigger to restrict the number of records being fetched as per an parameter value (entered by the user) - Does the restriction on the number of records applies on the ORDERED data set OR on the data set before parsing of the ORDER BY clause.
    Any thoughts, please let me know.
    Thanks.

    On the ordered data set.
    If the query is to return values (maxrow > 0) then the query will be passed to the database and executed. Reports will then only retrieve <maxrows> rows from the data set.
    Hope this helps,
    Danny

  • Use of SRW.SET_MAXROW

    Hi Friends,
    By using SRW.SET_MAXROW we can limit the number of rows it should show on a page.
    1. Lets say i set this as SRW.SET_MAXROW('Q_1',17) and i have 19 rows for my query, then it is fetching only 17 rows in report and 2 rows are not displaying at all.
    i want to fetch remaining 2 rows in next page then what should i do for that ???
    Thanks in advance.
    Umesh

    984120 wrote:
    Hi Friends,
    By using SRW.SET_MAXROW we can limit the number of rows it should show on a page.
    Hi Umesh
    Welcome to the Oracle Forums. Please take a few minutes to review the following:
    <ul>
    <li>Oracle Forums FAQ
    <li>Before posting on this forum please read
    <li>10 Commandments for the OTN Forums Member
    <li>How to ask questions the smart way
    </ul>
    Following these simple guidelines will ensure you have a positive experience in any forum; not just this one!
    1. Lets say i set this as SRW.SET_MAXROW('Q_1',17) and i have 19 rows for my query, then it is fetching only 17 rows in report and 2 rows are not displaying at all.
    i want to fetch remaining 2 rows in next page then what should i do for that ???No need of srw.set_maxrow
    Just select the repeating frame of that query which frame's data you want to break and set the following property by selecting the frame and press F4
    Maximum Record Per Page --set property value 15Hope this helps
    Mark correct/helpful to help others to get right answer(s).*

  • Maximum rows to fetch in a Query Oracle Reports10

    Is it possible to limit the number of rows a Query returns by a line calculated i.e. instead of maximum number of rows being e.g. 3 it could be :C_CALLINES?
    I tried this but I just get invalid number as an error.

    Thanks a lot for that. Here is the before reports trigger where should I put
    SRW.SET_MAXROW('Q_1',1);
    Function BeforeReport return boolean is
    begin
    BEGIN
      -- srw.do_sql('alter session set sql_trace = true');
      select displayed_field
      into   :C_continued
      from   po_lookup_codes
      where  lookup_type = 'POXPRPOP'
      and    lookup_code = 'CONTINUED';
      select displayed_field
      into   :C_address_at_top
      from   po_lookup_codes
      where  lookup_type = 'POXPRPOP'
      and    lookup_code = 'ADDRESS AT TOP';
    /* Bug 1484478
      The call to initialize is being made in after parameter value trigger and it
      is not necessary to do it here again
      SRW.USER_EXIT('FND SRWINIT');
    /* Change the :P_single_po_print parameter value
    to 1 if po_from and po_to parameters are same.
    Then Query will fetch the correct data for all conditions and uses the
    indexes incase of :P_po_num_from=:P_po_num_to and ALPHANUMERIC data
    Bug#946470 -- bgopired  */
      If :P_po_num_from = :P_po_num_to THEN
                :P_single_po_print := 1;
      END IF;
      srw.user_exit('FND INSTALLATION OUTPUT_TYPE="STATUS"
                     OUTPUT_FIELD=":P_EC_STATUS"
                     APPS="EC"');
      srw.message ('010', :P_ec_status);
      SRW.USER_EXIT('FND FLEXSQL CODE           ="MSTK"
                                 OUTPUT         =":P_FLEX_ITEM"
                                 APPL_SHORT_NAME="INV"
                                 MODE           ="SELECT"
                                 DISPLAY        ="ALL"
                                 NUM            ="101"
                                 TABLEALIAS     ="MSI"');
    /* Check for multilingual installation and take appropriate action. */
    /* See Reports PL/SQL for more details. */
      if (MLS_INSTALLED) then
         POPULATE_MLS_LEXICALS;
      end if;
      RETURN TRUE;
    END;  return (TRUE);
    end;

  • Report governor?  (CPU time, clock time, # rows, etc?)

    Is there any sort of report "governor" function available in the
    Reports Server or 9iAS (Portal) interface to the reports server
    that would let me stop a report once it had used up a certain
    amount of database CPU time or simply ran for too long ("wall
    clock time")?
    For certain times of the night (during data loads, etc.), I need
    to be able to restrict some or all of our users from taking over
    the CPU by running too many reports concurrently, reports with
    too broad a set of parameters, etc. The SRW.SET_MAXROW
    procedure might help a bit, but ideally I'd like to be able to
    control this without having to change each report. (Also, I'd
    like to be able to control this on a user-by-user, group-by-
    group or time-of-day basis.)
    TIA for any suggestions anyone can offer!
    - Bill

    hello,
    there is no feature in oracle reports but you might look into
    the database features, they might have something like that.
    regards,
    the oracle reports team --pw                                                                                                                                                                                                                                                                                                                                                                   

  • Stopping query results

    Hello,
    I have two queries. One returns details for a report viewed on the screen (Q1), the second returns strictly address label detail (Q2). I have put in the WHERE claus of:
    Q1:
    where :output = 'View on screen' ...
    Q2: where :output = 'Save as label file' ...
    In the Before Report trigger, I have put:
         if :output = 'Save as label file' then
              srw.set_maxrow('Q1', 0);
         else
              srw.set_maxrow('Q2', 0);
         end if;
    The problem is that when I create the label file, using Delimiteddata, I am getting headers from both queries.
    How can I suppress the headers of Q1? Am I being redundant in all of this code?
    Thank you for all your help!
    --KW

    I have finally cleared all names from the XML Tag property on all fields returned by Q1. This has stopped the second row of headers although I still get a blank row.
    I know it is still wanting to return something from Q1, even though there are no results to show.
    If there is some other way to suppress Q1 altogether, I would sure like to know what it is. : -)
    Thank you all for your posts. Alot of great info here!!
    --KW                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • 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

  • 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?

  • 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.

  • SRW.DOSQL NOT WORKING IN REPORTS 11G

    Hi Experts
    I have certain coding in my report which makes use of SRW.DOSQL and the queries are written in reports 11g.
    Kindly let me know the alternative in reports 11g as the opening balance field is not bringing the value as attached in the report.
    I am attaching the rdf file for reference.
    Kindly let us know the solution for the same.
    Regards

    Your not seeing the built in package for some reason.
    Maybe they are missing on your Linux machine.
    Reinstall reports there? Examing your environment variables?
    Is that rwrun.jar anywhere?

  • SRW package not working in Reports 10g (9.0.4)

    Dear All,
    I am using reports services 10g (9.0.4) for RHEL o/s.we are using SRW pkg in our reports heavily.But when we compile reports in Linux it is showing errors like SRW.message ,SRW.set_field_char,SRW.set_format_mask must be declared.
    Though these functions are well written in reports help,it is not at all supporting these functions.
    What is solution for this for successfull compilation of reports??
    Regards-
    Onkar Vidwans
    INDIA

    Your not seeing the built in package for some reason.
    Maybe they are missing on your Linux machine.
    Reinstall reports there? Examing your environment variables?
    Is that rwrun.jar anywhere?

  • Font subsetting issue with srw.run_report

    I have PDF subsetting as
    "Courier" = "MSGOTHIC.TTC"
    I have a report emp.rdf. This emp report just displays the data from emp table.
    I have a report dept.rdf. This dept report just displays the data from dept table.
    In the after report trigger of the dept, I added
    srw.run_report(report=emp destype=file desname=emp.pdf desformat=pdf);
    I am running the dept report from command line as
    rwclient server=<servername> userid=<user/pwd@db> report=dept destype=file desname=dept.pdf desformat=pdf
    The report hangs. I tried moving the after report trigger to before report trigger and it fails too.
    Any ideas?

    Hi,
    Can you try running this report from the Reports Builder, ie, use File > Generate to file > pdf, and see if both the master and child files are generated.
    If yes, can you post both server and engine trace file contents (last few lines) of the instance when you run it from the server, and not from Builder.
    Navneet.

  • In Reports6i is "srw.do_sql" still applicable?

    Hi guys,
    I just want to know if in Oracle Reports6i the "srw.do_sql" still applicable? In report trigger afterform i have problem with this line.
    srw.do_sql('create table owner.tablename (column1 char(6), column2 (varchar2(50))');
    Can anyone help me solve this problem. Thank you.
    Regards,
    Lala

    I think you forgot to write tha actual owner name !!
    or does your user has the rights for DDL statements ??
    SRW.DO_SQL ('CREATE TABLE ' || :owner||'.'||:tname || ' (COL1 NUMBER
    NOT NULL, COL2 NUMBER (10,2))' );
    Edited by: Dora on Dec 7, 2009 12:42 PM

Maybe you are looking for

  • Transparency and effects not working

    I am kind of new to Indesign, but no matter what tutorial I follow, I can't get transparency (or any effect) to work. Is there some fundamental thing I could be missing? For example, I tried to have both a text frame and a graphics frame be semi-tran

  • Account rights and Permission problems!

    I have since few day´s MacKeeper installed, but even when I restart my Mac. I can´t use Internetsecurity because of permission problems I have no access to helperlaunch. My Account has Admin rights but helperlaunch get´s the information that I have n

  • IPad not charging nor syncing

    My iPad stop charging today and I don't know why. It's not my plug or cord because it charges my iPad. I've even tried turning it off and resetting it but it still won't charge. What wrong with it? When I plug it to the computer it doesn't get detect

  • Converting Video for Web .SWF

    I created an imovie to serve as a flash intro on my Go Daddy site. I used the Adobe Media encoder to convert the Quicktime file to an .FLV/.F4V file. I opened it with my Adobe Flash Professional CS4 to export it as an .SWF file .  It works fine on my

  • Online or archived update site for 12.1.1?

    Hi! Any chance there will be online or archived update site for 12.1.1?