Export_to_Excel_pkg - How to exclude some fields in the export?

While it does generate an excel spreadsheet, it includes all the columns of my report even though I have conditions on most of them. I allow the user to select the columns he/she wants in the report. So I want the Excel spreadsheet to have the same fields as the report. How can this be accomplished?
<br><br>
I use APEX 3.0.1 not APEX 3.1 and I don't use a report server.
<br>
<br>
Please help!
<br>
Regards,
Robert

I was able to create an Excel spreadsheet excluding some fields based on the column's condition. I accomplished this by modifying the Export_to_Excel_pkg package. I added a new procedure and modified an existing one (print_report_header). I bolded the area where I changed or added code.<br><br>
FOR c IN (SELECT   column_alias, NVL (heading, column_alias) heading,
                   format_mask
,condition_type,condition_expression1,condition_expression2
              FROM apex_application_page_rpt_cols
             WHERE page_id = p_page_id
               AND application_id = p_app_id
               AND region_id = TO_NUMBER (LTRIM (p_region, 'R'))
  -- AND include_in_export = 'Yes'
AND (column_link_text is null or
(column_link_text is not null and
UPPER(column_link_text)=UPPER(column_alias))
)            -- and column_is_hidden = 'No'
          ORDER BY display_sequence)
     LOOP
