Replace a string in a classic report

Hello

I have a standard report on a page.  Some data in this report must be formatted for display.  For example, one of the fields, a CLOB, may contain zero, one or several line feeds [Chr (10)].  I would like the report to start a new line and display a line empty each time as a CHRI10) is encountered.

In a stored procedure, I use the following and it works fine:

Select references1 in l_reading1 from myTable;

l_reading1: = Replace (l_reading1, Chr (10), "< br / > < br / > '");

How would incorporate this substitute in a statement select Classic report?

Thanks for looking at this.

PhilMan2 wrote:

I have a standard report on a page.  Some data in this report must be formatted for display.  For example, one of the fields, a CLOB, may contain zero, one or several line feeds [Chr (10)].  I would like the report to start a new line and display a line empty each time as a CHRI10) is encountered.

In a stored procedure, I use the following and it works fine:

Select references1 in l_reading1 from myTable;

l_reading1: = Replace (l_reading1, Chr (10),")

');

How would incorporate this substitute in a statement select Classic report?

Using this method, just include replace in the report query:

select
    replace(reading, chr(10), '

') reading from mytable

Set the attribute to text to display as column column of Standard report (or Type as plain text and escape special characters No. in APEX 5.0).

However, the double break is an improper use of the br element and according to the nature of the data a single break can be as well. If the data consists of text paragraphs, use:

select
    '

' || regexp_replace(reading, chr(10) || '+', '

') reading from mytable

in the source report and add a style sheet to the page Inline CSS attribute:

td[headers="READING"] p {
  margin: 1em 0;
}

Another possibility is to mark the data as a pre-formatted text so that line breaks are rendered as breaks:

select
    reading
from
    mytable

with an Expression of HTML in the column attributes:

#READING#

Tags: Database

Similar Questions

  • "Character String Buffer too small" classic report Apex 3.2.1

    Hi all

    I know it's a very old version I mention here, but that's what we have in our environment, would be very grateful if anyone can help out.

    I have a classic report with the sub query in this, I have added a filter using an element from the selection list (P70_GROUP).

    SELECT VWS. ServerID AS Display_ID, vws. ServerID AS ID, vws. Host name, vws. ServerStatus, vws. SiteName AS Site vws. Customer, vws. CoreHours, vws. Patch_Notes, vws. PATCH_DEP, vws. Patch_Day, vws. PATCH_GROUPID, vws. PATCH_TIMEID AS VW_Live_Support FROM Time LEFT JOIN W_Patch_Groups wpg vws WE (vws. Patch_GroupID = wpg.ID) WHERE the vws. ID = ' no AND NVL (wpg. Ignore, 'n') = ' n AND ((: P70_GROUP > 1 AND vws.)) PATCH_GROUPID =: P70_GROUP) OR (: P70_GROUP = 1 AND vws.) (Patch_GroupID IS NULL) OR (NVL(:P70_GROUP,0) = 0)) AND (INSTR (UPPER (vws. Host name), SUPERIOR (NVL (: P70_SEARCH, vws.)) HostName))) > 0 OR INSTR (UPPER (vws. ServerStatus), SUPERIOR (NVL (: P70_SEARCH, vws.)) ServerStatus))) > 0 OR INSTR (UPPER (vws. SiteName), SUPERIOR (NVL (: P70_SEARCH, vws.)) SiteName))) > 0 OR INSTR (UPPER (vws. (Client), SUPERIOR (NVL (: P70_SEARCH, vws.)) Customer))) > 0 OR INSTR (UPPER (vws. CoreHours), SUPERIOR (NVL (: P70_SEARCH, vws.)) CoreHours))) > 0 OR INSTR (UPPER (vws. Patch_Notes), SUPERIOR (NVL (: P70_SEARCH, vws.)) (Patch_Notes))) > 0)

    This is when I select a group in the list, I get

    "error report:

    "ORA-06502: PL/SQL: digital or value error: character string buffer too small.

    an unusual thing, that I've noticed here is when I select "All groups", which returns the value 0, it is works well and return of 3700 lines but when I select any group that returns 10 to 20 lines I get the above error.

    does not include why it is, please help me.

    Kind regards

    Tauceef

    Hi all

    I am able to solve the problem by referring to the link below:

    Huge selection box fails...

    What I am able to solve without even changing the item type. Things are working fine now, but it would be really helpful if someone could give me their expert commentary on the solution above.

    Is this feasible? I'll be able to solve the problem forever, or it will cause problems again in the future?

    Kind regards

    Tauceef

  • change the color of line based on the value of column 5 Apex in the classic report

    Version of the apex 5.0.0.00.31

    Standard universal theme

    Page theme default template

    Classic report

    Foldable report template

    Hello

    I know this question has been asked several times here, but I'm working on 5 Apex and need to know the correct way to do it in this version.

    I need to change the color of the text of the entire line (no background color) based on the value in one of the columns of the classic report. I have just two conditions, if the value of column = Yes, color should be red, otherwise it must be green.

    I am new to jscript and css, so appreciate if someone can tell me the solution with steps.

    I have already checked this link that changes the value of the column, need to do something similar to the whole line.

    https://tylermuth.WordPress.com/2007/12/01/conditional-column-formatting-in-apex/

    Hi coolmaddy007-Oracle,.

    Here's an example set up on the apex.oracle.com according to the specifications you gave: https://apex.oracle.com/pls/apex/f?p=35467:1

    Version of the apex 5.0.0.00.31

    Standard universal theme

    Page theme default template

    Classic report

    Foldable report template

    Here is how it is done:

    Create a dynamic action with the following specifications:

    Name: Give the appropriate name

    Event: After refresh

    Selection type: region

    Region: select your region classic report

    Condition: No strings attached

    Action: Run the JavaScript Code

    Fire on loading the Page: Yes

    Code:

    $('td[headers="JOB"]').each(function() {
      if ( $(this).text() === 'MANAGER' ) {
        $(this).closest('tr').find('td').css({"color":"red"});
      }
      if ( $(this).text() === 'SALESMAN' ) {
        $(this).closest('tr').find('td').css({"color":"green"});
      }
      if ( $(this).text() === 'CLERK' ) {
        $(this).closest('tr').find('td').css({"color":"blue"});
      }
    });
    

    NOTE: Download the selector appropriate for your knowledge $('td[headers="JOB"]') case using firebug/browser development tools.

    Items concerned: leave blank.

    PS: Changed the example to change the color of text instead of the background color.

    I hope this helps!

    Kind regards

    Kiran

  • Adding Tables HTML output of the classic report

    Good day to all.

    XE SUMMIT 4.2.5 11.2 theme 26.

    Im trying to produce a classic report that looks like a Bill... Letterhead at the top and several integrated areas separate table that contain a mixture of static text and retrieved data.

    No matter what I try, I can't get the embedded table borders appears...  The data presents itself, and its all formatted and aligned correctly, but not of borders.   Ive tried just about every report models...

    The following is an example of my SQL: (obviously I would be inserting data in the tables at various points...)

    Select ' < table border = "3" cellpadding = "1" cellspacing = "1" height = "134" width = "381" >

    < tbody >

    < b >

    < td colspan = "2" style = "" text-align: center; "> < span style =" "are-size: 18px;" > invoice </span > < table > ""

    < /tr >

    < b >

    < td >

    < style p = "" left margin: 40px; "> date: < /p >"

    < table >

    < style td = "" text-align: center; ">"

    < style p = "" margin-left: 40px; "> 23 - Sep - 2014 < /p >"

    < table >

    < /tr >

    < b >

    < td >

    < style p = "" left margin: 40px; "> invoice No.: < /p >"

    < table >

    < style td = "" text-align: center; "> < table > 123456"

    < /tr >

    < / tbody >

    < /table > '

    of the double

    I would appreciate if anyone knows how I can achieve this, (or ideas on how to create and invoice report type).

    Kind regards

    Richard

    Richard Legge wrote:

    XE SUMMIT 4.2.5 11.2 theme 26.

    Page, region and report models? (Better yet, create an example on apex.oracle.com...)

    Im trying to produce a classic report that looks like a Bill... Letterhead at the top and several integrated areas separate table that contain a mixture of static text and retrieved data.

    I suggest that you create a custom report template (or several).

    No matter what I try, I can't get the embedded table borders appears...  The data presents itself, and its all formatted and aligned correctly, but not of borders.   Ive tried just about every report models...

    They are being replaced by CSS rules of the theme for the report model.

    The following is an example of my SQL: (obviously I would be inserting data in the tables at various points...)

    Select '

    All of these attributes of table are obsolete and should be implemented using CSS instead (unless you need compatibility with IE6 and 7?).

    I would appreciate if anyone knows how I can achieve this, (or ideas on how to create and invoice report type).

    Tables (especially nested tables) may not necessarily be the way to do it in 2014. Can you put an illustration of the required provision?

    Best way to get help with this would be to create the required tables in the DB with appropriate apex.oracle.com sample data and share identification information of developer comments for the workspace, so we could work on a custom report template.

    Do you need to make this printable?

  • Custom classic report sorting of columns

    I have a classic report in version 4.2.5 which displays the following values in a column:

    9 (4)

    33 (17)

    When I click on the column header and make a descending sort of the 9 just before the 33 because it deals is a string.  JQuery Data Tables can correctly sort numbers with $, (, commas, etc...)  Do the same with a classic report of APEX is anyway?

    https://DataTables.NET/examples/basic_init/table_sorting.html

    Please update your forum profile with a real handle instead of 'user10730448 '.

    See Re: form/sort issue report

  • Conditional expression HTML in a classic report-

    Apex 4.2

    I currently have a column of the report in a classic report that has an attribute of formatting of column as below. It works well, it displays a map icon that when you click on it turns off to google maps and put 2 geo points on a map. However, I need to change this report column so that the HTML expression will be different according to the value that is returned if the column returns the value 1 then the Expression HTML will be slightly different.

    EXPRESSION OF HTML

    < span class = "map_ #BROKE_GEO #_ #VALID_GEO_CODES #" > < a target = _blank href = "f? p = & APP_ID.:323: & SESSION.: P323_PARCEL_ID, P323_SCAN_ID, P323_PROP_ADDR1, P323_PROP_POSTCODE, P323_PROP_LAT, P323_PROP_LONG, P323_SCAN_LAT, P323_SCAN_LONG: & P341_PARCEL_ID, #SCAN_ID #, #LINE_1 #, #POST_CODE #, #PROPERTY_GEO_LAT #, #PROPERTY_GEO_LONG # #SCAN_GEO_LAT #, #SCAN_GEO_LONG #"> < img src =" #WORKSPACE_IMAGES #& P341_IMG_MAP_ #BROKE_GEO #. "alt ="Google Maps"title ="Google Maps"> < / has > < / span >"

    I think I can do this in the source report directly with a case statement and include the HTML code for the column but how do you manage all the quotes in the SQL statement.

    for example

    Original request

    SELECT

    parcel_id

    status

    LOCATION

    scan_date

    scan_id

    driver_comments

    card_id

    , valid_geo_codes - it's my html topic

    property_geo_lat

    property_geo_long

    scan_geo_lat

    scan_geo_long

    broke_geo

    line_1

    post_code

    OF vw_parcel_history_details

    WHERE parcel_id =: p341_parcel_id

    ORDER BY scan_date

    New query

    SELECT

    parcel_id

    status

    LOCATION

    scan_date

    scan_id

    driver_comments

    card_id

    (case

    When valid_geo_codes = 1 then: p341_valid_geo_codes1

    When valid_geo_codes = 2 then: p341_valid_geo_codes2

    When valid_geo_codes = 3 then: p341_valid_geo_codes3

    valid_geo_codes end)

    property_geo_lat

    property_geo_long

    scan_geo_lat

    scan_geo_long

    broke_geo

    line_1

    post_code

    OF vw_parcel_history_details

    WHERE parcel_id =: p341_parcel_id

    ORDER BY scan_date

    I want to put: p341_valid_geo_codes1,: p341_valid_geo_codes2,: p341_valid_geo_codes3,: p341_valid_geo_codes4 be various iterations of this large html string but I do not know how to format because all the quotes off the coast?

    Thank you

    AndyLou wrote:

    I think I can do this in the source report directly with a case statement and include the HTML code for the column but how do you manage all the quotes in the SQL statement.

    With a lot of attention.

    You are on the right track, yes you can do it.  That's all just annoying because the single quotes must be doubled in your SQL to be escaped.

    BUT the good thing is that the double quotes will not affect SQL only single quotes.

    Then. I think that your new query will look like this:

    SELECT
         parcel_id
        ,status
        ,LOCATION
        ,scan_date
        ,scan_id
        ,driver_comments
        ,card_id
        ,(case
          when valid_geo_codes=1 then
          'Google Maps'
          when valid_geo_codes=2 then
          'Google Maps'
          when valid_geo_codes=3 then
          'Google Maps'
          end) valid_geo_codes
        ,property_geo_lat
        ,property_geo_long
        ,scan_geo_lat
        ,scan_geo_long
        ,broke_geo
        ,line_1
        ,post_code
        FROM vw_parcel_history_details
      WHERE parcel_id = :P341_PARCEL_ID
      ORDER BY scan_date
    

    Baring of typos that probably works.

    I think you know that you need to change the display Standard for the HTML column displays in HTML format and not as text.

    I would be remiss in my duty if I did not mention that your values (such as line_1, post_code, etc.) if not controlled can contain the code of script in them, and then you may be susceptible to Cross Site Scripting attacks.  Not a problem for all the world, but it is worth noting.

    Thank you

    -Jorge

    PS. I should add that right now all span three of HTML is the same, if they are going to be the same, then I would refactor this to a single line of HTML and instruction box on the inside for the three sectors of the P341_VALID_GEO_CODES.  in any case, I think you get the idea.

    Post edited by: jrimblas

  • Bug report - classic report lov definition retained when it is no longer relevant

    Hello

    In January, I spotted a case where, the attributes were selected after a selection has been changed, and related fields are hidden in the dev environment.
    http://www.grassroots-Oracle.com/2013/01/dynamic-action-hidden-false-actions.html

    Anthony Rayner asked me on twitter for more examples, and I just found a.

    Classic report - display of the column as "list of selection (query based lov).
    Add sql LOV.
    Replace 'report type column' or 'display as text... '. ', save.
    Change to 'select list... ". '--> lov definition is displayed again.

    I actually founded it after assigning the column standard report column, then copy the page - the LOV was present in the new page!

    Scott

    Scott,

    Thank you for following up on that. I submitted the bug #16482841 to do this, which will be reviewed at the next major release.

    Thanks again.

    Kind regards
    Anthony.

  • Find + replace text (string constant) does not work for screw Statechart module

    Hello

    I tried to do a mass find + replace a string in my code. Using Ctrl + F, LabVIEW 2012 correctly locates all the places where this string exists, including within the States transitions guards who have paths in this form:

    XYZ.lvsciagram.vi / Transition: Guard - diagram, Transition, data/part

    However, when I've specified that a replacement string, then click on 'Replace all', only 'normal' instances of screws replaced - instances in my diagrams had not changed.

    What is going on? Is there anything else I need to do?

    Thanks in advance.

    Looks like those that does not include how to find and replace is implemented in LabVIEW. You can try to replace just the statechart and see if that makes a difference, but it may simply not work.

  • Search and replace the string formatting

    Hello

    I try to do a search and replace the formatting of a string.

    In the example, I'm looking for the string 'SUCCESSFUL', but it must also begin by usbflash and some number + PASSED.

    I can't get the format to have a number between 1 and 99. The number of replacements should add up to 6 in this case. I tried with \d for any number, and I also tried [1-99].

    Make a right-click on the function search and replace the string.  There is an option to use regular Expressions.  Then give it a try.

    EDIT: You need to set the entry replace all to TRUE.

  • replace a string

    is it possible to replace a string? I mean, as in any programming language when you:

    String data = "abc";

    data = 'zxc ';

    I am trying to get the substrings of an initial string like '123.456.789.432.567' separated by the "." character, and when I get "123" at the first iteration, I do not know how to init the second iteration with "456.789.432.567" that I can't change the original string the process gets.

    Thank you

    A quick detour to the String\ vi.llb\Advanced might help a little to that.

    but the Crossrulz method has merit too.

    This period can be a delicate delimiter!

  • I need to replace a string in a text using BACK file.

    I need to replace a string in a text using BACK file. I can't do it manually because the file size is about 2 GB. Please suggest me a solution. Thanks in advance.

    Hi ArunVL,

    See the Microsoft article below and check if it helps.

    With the help of MS-DOS Edlin utility to edit text files

    http://support.Microsoft.com/kb/67706

  • How to replace the string "\" on json webservice?

    Hello

    I have problem with this json

    "{\"search_result\":[{\"name\":\"Mall Summarecon\",\"category\":\"BusinessEntity\",\"id\":\"1\"},{\"name\":\"Bamboo Dim Sum\",\"category\":\"BusinessEntity\",\"id\":\"2\"},{\"name\":\"Dimsum Ceker\",\"category\":\"Item\",\"id\":\"1\"}]}"
    

    I want to replace the string "\".

    the json are already working on my app via .cpp file

    I already add json.replace on my qml

    function simpleSearch(response){
            indicator.stop()
            model.clear()
            console.log("Response: "+response)
            var json = JSON.parse(response)
            json = json.replace('\\', ' ') // this is how the way i replace
            if (json == "[]")
                notFound.visible = true
    
            else
                model.append(json.search_result)
        }
    

    but still does not work

    is there a different way to replace it?

    Thank you

    Change your simpleSearchFinished as follows

    ....simpleSearchFinished()
    {
        QNetworkReply *reply = qobject_cast(sender());
        if (!reply->error()){
            QByteArray response = reply->readAll();
            response.replace("\\", "");
            if (response.startsWith("\"")){
                response.remove(0, 1);
            }
            if (response.endsWith("\"")){
                response.remove(response.length()-1, 1);
            }
            emit simpleSearchDone(response);
        }else{
            const int httpCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
            qDebug() << "ErrorCode" << httpCode << endl << \
                    "ErrorString" << reply->errorString();
            emit error(httpCode, reply->errorString());
        }
        reply->deleteLater();
        manager->deleteLater();
    }
    

    and QML

    function simpleSearch(response){
        indicator.stop()
        model.clear()
        var json = JSON.parse(response)
        if (json){ // is VALID/PARSED
            model.append(json.search_result)
        }
    }
    

    As I wrote, it is not a good workaround solution. The best is to send VALID JSON string directly from your server. But it works

  • Classic report - add the column "select box"?

    I have a classic report and you want to add a column with a check box so that the user can select several lines and perform an action on all of the lines (delete selected, for example).  Looks like it should be easy and maybe integrated features, but I don't find it.  Is there a standard way to do this?

    Steve

    APEX 5.0

    Hello

    to add a box to your classic report using apex_item.checkbox like this API function:

    select
        APEX_ITEM.CHECKBOX(p_idx=>1, p_value=>DEPTNO)  as select_dept,
        DEPTNO as DEPTNO,
        DNAME as DNAME,
        LOC as LOC
    from DEPT
    

    You can access the values checked (for example in a process page)

    declare
    v_deleted_depts number := 0;
    begin
    FOR i in 1..APEX_APPLICATION.G_F01.count
    LOOP
      v_deleted_depts := v_deleted_depts + 1;
      delete from dept where deptno = APEX_APPLICATION.G_F01(i);
    END LOOP;
    :P1_DEPTCOUNT := v_deleted_depts;
    end;
    

    P1_DEPTCOUNT (hidden) is just for later interaction with this procedure - for example, you want to present your users with a message of success and error custom as "Deleted & P1_DEPTCOUNT. departments. »

    Maybe you would like to add an option to check all checkboxes at once. If so, read this blogpost Blog of Carl Backstrom: September 2007.

    Kind regards

    Pavel

    Edit: don't forget to toggle the leak key for special characters not your column "checkbox.

  • Aliging two tables side by side on a classic report

    Hello

    I have three regions on my page. The first two regions are of pie charts and appear side by side.


    The third area is a classic report and appears in graphic regions.


    The problem is that the first chart area has the same width as the region of the classic report. This causes a gap between the two tables. How can I remove the gap between the two graphic region, ignoring all that is the width of the classic report?

    The page below shows an example:

    https://Apex.Oracle.com/pls/Apex/f?p=76322:22

    Username: forum

    Password: abc123

    Thank you

    Zkay

    ZKay wrote:

    Thanks for the reply. It reminded me of the importance of mentioning the version etc.

    I use 11g with Apex 4.0. and the generator 101 Blue theme.

    So, please advise to what precedes.

    APEX 4.0, according to me, you will need to assign property attributes of the region HTML table cells of the region report colspan="2" or put the report on a different display area point tables, say body Page Template (1 points below the content of the region) for maps and body Page Template (2 items below the content of the region) for the report.

  • Help with an Export on a classic report 4.2.5.00.08

    Version: 4.2.5.00.08

    Hello

    I have a classic report using Break formatting (on the first column). When the report is exported, for example, if there are 3 lines that are in this group only the first cell is filled and the other 2 are NULL.

    Like this:

    rpt.jpg

    Users than the State of export, like this:

    rpt2.jpg

    One way to do that was to create a second report without breaking formatting set and fix the terms at a time so that when the "Download" link has been activated the second report, the report without breaking format, would go and download.

    My problem is that I forgot how to set the conditions for that to happen.

    Can someone help me to implement?

    OR

    Now is a way to get the formatting AND data in all cells?

    Can what information I provide?

    Thank you

    Joe

    Joe R wrote:

    I have change the post when you have you answer. A question arose, the download can cause all the filled cells AND formatting break?

    Lol you would perform the calculations super aggregate in the report of export SQL using GROUPING SETS or CUMULATIVE instead of APEX report put break in shape.

Maybe you are looking for