Report Sorting with PL/SQL Headings

Hi,
I have PL/SQL Headings for my reports. Is there a way to use the sorting feature nevertheless?
I tried to put the sorting syntax in my PL/SQL Headings, but it breaks at the first colon.
BTW: How can I get the region_id? Is there a "hidden" substitution string like &APP_ID.?
return 'Projekt' || ':' || to_char(sysdate,'WW/RR') || ':' || to_char(sysdate,'WW/RR') || ':' || 'Bericht'
Regards, Juergen

Hi Juergen,
Column heading sorting does not work when using a PL/SQL function to determine the column headings in the current version. This issue has been resolved and it will be working in the next release. There is no substitution string to determine the region ID and I would not recommend hard-coding URLs in your headings PL/SQL function because the URL sort syntax used might change in future versions.
Regards,
Marc

Similar Messages

  • Master Report problem with PL/SQL

    Hi Intelligent ones :)
    Can anyone help?
    I am trying to generate a Master report by generating a report based on a SQL query. The SQL query generates the detail of the report and the Main part of the report is generated using PL/SQL in "after displaying the header". See my PL/SQL below:
    DECLARE
    v_cloneid Clone.CloneID%TYPE;
    BEGIN
    htp.p('1: v_cloneid is:');
    htp.p(v_cloneid);
    SELECT Clone.CloneID
    INTO v_cloneid
    FROM ClonesDB.Clone;
    htp.p(v_cloneid);
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    htp.p('No data Error');
    WHEN OTHERS
    THEN
    htp.p('Error Detected');
    htp.p('Exception: v_cloneid is:');
    htp.p(v_cloneid);
    END;
    Every time I try to run my report an exception (When others) is generated. In my attempt to debugg my code I have discovered that the correct value is read into the v_cloneid variable. I can print this out within the exception but not before this!!
    Also to generate a report for each cloneID entry I assume I will need to use a loop?
    Please help...I'm just learning!!
    Kirsteen
    null

    I think you should post it -
    Forms
    Regards.
    Satyaki De.

  • Standart report sorting with HTML expression in it

    hi,
    got a query with report links like +'<_a href="f?p=&APP_ID.:26:&APP_SESSION.:::26:P26_YEAR,P26_MONTH,P26_BACK,P26_STATUS,P26_PROJECT:&P22_YEAR.,&P22_MONTH.,22,0,'||id||'">'||saved||'</_a>'+
    with 'saved' being a numeric value, report column sorting does not work. any suggestions?
    simon

    Hi Simon,
    As you are outputting the entire HTML using SQL, you need include something at the beginning of the HTML that allows sorting to work on the correct values. I tend to use the "title" (tooltip) attribute and ensure that numbers are of equal length by padding them with zeros:
    '&lt; title="' || TO_CHAR(saved,'000000') || '" href = "' ..... etc
    {code}
    Andy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Financial Reporting Sorting with page dimensions

    I had a report that was sorting account by description, in ascending order.
    However, then I changed it and added the Entity Dimension into the Hierarchy and it removed the Sorting. I cant get it to sort again.
    Is this a function of FR that if there are page dimensions you cant custom sort, or is there something that I am missing.
    Any help would be great
    Thanks
    Edited by: user12262404 on Sep 15, 2011 6:18 AM

    Hi,
    Have you tried the following link?
    http://download.oracle.com/docs/cd/E12825_01/epm.111/fr_user/7000011.html
    Cheers,
    Mehmet

  • Report problem with PL/sql

    function BeforeReport return boolean is
    begin
    declare
    l_sort po_lookup_codes.displayed_field % type;
    begin
    if :P_orderby is not null then
    select displayed_field
    into l_sort
    from po_lookup_codes
    where lookup_code = :P_orderby
    and lookup_type = 'SRS ORDER BY';
    :P_orderby_displayed := l_sort ;
    else
    :P_orderby_displayed := '' ;
    end if;
    SRW.USER_EXIT('FND SRWINIT');
    if (get_p_struct_num != TRUE )
    then SRW.MESSAGE('1','Init failed');
    end if;
    if (get_chart_of_accounts_id != TRUE )
    then SRW.MESSAGE('1','Init failed');
    end if;
    SRW.USER_EXIT('FND FLEXSQL CODE ="GL#"
    OUTPUT =":P_FLEX_ACC1"
    APPL_SHORT_NAME="SQLGL"
    MODE ="SELECT"
    DISPLAY ="ALL"
    NUM =":P_chart_of_accounts_id"
    TABLEALIAS ="GCC1"');
    SRW.USER_EXIT('FND FLEXSQL CODE ="GL#"
    OUTPUT =":P_FLEX_ACC2"
    APPL_SHORT_NAME="SQLGL"
    MODE ="SELECT"
    DISPLAY ="ALL"
    NUM =":P_chart_of_accounts_id"
    TABLEALIAS ="GCC2"');
    SRW.USER_EXIT('FND FLEXSQL CODE ="MCAT"
    OUTPUT =":P_FLEX_CAT"
    APPL_SHORT_NAME="INV"
    MODE ="SELECT"
    DISPLAY ="ALL"
    NUM =":P_STRUCT_NUM"
    TABLEALIAS ="MCA"');
    SRW.USER_EXIT('FND FLEXSQL CODE ="MCAT"
    OUTPUT =":P_WHERE_CAT"
    APPL_SHORT_NAME="INV"
    MODE ="WHERE"
    DISPLAY ="ALL"
    NUM =":P_STRUCT_NUM"
    TABLEALIAS ="MCA"
    OPERATOR ="BETWEEN"
    OPERAND1 =":P_CATEGORY_FROM"
    OPERAND2 =":P_CATEGORY_TO"');
    SRW.USER_EXIT('FND FLEXSQL CODE ="MCAT"
    OUTPUT =":P_ORDERBY_CAT"
    APPL_SHORT_NAME="INV"
    MODE ="ORDER BY"
    DISPLAY ="ALL"
    NUM =":P_STRUCT_NUM"
    TABLEALIAS ="MCA"');
    SRW.USER_EXIT('FND FLEXSQL CODE ="MSTK"
    OUTPUT =":P_FLEX_ITEM"
    APPL_SHORT_NAME="INV"
    MODE ="SELECT"
    DISPLAY ="ALL"
    NUM =":P_ITEM_STRUCT_NUM"
    TABLEALIAS ="MSI"');
    /* Assign parameter P_Accrued_receipts to parameter P_yes_no
    :P_yes_no := :P_Accrued_Receipts;
    return(true);
    exception
    when others then return(false);
    END;
    return (TRUE);
    end;

    I think you should post it -
    Forms
    Regards.
    Satyaki De.

  • Interactive Report Downloads only showing Column Headings

    I have an Interactive Report that is selecting more than 100 columns. I set the defulat to only show a few of the columns (the rest are dedaulted to not show). When I try the download option (pdf, rtf etc.) , it only shows the column headers (no data). The download works when you originally create the Report region with the SQL statement. It seems to break as soon as you do the 'Save Report' - 'As default Report Settings'. Anybody seen this before? It is a bug?

    Hi,
    You are almost right place. You need click icon before 100th column name, order to go screen where you can edit column attributes.
    In that screen right top is buttons (Cancle, Apply, < and >)
    Regards,
    Jari
    Edited by: jarola on Jul 21, 2011 5:43 PM
    It might documentation guides you to right screen
    http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/app_comp.htm#sthref978
    >
    To access Column Attributes:
    1. On the Workspace home page, click the Application Builder icon.
    2. Select the application.
    3. Select a page. The Page Definition appears.
    4. Under Regions, click Interactive Report next to the name of the report region you want to edit.
    The Interactive Report Attributes page appears with the Column Attributes section at the top of the page.
    5. To access the Column Attributes page, click the Edit icon next to the appropriate column Alias.
    >
    Edited by: jarola on Jul 21, 2011 5:44 PM

  • XML Publisher Report with PL/SQL

    Hi
    Like to know how to develop the XML Publisher Report with PL/SQL, i did the following
    1. created a pkg like as below
    CREATE OR REPLACE PACKAGE BODY APPS.TEST_XMLTAG_PKG AS
    PROCEDURE main (errbuf OUT VARCHAR2,
    retcode OUT NUMBER
    ) IS
    BEGIN
    DECLARE
    ctx DBMS_XMLGEN.ctxHandle;
    xml CLOB;
    BEGIN
    ctx := dbms_xmlgen.newcontext('select * from scott.emp');
    dbms_xmlgen.setrowtag(ctx, 'MY-ROW-START-HERE');
    xml := dbms_xmlgen.getxml(ctx);
    dbms_output.put_line(xml);
    Fnd_file.put_line (fnd_file.LOG, XML);
    END;
    END;
    END TEST_XMLTAG_PKG;
    this pkg produces the output with xml tag in the view log.
    I have registered the conc program & xml rtf but it does not produce the output in PDF, , I am not able to get the xml tag when i click the Diagnostics --> View XML.
    can you please let me know the next steps involved.
    Regards
    Yram

    I think the problem is because there is no begin and end tag. save the xml from the logfile and open with xml editor or IE.. then you will see the problem.
    add Begin and end tag...then you should be fine.. i.e
    fnd_file.put_line(fnd_file.output,'<EMP_DATA>'); -- begin Tag
    tx := dbms_xmlgen.newcontext('select * from scott.emp');
    dbms_xmlgen.setrowtag(ctx, 'MY-ROW-START-HERE');
    xml := dbms_xmlgen.getxml(ctx);
    dbms_output.put_line(xml);
    Fnd_file.put_line (fnd_file.LOG, XML);
    fnd_file.put_line(fnd_file.output,'</EMP_DATA>'); -- End Tag
    Hope this helps..>Good Luck
    Ravi

  • Interactive Report with PL/SQL Function Source

    Is it possible to create interactive report with PL/SQL function source returing a query? If not, has anyone done any work to simulate the interactive reporting feature for a normal report using API?

    I haven't tried that before but you could:
    1. create a collection from your result set returned by a dynamic query,
    2. create a view on that collection,
    3. use the view in your interactive report.
    The usability of this proposal depends from a question how "dynamic" your query is - does it always have the same number of columns or not.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Erratic Report Region Behavior with Dynamic SQL Queries

    I'm running HTMLDB v 1.5.1.00.12 and I've noticed some odd behavior with report regions using dynamic SQL queries. Every so often, our testers will run a page containing a dynamic sql report region and get the following error, (despite the fact the query was working only moments ago and no other developer has touched it):
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    or sometimes
    failed to parse SQL query:ORA-01403: no data found
    The only solution I've found so far is to:
    1) Make a copy of the failed report region.
    2) Disable or delete the original failed report region.
    The new copy of the report region runs without issue.
    My search of the forums turned up the following two threads, but neither provided me with a clear explanation of the cause, and how to avoid it:
    ORA-06502:PL/SQL: numeric or value error: character string buffer too small
    Re: Import Export Error (ORA-06502)
    The columns being returned are below the 4000 character limit, and the rows being returned are far less than 32k in size.
    Could this have anything to do with the way HTMLDB is internally storing the PL/SQL used to generate the dynamic SQL Query? Is there any known issue related to this with that version of HTMLDB?
    This problem occurs without any discernable pattern or consistency, making it hard to determine where I should focus my efforts in tracking down the cause.

    Hi all,
    My report seems to be behaving correctly once i set it to "Use Generic Column Names (parse query at runtime only)" :)
    Cheers,
    Joel

  • Report region with sql query

    Hi
    I have a report region with sql query. There are two regions in page. On top of page, user enters data and after that second region show enterd data which is report region
    based on sql query.
    Now,when this page is opned, as user had not entered any thing, report region shows "no data found" message. Is it possible to remove that message or
    may i conditionally disaply report region i.e if data is inserted then only report region is dispalyed.
    Thanks

    >
    i was trying with select count(1) in expression.
    >
    Just for your info, COUNT() (without any grouping obviously) with always return 1 row. If there are no result for the query then 1 row will be returned with a value of zero - so there are results returned.
    Secondly, why were you using COUNT(1) rather than COUNT(*)? That is is faster is a very common misconception and not true. If you need to know how many rows have been returned, use COUNT(*). If you need to take nulls into account (ie. not include them in your count) then use COUNT(column_name) and name the column that you are interested in specifically.
    Cheers
    Ben

  • Sorting report columns for PL/SQL report

    I have created a report of type "Pl/Sql function body returning Sql query" in which I am generating the column names within the query. I would now like to make the first three of these columns sortable. But when I click on the "sort" box for the first three columns, all my column names suddenly switch to "Col 1", "Col 2" etc.
    As you can see by the following snippet from the PL/SQL that generates the query, the column names are data driven, so I'm not in a position to declaratively rename each column. As it happens, the first three columns names are fixed, but all the subsequent column names are data driven.
    Suggestions on how to make the first three columns sortable while preserving the generated column names of the remaining columns?
    thanks
    susan weber
    declare
    query varchar2(4000); -- query
    begin
    query := 'select first_name "First Name", last_name "Last Name", encounter_date "Encounter Date" ';
    for c1 in (select distinct attr_src, attr_code, attr_text, sequence_number from finding_vt)
    loop
    query := query || ', (select val_text from finding_vt vt where vt.encounter_id = e.encounter_id and vt.attr_src = ''' || c1.attr_src || ''' and vt.attr_code = ''' || c1.attr_code || ''' and sequence_number = ' || c1.sequence_number || ') "' || substr(c1.attr_text,0,30) || '"';
    END LOOP;
    query := query || ' from patient pat, encounter e where pat.patient_id = e.patient_id';
    return query;
    end;

    This turns out to be related to the choice of "use generic column names" v. "use query specific column names".
    I had chosen "use generic column names" just to get past the initial creation page. I then debugged the query creation sql, but never changed that setting back to "use query specific column names". The fix is to choose "use query specific column names".

  • SQL Report query with condition (multiple parameters) in apex item?

    Hello all,
    I have a little problem and can't find a solution.
    I need to create reports based on a SQL query or I.R. Nothing hard there.
    Then I need to add the WHERE clause dynamically with javascript from an Apex item.
    Again not very hard. I defined an Apex item, set my query like this "SELECT * FROM MYTAB WHERE COL1 = :P1_SEARCH" and then I call the page setting the P1_SEARCH value. For instance COL1 is rowid. It works fine.
    But here is my problem. Let's consider that P1_SEARCH will contain several rowids and that I don't know the number of those values,
    (no I won't create a lot of items and build a query with so many OR!), I would like sotheming like "SELECT * FROM MYTAB WHERE ROWID IN (:P1_SEARCH) with something like : ROWID1,ROWID2 in P1_SEARCH.
    I also tried : 'ROWID1,ROWID2' and 'ROWID1','ROWID2'
    but I can't get anything else than filter error. It works with IN with one value but as soon as there are two values or more, it seems than Apex can't read the string.
    How could I do that, please?
    Thanks for your help.
    Max

    mnoscars wrote:
    But here is my problem. Let's consider that P1_SEARCH will contain several rowids and that I don't know the number of those values,
    (no I won't create a lot of items and build a query with so many OR!), I would like sotheming like "SELECT * FROM MYTAB WHERE ROWID IN (:P1_SEARCH) with something like : ROWID1,ROWID2 in P1_SEARCH.
    I also tried : 'ROWID1,ROWID2' and 'ROWID1','ROWID2'
    but I can't get anything else than filter error. It works with IN with one value but as soon as there are two values or more, it seems than Apex can't read the string.For a standard report, see +{message:id=9609120}+
    For an IR&mdash;and improved security avoiding the risk of SQL Injection&mdash;use a <a href="http://download.oracle.com/docs/cd/E17556_01/doc/apirefs.40/e15519/apex_collection.htm#CACFAICJ">collection</a> containing the values in a column instead of a CSV list:
    {code}
    SELECT * FROM MYTAB WHERE ROWID IN (SELECT c001 FROM apex_collections WHERE collection_name = 'P1_SEARCH')
    {code}
    (Please close duplicate threads spawned by your original question.)

  • Query Engine report error with Crystal Report 9 And MS SQL SErver 2000

    Hi,
    Currently I m doing a report with Crystal Report 9 and MS SQL as back End.I used a stored procedure to fetch data from DB.The Stored procedure works properly with query analyzer . But when I take report through application
    "Table Not Found" Error is coming.Later I Found that In stored procedure for certain conditions only this error comes.But I cant resolve it.
    Can any One check any pblm with this query
    ELSE IF ISNULL(@intSourceID,0) = 10 Or ISNULL(@intSourceID,0) = 11 Or ISNULL(@intSourceID,0) = 12 Or ISNULL(@intSourceID,0) = 13 Or ISNULL(@intSourceID,0) = 14  
    BEGIN
    IF ISNULL(@intSchemeID,0) <> 0  
    BEGIN
    Select* From table
    END 
    ELSE IF ISNULL(@intSchemeID,0) = 0  
    BEGIN
    Select 
    END 
    END
    When I comment the above codes , report works fine....
    Can any one help me....plz....I m in such a critical situation...

    Hi,
    Currently I m doing a report with Crystal Report 9 and MS SQL as back End.I used a stored procedure to fetch data from DB.The Stored procedure works properly with query analyzer . But when I take report through application
    "Table Not Found" Error is coming.Later I Found that In stored procedure for certain conditions only this error comes.But I cant resolve it.
    Can any One check any pblm with this query
    ELSE IF ISNULL(@intSourceID,0) = 10 Or ISNULL(@intSourceID,0) = 11 Or ISNULL(@intSourceID,0) = 12 Or ISNULL(@intSourceID,0) = 13 Or ISNULL(@intSourceID,0) = 14  
    BEGIN
    IF ISNULL(@intSchemeID,0) <> 0  
    BEGIN
    Select* From table
    END 
    ELSE IF ISNULL(@intSchemeID,0) = 0  
    BEGIN
    Select 
    END 
    END
    When I comment the above codes , report works fine....
    Can any one help me....plz....I m in such a critical situation...
    Refer the above statement highlighted in BOLD. That statement is WRONG. Select what ???? Try any one of the below statement,
    select ''
    --or
    select 0
    --or
    select null
    Regards, RSingh

  • Create a report with PL/SQL

    Hi,
    I have two pages: the first page contains two text fields and a submit button. In the first text field you can enter a name and in the second field you can enter a number. That means you can search a record by name or by number.
    In the second page the report is generated depending on the used text field of the first page.
    I tried to to define a region source code with PL/SQL for the report, but nothing appears on the report page although the record I was looking for exists in the database.
    begin
    if :ENTERNAME IS NOT NULL then
    FOR item IN (select "TB_PERSON_INSTITUTION"."PI_ID" as "PI_ID",
    "TB_PERSON_INSTITUTION"."PI_NAME" as "PI_NAME",
    "TB_PERSON_INSTITUTION"."PI_VORNAME" as "PI_VORNAME",
    from     "TB_PERSON_INSTITUTION" "TB_PERSON_INSTITUTION"
    where      upper("TB_PERSON_INSTITUTION"."PI_NAME") like upper(:ENTERNAME||'%'))
    loop
    DBMS_OUTPUT.PUT_LINE('First name = ' || item.PI_NAME ||
    ', Last name = ' || item.PI_VORNAME);
    end loop;
    end if;
    end;
    Regards
    Mark

    Hi,
    ok thanks. I tried to use the SQL-Report with type "SQL Query (PL/SQL function body returning SQL-Query)" and made a few changes in the SQL-Statement so that a second table is also included:
    declare My_select varchar2(500);
    begin
    if :TEXTEINGABENAME IS NOT NULL then
    My_select:='SELECT
    "TB_ADRESSE"."A_PLZ" "A_PLZ",
    "TB_ADRESSE"."A_ORT" "A_ORT",
    "TB_ADRESSE"."A_ID" "A_ID",
    "TB_PERSON_INSTITUTION"."PI_MITGLIEDSNUMMER" "PI_MITGLIEDSNUMMER",
    "TB_PERSON_INSTITUTION"."PI_NAME" "PI_NAME",
    "TB_PERSON_INSTITUTION"."PI_VORNAME" "PI_VORNAME",
    "TB_PERSON_INSTITUTION"."PI_ERGAENZUNG" "PI_ERGAENZUNG",
    "TB_PERSON_INSTITUTION"."PI_ERGAENZUNG1" "PI_ERGAENZUNG1",
    "TB_PERSON_INSTITUTION"."PI_ID" "PI_ID"
    FROM
    "TB_ADRESSE" "TB_ADRESSE",
    "TB_PERSON_INSTITUTION" "TB_PERSON_INSTITUTION"
    WHERE "TB_PERSON_INSTITUTION"."PI_ID" = "TB_ADRESSE"."A_F_PERSON_INSTITUTION"
    AND upper("TB_PERSON_INSTITUTION"."PI_NAME") like upper(:TEXTEINGABENAME||"%")';
    else
    if :TEXTMITGLIEDSNUMMER is not null then
    My_select:='SELECT
    "TB_ADRESSE"."A_PLZ" "A_PLZ",
    "TB_ADRESSE"."A_ORT" "A_ORT",
    "TB_ADRESSE"."A_ID" "A_ID",
    "TB_PERSON_INSTITUTION"."PI_MITGLIEDSNUMMER" "PI_MITGLIEDSNUMMER",
    "TB_PERSON_INSTITUTION"."PI_NAME" "PI_NAME",
    "TB_PERSON_INSTITUTION"."PI_VORNAME" "PI_VORNAME",
    "TB_PERSON_INSTITUTION"."PI_ERGAENZUNG" "PI_ERGAENZUNG",
    "TB_PERSON_INSTITUTION"."PI_ERGAENZUNG1" "PI_ERGAENZUNG1",
    "TB_PERSON_INSTITUTION"."PI_ID" "PI_ID"
    FROM
    "TB_ADRESSE" "TB_ADRESSE",
    "TB_PERSON_INSTITUTION" "TB_PERSON_INSTITUTION"
    WHERE "TB_PERSON_INSTITUTION"."PI_ID" = "TB_ADRESSE"."A_F_PERSON_INSTITUTION"
    AND upper("TB_PERSON_INSTITUTION"."PI_MITGLIEDSNUMMER") like upper(:TEXTMITGLIEDSNUMMER||"%")';
    end if;
    end if;
    return My_select;
    end;
    When I try to apply changes an error message occurs:
    "Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. The query can not be parsed, the cursor is not yet open or a function returning a SQL query returned without a value."
    Regards,
    Mark

  • SQL Reporting Services with Java EE

    I have developed a Java application for calling the SQL Reports. A couple of reports are made in the server. This SQL Reporting server is deployed and the client is made in the java using Werb services. Whenever a search is done from the Java application, reports are displayed on the JSP page using the web service methods. But the problem is the entire report is displayed. Is there any way to display the report based on the particular item search. Suppose, if search is made on "Australia" in the coulumn Country, the report should contain only Australian related data. Currently the search is based on the report name itself.

    bobz wrote:
    jschell wrote:
    bobz wrote:
    Is there any book on SQL Reporting services with Java
    [http://www.javaworld.com/javaworld/jw-01-2005/jw-0110-sqlrs.html]
    This looks hopeful.I have already developed a java EE for calling reports with the help of ---"MSDN Virtual Lab: Implementing SQL Server Reporting Services with a Java Enterprise Edition (EE) Application (ID:1032315323)". Now I need to find out the parametrized reports(passing parameters to the report calls and more customization using java). In .NET, reportviewer controller is available for this purpose. I want to achieve the same type of thing using java.The protocol of controlling the Report Server is a feature of the Report Server.
    To control it you learn the protocol. To use it you program it in java.
    The first has nothing to do with java. The second obviously does.

Maybe you are looking for