Order by ignored if report has 2 groups in 1 query

My report has order by &p_q1_order that allows the user to select the order of the report at runtime either by Business Name or by Applicator Name. The order by was working fine with only one group in the query. I have since had to add new fields(applicator type) to the original query and have created a second group below the first in the data model. Now when the report runs it ignores the order by clause and is ordering the report by which ever field is first in the data model's first group. If I move the fields around in the data model it will sort by which ever one I have at the top.
My query is below: All fields except (ps.status, ps.description, and ps.requalify) are in the 1st group those 3 fields are in the second group. If I move the t.BUSINESS_NAME to the top it orders by Business name. If I move the t.NAME to the top it order by applicator's name and ignores the user's choice in the parameter form.
My query:
SELECT distinct
t.NAME,
t.BUSINESS_NAME,
t.ID,
ps.status,
ps.description,
ps.requalify,
t.license_cd,
t.ISSUE_DATE,
t.EXPIRES,
t.county,
t.enf_dist,
t.addr_ln_1||' '||t.addr_ln_2 address,
t.city||' '||t.state||' '||t.zip ctystzip,
t.phone
FROM lic_com_appl_dler_addr t, pesticide_com_license_sumlic ps
where t.id = ps.id(+)
and ps.lic_subtype_cd not in('11','12','13','14','15')
and t.EXPIRES like :p_current
&p_where
order by &p_q1_order

Hi Terri
Please let us know the Reports version you are using? Also try with out the bind varibale in query. Does the order by works then? There were bugs like this in earlier realeses of Report but are all fixed now.
Thanks
The Oracle Reports Team