if upper(c.condition_type) = 'PLSQL_EXPRESSION' then
export_excel_pkg.get_include_in_report(p_page_id
,p_app_id
,p_region
,c.column_alias
,c.condition_expression1
,v_include_in_report);
if v_include_in_report <> 'YES' then
goto next_field;
else
null;
end if;
else
null;
        end if;
        v_number_of_cols := v_number_of_cols + 1;
        v_column_header_list :=
                v_column_header_list || ';' || REPLACE (c.heading, ';', ' ');
        v_column_alias_list := v_column_alias_list || ';' || c.column_alias;
        -- apply column formatting
        IF c.format_mask IS NOT NULL
        THEN
           v_column_select_list :=
                 v_column_select_list
              || ',to_char('
              || c.column_alias
              || ','''
              || c.format_mask
              || ''') '
              || c.column_alias;
        ELSE
           v_column_select_list :=
                               v_column_select_list || ',' || c.column_alias;
        END IF;
<<next_field>>
null;     END LOOP;
The new procedure:<br>
PROCEDURE get_include_in_report (
p_page_id IN number,
p_app_id IN number,
p_region IN VARCHAR2,
p_column_alias IN VARCHAR2,
p_condition_expression1 IN VARCHAR2,
p_include_in_report OUT VARCHAR2)
AS
v_condition varchar2(20) := 'PLSQL_EXPRESSION';
v_query varchar2(32767);
v_include varchar2(3) := 'NO';
v_cur_hdl INT;
v_rows_processed INT;
begin
v_query :=
'SELECT ''YES'' '
|| 'FROM apex_application_page_rpt_cols '
|| 'WHERE page_id = :g_page_id '
|| 'AND application_id = :g_app_id '
|| 'AND region_id = TO_NUMBER (LTRIM (:g_region, ''R'')) '
|| 'AND condition_type = :g_condition '
|| 'AND column_alias = :g_alias '
|| 'AND ' || p_condition_expression1 ;
-- open cursor
v_cur_hdl := DBMS_SQL.OPEN_CURSOR;
-- parse the query
DBMS_SQL.PARSE(v_cur_hdl,v_query,DBMS_SQL.NATIVE);
-- Supply binds (bind by name)
DBMS_SQL.BIND_VARIABLE(v_cur_hdl, 'g_page_id',p_page_id);
DBMS_SQL.BIND_VARIABLE(v_cur_hdl, 'g_app_id', p_app_id);
DBMS_SQL.BIND_VARIABLE(v_cur_hdl, 'g_region', p_region);
DBMS_SQL.BIND_VARIABLE(v_cur_hdl, 'g_condition',v_condition);
DBMS_SQL.BIND_VARIABLE(v_cur_hdl, 'g_alias',p_column_alias);
-- Describe defines
DBMS_SQL.DEFINE_COLUMN(v_cur_hdl, 1, v_include, 3);
-- Execute
v_rows_processed := DBMS_SQL.EXECUTE(v_cur_hdl);
-- Fetch a row
IF DBMS_SQL.FETCH_ROWS(v_cur_hdl) > 0 THEN
-- Fetch columns from the row
DBMS_SQL.COLUMN_VALUE(v_cur_hdl, 1, v_include);
-- Process
ELSE
null;
END IF;
DBMS_SQL.CLOSE_CURSOR(v_cur_hdl); -- close cursor
p_include_in_report := v_include;
end;
<br>
<br>
I hope this helps others as well.
<br>
<br>
Regards,<br>
Robert

Similar Messages

  • How to have some fields in the header of the report

    Hi All,
    we would like to have some fields in the header of the report (every page but the first page), but Word won’t let you insert fields into the header. Are there any work arounds to do something like that?
    Thanks,
    Vandana

    'Insert Menu -> Field' does not work for headers.
    Try this. Say if you want to insert a XML tag named TRX_NUMBER in header. Put <?TRX_NUMBER?> in the header. This will display TRX_NUMBER tag in header.

  • EXPORT at schema level, but exclude some tables within the export

    I have been searching, but had no luck in finding the correct syntax for my situation.
    I'm simply trying to export at the schema level, but I want to omit certain tables from the export.
    exp cltest/cltest01@clprod file=exp_CLPROD092508.dmp log=exp_CLPROD092508.log statistics=none compress=N
    Thanks!

    Hi,
    Think in simple first.. you use the TABLES Clause..
    Example.
    exp scott/tiger file=empdept.expdat tables=(EMP,DEPT) log=empdept.log
    In case if you scehma contains less number of tables.. !!
    Logically if you have large number of tables, I say this solutuion might work ...all around... alternative solutions to solve the problems.. If you have hundered of tables... in your schema....
    Try to Create a New Schema and using CTAS create a tables which are skippable in the Current Scehma.
    Do an Export and once the Job Done.. you recreate the backup fom New schema
    and Import to DB (Destinaiton)
    - Pavan Kumar N

  • I want to add some fields in the report of FBL5N, Can anybody tell me how ?

    I want to add some fields in the report of FBL5N, Can anybody tell me how to do it?
    The fields are sales order, delivery, order quantity, net value and others.
    I can only find the shipment number in FI document.
    Thank you very much.

    Dear Jie,
    Billing document number can be displayed in customer line item display
    (FBL5N) and not in G/L line item display (FBL3N).
    The value of VBELN is saved in table BSEG. So, this means, you
    have to define the field BSEG-VBELN as a special field in table
    T021S. Then you can use it in FBL3N, because then the report looks
    directly in BSEG-VBELN.
    For further information,please read the SAP note 207436. You don't have to
    implement the coding corrections, if they are already in your system
    with the hotpackage. But it explains very detailed the system
    behaviour. The example in the note with field EBELN could be
    replicated on your field VBELN.
    About the MEINS field, please refer to 1-U_MEINS (bseg-meins field).
    The SAP note 215798 may also be helpful.
    Mauri

  • How to update dataobject via EMS so that some fields remain the old values?

    Hi,
    I use EMS/JMS to upsert my dataobject. While it works well for inserting a new row, it has a problem in update. For example, I want to update only one field in the dataobject and need other fields remain intact. I've tried to 1) exclude those fields from the XML payLoad, 2) include those fields with empty values. None of them works. For boolean type, it will set those fields to default value ("false"). For other data types, the update message doesn't get thru, i.e. no update is done. An example XML payLoad is as followed:
    "<rawData>" +
    "<ClientName>BAMProvider1</ClientName>" +
    "<AvailableForCall>true</AvailableForCall>" +
    "<AvailableForChat></AvailableForChat>" +
    "<AvailableForServiceRequest>true</AvailableForServiceRequest>" +
    "<CountOfChannels>10</CountOfChannels>" +
    "</rawData>"
    Would you please help?
    Thanks,
    ting

    When you say "Primary Key" of the dataobject do you mean at the EMS queue configuration "Source to Data Object Field Mapping" check a field as "Key"? If so, yes I have checked a non-nullable field as "Key". I don't know how to set a primary key at the data object layout definition level though.
    Key Tag name Data Object Field
    X ClientName. ClientName.
    . AvailableForCall. AvailableForCall.
    . AvailableForChat. AvailableForChat.
    . AvailableForServiceRequest. AvailableForServiceRequest.
    . CountOfChannels. CountOfChannels.
    The layout of the data object is as followed:
    Field name Field ID Field type Max length Scale Nullable Public
    ClientName _ClientName string 100 - No Yes -  -  - 
    AvailableForCall _AvailableForCall boolean - - No Yes -  -  - 
    AvailableForChat _AvailableForChat boolean - - No Yes -  -  - 
    AvailableForServiceRequest _AvailableForServiceRequest boolean - - No Yes -  -  -
    CountOfChannels _CountOfChannels integer - - Yes Yes -  -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to make some fields in ALV tree editable

    Hello All,
    Can any one tell me how to make some fields in ALV tree editable.
    If possible please post some code.
    Regards,
    Lisa.

    Hi Lisa,
    I want to make 3 fields in the ALV tree editable and update the saved values in ztable.
    I tried making the wa_fieldcat-edit = 'X' But in vain.
    Also i made the layout fields  wa_layout-edit = 'X'  and wa_layout-edit_mode = 'X'.
    But still the alv tree field appears as display.
    As you have mentioned in the post as answered, So please guide me to make the field editable.
    I am using oops method.
    Please provide me code if any.
    Thanks & Regards,
    Mozila

  • How to exclude some tables from schema level replicatio????

    Hi,
    I am working on oracle10g stream replication.
    My replication type is "Schema Based".
    So can anyone assist me to undersatnd, how to exclude some tables from schema based replication.
    Thanks,
    Faziarain

    You can use rules and include them in the rule set, lets say you dont want LCR to be queued for table_1 in schema SALES, write two rules one for DDL and another for DML with NOT logical condition.
    DBMS_RULE_ADM.CREATE_RULE(
    rule_name => 'admin.SALES_not_TALBE_1_dml', condition => ' (:dml.get_object_owner() = ''SALES'' AND NOT ' ||
    ' :dml.get_object_name() = ''REGIONS'') AND ' ||
    ' :dml.is_null_tag() = ''Y'' ');
    DBMS_RULE_ADM.CREATE_RULE(
    rule_name => 'admin.hr_not_regions_dlll',
    condition => ' (:dml.get_object_owner() = ''SALES'' AND NOT ' ||
    ' :ddl.get_object_name() = ''table_!'') AND ' ||
    ' :dsl.is_null_tag() = ''Y'' ');
    just go through this document once, http://download.oracle.com/docs/cd/B28359_01/server.111/b28321/strms_rules.htm#i1017376
    Edited by: user8710159 on Sep 16, 2009 5:21 PM

  • How to exclude some tables in inoort

    Hi all,
    how to exclude some tables . For example, I have Oracle
    export file which contains a hundred tables, but I want to import all the tables except one, i.e. its (some table name) . Can I achieve this goal?
    thanks in advance.

    Hello,
    It depends on your Oracle Release.
    Up to Oracle *9.2* you have just the classical export/import utility.
    So, you'll have to list the Tables you want to Import with the following parameter:
    TABLES=(
    <table_1>,
    <table_n>
    )Starting with *10.1* you have the Datapump (expdp / impdp). With this new utility you have the very useful parameter EXCLUDE. It works like that:
    EXCLUDE=TABLE:"='<table>'"Please find a link about this topic:
    http://www.oraclefaq.net/2007/03/09/expdp-datapump-excludeinclude-parameters/
    Hope this help.
    Best regards,
    Jean-Valentin

  • CRM  IC Winclient - How to add new fields in the BP Search of TRX CIC0

    Hello Experts,
    I want to know how to add new fields in the BP Search of TRX CIC0. In the HTML that we're using here I need to add the URL of the BP.
    Can you help me?
    Thanks in advance.
    Caíque Escaler

    Hi
    make append to tables in se11 - CCMBP1FIELDS, CCMBP2FIELDS
    in spro in Define customer-specific search control -> mark fields with X.
    and enhance html template CRM_CIC_SEARCH_DISPLAY. -> tcode smw0, look for package CRM_CIC_COMPONENTS for html CRM_CIC_SEARCH_DISPLAY. export it from SAP, edit, and import.
    you will need to enhance function module used for searching - you will find him in spro in Search Strategies.
    Regards
    Radek

  • How to add new fields to the system form (Ex.expenses to a/r invoice form)

    hi
    can any one tell me how to add new fields to the system form (Ex.expenses to a/r invoice form)
    i want to add expenses field to system a/r invoice form and connect data base also.
    i used the code of samples\11.system form manipulation(vb.net) but i'm not able to get it....so can any one help with code or concepts.
    reply soon plz..
    thankQ

    If I understood you correctly, you are just trying to add new fields to the invoice form and then use them in your form. you should first go and add the field to your tables, which you would do by going to Tool --> User Defined Fields --> Manage User Fields. There are different documents or categories given. For ex. for invoices, Sales Orders you would add your field under the Marketing Documents. If you want the field to be just one per invoice, add it to the Title, otherwise if you want a field per invoice or Sales Order line, add it to the Rows section. Once you have done that then you can just create a edit box or drop down to represent the field and set the datasource for that to your field. If you want example code to do that, let me know.

  • How to add some days to the current system date

    can anyone help how to add some days to the current date i.e if today is 3-12-2007 and if v add 15 more days then the output should be 18-12-2007

    RajeshChandan wrote:
    First of all thanks a lot ,and coming to the question i dont mean to change the sysdate instead i want to write a prg. where after entering the current date it should effect with the no.of days that i have given but not the system date .if u can answer please reply for thisAh, I see. In that case, you can use an instance of GregorianCalendar and use it's add(...) method to add days, months, years etc. to it.
    http://java.sun.com/javase/6/docs/api/java/util/GregorianCalendar.html
    Good luck.

  • How to update ABSKZ field in the table EKPO

    Hi
    Is there any way to update the rejection indicator (ABSKZ) field of table EKPO?.
    I am looking at BAPI_CHANGE_PO FM, But it does not have ABSKZ field in the item structure BAPIMEPOITEM.
    Do I need to extend the BAPI structure with ABSKZ field ?
    Regards
    Raj.

    Hi
    To extend  BAPI_PO_CHANGE  for EKPO-ABSKZ field , we have to add field in the structure BAPI_TE_MEPOITEM to pass it to  EXTENSIONIN. As ABSKZ field already availble in the EKPO it is not allowed to add ABSKZ in the structure BAPI_TE_MEPOITEM. it is throwing below error message.
    Field ABSKZ in table EKPO is specified twice. Please check
    Since it is not Z field and also not availble in the structure BAPIMEPOITEM  not sure how to update ABSKZ field in the EKPO table.
    Please advice.
    Regards
    Raj

  • How to validate input fields as the user is filling up a form with jQuery?

    Hello EA friends.
    Someone has experimented on how to validate input fields as the user is filling up a form with jQuery?, if the field is numeric and insert an A for example, an alert appears showing "insert a number" or not allowed to enter anything until a number is entered.
    Thanks and regards.
    Fer

    Hi Sudeshna.
    Sorry for not responding on time, how can I be included in this code?
    sym.setVariable("typeActivity", "input")
    var Element_1=document.createElement(typeActivity);
    $(Element_1).css({"text-align": "center"});
    //Answer
    sym.setVariable("Answer_1", "4");
    sym.$("box_1").append(Element_1)
    This code is on my creationComplete and it works fine.
    Would greatly appreciate your help.
    Regards.
    Fer García

  • How to hide some functions in the menu bar of flash paper

    Do anyone know how to hide some functions in the menu bar of
    flash paper? As I want to show a swf file(converted from pdf) on
    the website without printing function. How can I do it?
    Also, if possible, can anyone know how to hide all functions
    on the menu bar except the logo of flash paper?
    Thank you very much, it is very urgent.

    Here is an article about how to integrate flashPaper into
    Director. It has most of the functions that can be executed on
    flashPaper. Maybe it will help?
    http://www.adobe.com/devnet/director/articles/flashpaper_in_director.html
    and here is all his code
    http://www.mediamacros.com/item/item-1006687373/
    Note: it is for 1.01, but works with 2.0

  • How to Add IBAN Field in the Bank Details Infotype?

    Hello All,
    I need to know the procedure for How to add IBAN field in the bank details infotype?
    Could anyone help me please.
    I m new to SAP HR.
    Immediate help will be appreciated.
    Thanks.
    Regards,
    Mudassir.Imtiaz

    Hi mudassir,
    For IBAN implementation:
    1. Implement SAP Notes 925410, 1409674, 1405521
    2. Go to t-code FIBF - From menu select Settings - P/S Modules - of an SAP Application - Create entry
    For Turkey we've added the following entry (depends on country) :
    00003040 TR CONVERT_IBAN_2_BANK_ACCOUNT_TR
    3. Go to V_T588M for module pool MP000900 and screen 2000 select IBAN & Q0009-IBAN00 fields as standard.
    4. Go to table T77S0 and make value of ADMIN IBAN entry S.
    Regards,
    Dilek

Maybe you are looking for

  • Null secondary index?

    I'm using Berkeley DB Java Edition with the Collections API. I want to know if it's possible to have a secondary index that is a null value. My persisted object has an optional email field. Email is a secondary index. Everything works except when the

  • Emails on Nokia 6233

    I am having difficulty in opening/finding webmail emails on my Nokia. I can access the internet and the website for webmal but after successfully entering my email address and password the webmail doesn't open. Instead I get a message saying "unknown

  • HT4906 No photo stream

    My icloud on my mac book is not letting me click on photo stream - any ideas why not? I can't see my photos in iphoto from my imac.

  • OS X Yosemite fails: Please help

    I tried to install the new OS X Yosemite from the App store and it fails to get downloaded completely. Error: The application could not be downloaded. An error occurred while running scripts from the package "pdl8741854432473810418.pkg". I tried to d

  • SAPconsole Architecture

    We're evaluating use of SAPconsole in our warehouses. Everywhere I've seen a diagram of the standard architecture, SAPconsole is installed on the same server that the telnet server is installed on which is located at the plant level. Our question is,