Similar Messages

  • GROUP BY & ORDER BY  in a Report

    How to Implement GROUP BY & ORDER BY in a Report?

    Hi,
    Order by: It is possible to sort the char value according to the values (asc or desc) of an atribute of this char...is this what you were looking for?
    Group by: May be can be achieved by drilldwon sequence, with the grouping char to the left of the char values to be grouped...again, is this what you had in mind?

  • XML Publisher report errors out when RDF report has no data

    Hi everyone,
    I created a template and attached it to an RDF. When i run the oracle report with the attached template, if the report has 'not data exists' the report is erroring out. is it the normal functionality of XML publiher??. Because i remember at my earlier client i have run some reports for which if 'no data exists' still the program would complete normal but the output would be blank.
    The xml output is creating the tags for the elements.
    any help appeciated.
    Thanks
    sam

    Hi Sam,
    Yes this will happen depending on what the template is repeating on etc. You can handle this quite easily using sub-templates.
    Firstly create your normal template as a sub-template (so surrounded by the <?template:TEMPLATE_NAME?> tags)
    Then create a second template that contains the text "NO DATA FOUND" as another sub-template.
    Create a third template (this will be your main template called by the report), which imports the two sub-templates, then using a choose statement, count the number of occurences of you main repeating group in your XML. If the count = 0 then call the "NO_DATA_FOUND" sub-template, otherwise call the normal sub-template.
    I hope this helps, if you need an example I can send you one, just let me know your email address.
    Regards,
    Cj

  • Displaying a radio group in SQL QUERY report region

    Good morning everyone,
    I have a report in which a column - ORDER STATUS, will come in with a value of 1, 2 or 3...being order unfilled, order partially filled, or order filled, respectively.
    I would like to display the order status as a radio group on the report so that it will be easy to run down the column of radio buttons to see what is filled, etc.
    I've gone to the manual and checked the doco on HTMLDB_ITEM.RADIOGROUP. But the example given there is actually for CHECKBOX (is this an error?!?).
    I went to the forums and found nothing suitable.
    My region is an SQL QUERY. Can I display the STATUS as a radio group in the SELECT ?
    This is the question.
    Thankyou in anticipation. TC. 23/11/2004

    Tony,
    There may be better solutions, but here's what I was thinking:    create table orders (id number, status number, customer varchar(30))
        insert into orders (id,status,customer) values(1,1,'ACME')
        insert into orders (id,status,customer) values(2,2,'BENSON')
        insert into orders (id,status,customer) values(3,3,'CLARKE')
        commit
        Query Source
        select
          id "ORDER NUMBER",
          decode(status,
            1,htmldb_item.RADIOGROUP(1,status,'1','unfilled')||htmldb_item.RADIOGROUP(2,status,'2','partial','"disabled=true"')||htmldb_item.RADIOGROUP(3,status,'3','filled','"disabled=true"'),
            2,htmldb_item.RADIOGROUP(1,status,'1','unfilled','"disabled=true"')||htmldb_item.RADIOGROUP(2,status,'2','partial')||htmldb_item.RADIOGROUP(3,status,'3','filled','"disabled=true"'),
            3,htmldb_item.RADIOGROUP(1,status,'1','unfilled','"disabled=true"')||htmldb_item.RADIOGROUP(2,status,'2','partial','"disabled=true"')||htmldb_item.RADIOGROUP(3,status,'3','filled'))
          "STATUS",
          customer "Customer Name"
        from orders;Scott

  • [APEX 3] Requested source data of the report has been modified

    Hello APEX-Friends,
    I have a common problem but the situation is a bit different here. Many of you might know the "invalid set of rows requested the source data of the report has been modified" problem. Often it occurs on submit. That means, you have a report, you select rows, you do things, you submit the page and everything blews up.
    This is because you enter some values into fields the report depends on and so you modify your report parameters and the source data changes.
    But:
    In my case I have a dynamically created report that blews up before any submits occur or values change.
    My query is a union of two selects. Both query different views. Those views use a date field as parameter and some compare functions.
    I read the field with a V-Function i wrapped arround the apex V Function - declared as deterministic. My date compare function is also declared deterministic (I doubt this makes any differences as it might be only important for the optimizer, but as long as I don't know exactly what APEX evaluates, I go for sure).
    I ensured, that the date field is set by default with the current date (and that works, because my interactive report initially displays correct data from the current date).
    So everything is deterministic and the query must return same results on subsequent calls, but APEX still throws this "source data has changed" error and I am to 99.99% sure, that this cannot be true.
    And now the awesome thing about this:
    If I change the value of the date field, an javascript performs a submit. The page is reloaded (without resetting pagination!) and everything works fine. I can leave the page, reenter, do things - everything works well.
    But if I log into the application and directly move to the corrupted report and try to use the pagination without editing fields or submitting the page the error occurs.
    Do you have any Idea what's happing there? I could try to workaround this by submitting the page the first time it's entered to trigger this "mystery submit" that gets everything working. But I would like to understand this issue and have a clean solution.
    Thanks in advance,
    Mike aka UniversE

    Okay, I found a solution, but I do not understand it - it might be a design flaw in APEX.
    I mentioned the date field that is used in the query. I also mentioned that it is set with the current date by default. I did not mention how.
    There are some possibilities in APEX to do so.
    1. Default-Setting in the element properties
    2. Static assignment if no value is in session cache
    3. Computation before header
    I did the first and second.
    BUT:
    An interactive report seems to work as follows. A query is executed to get all rows of the report. Then a second query is executed to get the rows that shall be displayed. And the order is screwed up, I think.
    1. The first report query to get all rows
    2. The elements are loaded and set to default values
    3. The second report query to get the display rows
    And that's the reason why nothing worked. Scince I added a computation before header the date field is set before the report queries are executed and everything works all fine now.
    But I think it's a design flaw. Either both queries shall be executed before Regions or afterwards but not split as field values might change when elements are loaded.
    Greetings,
    UniversE

  • Order by ignored - is it a bug?

    Hi all
    In a very simple the order-by clause is ignored, which seems a rather embarassing bug to me if it reall is one.
    Can anyone explain the effect?
    Thanks a lot
    Franziska
    -- ordered as expected:
    select
      hash
      , anzahl
    from
      (select
        hash
        , count(*) as anzahl
      from
        faelle_human_alle
      where
        abgerechnet_11xxx = 1
      group by
        hash)
    order by
      anzahl desc
    HASH     ANZAHL
    51E3104E8DC14051921CEFCA47225341     2400
    0BE3E36F76F28DDF1A7B5423CD8D8B7F     2086
    AB0571E09D6ADDDA31D81E95F09F0896     1085
    EBD225DA0FDB8EDCED055245AAAF3BD4     435
    77E818573395A219B3A0978A9B53BA5D     418
    63C72D3ACCFFE35CB7AF2363E487E0E0     411
    2C920037095C10A57B680C3D39EF6080     388
    180B9083BC382FC377EA597EFE1AECD7     382
    ID     PID     Operation     Name     Rows     Bytes     Cost     CPU Cost     IO Cost     Temp space     IN-OUT     PQ Dist     PStart     PStop
    0          SELECT STATEMENT          268K     9427K     8674      1G     8070                                
    1     0       SORT ORDER BY          268K     9427K     8674      1G     8070      32M                         
    2     1         HASH GROUP BY          268K     9427K     8674      1G     8070      32M                         
    3     2           TABLE ACCESS FULL     FAELLE_HUMAN_ALLE     506K     17M     5526      883M     5138
    -- unordered
    select
      hash
      , anzahl
    from
      (select
        hash
        , count(abgerechnet_11xxx) as anzahl
      from
        faelle_human_alle
      where
        abgerechnet_11xxx = 1
      group by
        hash)
    order by
      anzahl desc
    HASH     ANZAHL
    213145AC4A58A12E48F49B39A5EA6B82     47
    665F009B4EB344C65AD16234A50EE7D1     39
    05FADA880F690A52DE6B85026BCAD40C     6
    338D6128E1E4DCDA6900506E280628CF     6
    EF6553A6953CAAB06166BCF1FD456C00     41
    A3FBC4D601F5E54DF6899BD0211584B7     4
    8154F2F79A8B193710C38479EACC46C3     3
    97239839CEC21967515DAC75C004B815     36
    ID     PID     Operation     Name     Rows     Bytes     Cost     CPU Cost     IO Cost     Temp space     IN-OUT     PQ Dist     PStart     PStop
    0          SELECT STATEMENT          268K     9427K     8674      1G     8070                                
    1     0       HASH GROUP BY          268K     9427K     8674      1G     8070      32M                         
    2     1         TABLE ACCESS FULL     FAELLE_HUMAN_ALLE     506K     17M     5526      883M     5138
    -- also fine:
    with x as
    (select
        hash
        , count(abgerechnet_11xxx) as anzahl
      from
        faelle_human_alle
      where
        abgerechnet_11xxx = 1
      group by
        hash)
    select
      hash
      , anzahl
    from
    x
    order by
      anzahl desc
    ;                   

    Odd!
    The only difference I spotted between the first and 2nd queries was the count(*) vs the count(column), which should not have affected the order by clause. The difference in results is probably due to the count(*) accepting nulls.
    Could there be an invisible character in the text of the second query causing the ORDER BY clause to be ignored? Can you type the 2nd query in from scratch and see if the error persists (this is unlikely but I can't think of anything more promising right now)?

  • Sales Report Material Group-wise

    I want to generate Sales Report Material Group-wise is there any standard report.
    regards,
    Rajesh

    Hi
    Use the T.code: MCBK, this report tells you about Total stock received, total stock issue for sales order against the material group.
    Reward if it helps
    Regards
    Prasanna R

  • Need urgent help on mailing lable report in group above style

    Hi
    I need to prepare a report on reports 6i in mailing lable style based on group above style (multiple levels) e.g. yellow page directory. can anybody help me.
    rgds

    Hi,
    That's something I also had to do.
    Ad here's how this works.
    Suppose you have:
    Select ...
    from ...
    where ...
    order by name;
    Yet in your data model, in your group the fields appear, let's say, in the following order:
    date
    name
    So, Reports will sort within the group first by date.
    The answer is that your fields should appear in the data model in the order you wish to have them sorted. Thus, in the example, you should have:
    name
    date
    Frankly, I don't really like the way it works. Yet, it's just that simple.
    Hope this will help,
    BD.

  • Report design Grouping problem

    I'm currently designing a report, something like an invoice. The invoice number is usually on the page header. But now i want to create a report to list down all the invoice numbers in the 'details' but when i drag the 'invoice number' data to 'details'
    it only show 1 row of numbers, wheareas the data has few rows of it. How can i make it view all my numbers? 

    Hi Eugene,
    Thank you for posting in MSDN forum.
    Since this forum is discuss the VS test issue, so
    I’m afraid that it is not the correct forum for this issue.
    As you said that the report design grouping problem, I suggest you could try to consult this issue directly to the VS Report Controls forum:
    https://social.msdn.microsoft.com/Forums/en-US/home?forum=vsreportcontrols , maybe you will get better support.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • SCOM 2012 - Custom disk space report - Computer Groups

    Hello,
    I've created custom disk report with sql query to pull the disk space for all servers. The report has parameters start data,End date and computer name but now my requirement would be to get the disk reports based on custom created computer group, Is it possible
    to feed computer group name instead of computer name in the custom reports?
    Regards,
    Vijay

    Hi,
    For SCOM 2007, you can’t select a group of servers and run a free disk space report on them. And for 2012 I think it also like that.
    But based on my research, someone said that when you create group with Logical Disk targets, it may work. Here are two similar threads for your reference:
    Report on Logical Disk Free Space % for a group of servers
    http://social.technet.microsoft.com/Forums/en-US/fbec6fce-8f65-461b-8730-98a0d493c375/report-on-logical-disk-free-space-for-a-group-of-servers?forum=operationsmanagerreporting
    Can't target free disk space report at Custom Group
    http://social.technet.microsoft.com/Forums/en-US/8555fc3e-eed2-4523-a307-589eb6ff72fc/cant-target-free-disk-space-report-at-custom-group?forum=operationsmanagerreporting
    Regards,
    Yan Li
    Regards, Yan Li

  • Matrix report with group.

    dear all,
    can anyone guide me how to build a matrix report with group using scott schema.
    i can not be able to build a query.
    Thanks
    Muhammad Nadeem

    The example given by Oracle (from the above link) using the following SQL for a matrix report is flawed.
    SELECT DEPTNO, JOB, SUM(SAL)
    FROM EMP
    GROUP BY DEPTNO, JOB
    ORDER BY DEPTNO, JOB
    The SUM function handled by the query restricts you from doing so many things - especially when you want the empty fields to be filled by 0 (by using the Value if Null property).
    If the query is changed to ''SELECT DEPTNO, JOB, SAL FROM EMP' , and use the SUM function in the wizard to build the Matrix cell, then the 'Value if Null' property can be used without any issues.
    This also makes Section 25.6 (Add zeroes in place of blanks) of the documentation a joke.
    Anyway, that's my cents worth....

  • Drill Down Report by Grouping Data

    I am using Apex version 4.
    I'm wondering if there's a way to create a drill down report by grouping data and having a plus (+) symbol (or some other symbol) next to the group so the end user can expand or collapse as they want. So similar to how it works in Microsoft Excel.
    So I'm looking to build a report that looks something like:
    Market Office Revenue
    1 $200
    a $50
    b $70
    c $30
    d $50
    So there would be a way to expand or collapse the list of offices.
    Anyone know of any way to do this? I was hoping to avoid having to create linked reports. Even if there's no way to get the expand/collapse functionality to work, it would be acceptable to just show the data as I have in my example above.
    Thanks.

    Sorry, the format of my example got messed up.
    It's basically a hierarchy between Market and Office. So it's Market 1, then underneath that it would be Office a, b, c, and d. One market, multiple offices. Total market revenue of $200, then each office has the amounts listed.
    Hope that makes sense.

  • Error Data record has grouping value "" instead of 99

    Hi,
    We are implementing ESS and MSS for EP7.0 with ECC 5.0 and we get the following error: Data record 0000005900090      9999123120010910000 has grouping value "" instead of "99" when we try to edit and save the bank information.
    Please advise! Thank you!

    same error ,
    the report did not fix it .
    its coming up when ever i am trying to do a global assignment actions ...( this is occuring only for people with benefits infotypes)
    any idea..
    Please let me know
    Thanks

  • A Required COM Add-in program for XL Reporter has not been loaded and ....

    A Required COM Add-in program for XL Reporter has not been loaded and prohibits Microsoft Excel from running. For more information, click help.
    XL 2007, with the Trust level for macros set to minimum. SBO 2007 PL 42.
    Thanks
    Charles

    Read the following solution from SAP for your problem:
    When we open XL Reporter we get an error
    message "A required COM add-in program for XL Reporter has not been loaded
    and prohibits Microsoft Excel from running." when trying to open a report
    definition.
    SOLUTION FOR THE PROBLEM:
    Reason and Prerequisites
    You need to be an administrator on the local machine to add COM add-ins.
    Solution
    The user should be added as a member of the administrator role on the
    local computer the first time you start Excel from XL Reporter the first
    time so that the COM addin are registered, then you can remove the user
    from the administrator group again.
    Manually Loading the XL Reporter Excel COM Add-In
    Symptom
    If you install Microsoft Office after installing the XL Reporter
    application or use another Windows user than the one you used when
    installing XL Reporter, you can get an error message.
    Reason and Prerequisites
    The reason for this is that the report writer COM Add-in has not been
    loaded, which prohibits Microsoft Excel from running.
    Solution
    1. Start Microsoft Excel. If you already have the COM Add-ins command on
    the Tools menu, go to step 7.
    2. In the Tools menu, choose Customize.
    This opens the Customize window.
    3. Choose the Commands tab and select Tools from the Categories pane on
    the left.
    4. In the Command pane on the right, scroll down to the COM Add-ins
    command.
    5. Select the COM Add-ins command, hold down the mouse button, and drag
    COM Add-ins from the Commands pane over to the Tools menu on the Microsoft
    Excel men bar. When the Tools menu commands appear, point to where you
    want the COM Add-ins command to appear on the menu and release the mouse
    button.
    6. To close the Customize window, choose Close.
    7. On the Tools menu, choose the new COM Add-ins option.
    This opens the COM Add-ins window.
    8. In the window, choose Add to open the Add Add-in window.
    9.Select the IXXLReporter.dll file located in the Client directory in the
    XL Reporter program installation area and choose OK.
    10. In the COM Add-ins window, select the XL Reporter checkbox and choose
    OK.

  • Report has been generated , but *.rep file can't be ran.PLEASE HELP!

    Hi,
    I am facing real challenge.
    I've created report based on the stored function(packaged function).But when I try to run *.rep file I get Rep-1219< "F_xxx" has no size -- length or width is zero.>Well , my field does have a size.Also what is interesting that if I go back to the *.rdf file and try to run inside Reports during design second time I get the same error . Then if I go thru wizards again I get
    Rep1106 <warning no field generated for the column "bla-bla">, and I get this message for the all my columns that I have in the second group.My report is group above.I am sure that 1106 is the cause for the 1219 in the runtime.But then if go thru wizard once again after all those 1106 messages I am able to generate report!!!! And then I do editing of report and successfully generarate new *.rep file, but when I run this file I get the same results already described.
    In my report I have formula column(1) that gets value from another column(2) if values in the 3rd column not null, then I summarized column (1) at report level.
    Just creating summary for the column(2) is not an option for me, because I need some values, but not all of them.Another select statment is not gonna work , because as I said, report is built on function returning ref cursor.
    So can anybody help me with this problem?
    Or any suggestions?
    Thanks a lot in advance.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Yu:
    I've tried all:manually increase fields,
    increase size in layout model, nothing worked.
    What else can be done?<HR></BLOCKQUOTE>
    Hey ,
    Check this out
    Cause: When you defaulted your layout, a field was not generated for the column in the message. The most likely cause is that a summary was not placed in the data model correctly. For example, you may have specified the source of a summary column to be a column in a group above the summary's group. This is not allowed.
    Action: Debug your data model and redefault your layout.
    I hope the problem is group layout..
    Cheers ...
    Krishna ...

Maybe you are looking for