XML/RTF Data Template Question : Linking

Ok, I have my data template here however when I try to print it, BIP makes no attempt to link the queries. I am using the Bind Method here with an XML Data Template.
Data template is:
<dataTemplate name="Orders_Dataset" description="List of Orders with Details" dataSourceRef="COE" defaultPackage="results_report">
<parameters>
<parameter name="TERM" dataType="character"/>
</parameters>
<dataQuery>
<sqlStatement name="People_Query">
<![CDATA[SELECT DISTINCT PERSON Personp, RECTYPE RECTYPEP, SEC SECP, TERM TERMP, (SELECT TERMNAME FROM TERM b WHERE b.BANNER_CODE = TERM ) termnamep, PERSON || ' ' || SEC PERSEC FROM COE_DATA]]>
</sqlStatement>
<sqlStatement name="General_Questions_Query">
<![CDATA[select DISTINCT d.PERSON PERSON, d.SEC SEC, q.Q_Number Q_Number, q.Q_ID Q_ID, TRIM(q.TEXT) text, TRIM(q.A1) A1, TRIM(q.A2) A2, TRIM(q.A3) A3, TRIM(q.A4) A4, TRIM(q.A5) A5, TRIM(A6) A6 from  COE_DATA d, coe_questions q WHERE q.Q_Number = d.Q_ID and Q_Number < 6 and d.Person = :Personp order by Q_Number]]>
</sqlStatement>
<sqlStatement name="Department_Questions_Query">
<![CDATA[select DISTINCT d.PERSON PERSON, d.SEC SEC, q.Q_Number Q_Number, q.Q_ID Q_ID, TRIM(q.TEXT) text, TRIM(q.A1) A1, TRIM(q.A2) A2, TRIM(q.A3) A3, TRIM(q.A4) A4, TRIM(q.A5) A5, TRIM(A6) A6 from  COE_DATA d, coe_questions q WHERE q.Q_Number = d.Q_ID and d.Person = :Personp order by Q_Number]]>
</sqlStatement>
<sqlStatement name="Results_Query">
<![CDATA[SELECT DISTINCT a.person person, a.rectype rectype, a.sec sec, a.term term, a.Q_ID q_id,
NVL((SELECT b.PERCENTVALUE FROM coe_data b where a.person = b.person and a.rectype = b.RECTYPE and a.sec = b.sec and a.term = b.term and a.Q_ID = b.Q_ID and b.AD_ID = 1 ), '0 |  0.00%') A1,
NVL((SELECT c.PERCENTVALUE FROM coe_data c where a.person = c.person and a.rectype = c.RECTYPE and a.sec = c.sec and a.term = c.term and a.Q_ID = c.Q_ID and c.AD_ID = 2 ), '0 |  0.00%') A2,
NVL((SELECT d.PERCENTVALUE FROM coe_data d where a.person = d.person and a.rectype = d.RECTYPE and a.sec = d.sec and a.term = d.term and a.Q_ID = d.Q_ID and d.AD_ID = 3 ), '0 |  0.00%') A3,
NVL((SELECT f.PERCENTVALUE FROM coe_data f where a.person = f.person and a.rectype = f.RECTYPE and a.sec = f.sec and a.term = f.term and a.Q_ID = f.Q_ID and f.AD_ID = 4 ), '0 |  0.00%') A4,
NVL((SELECT g.PERCENTVALUE FROM coe_data g where a.person = g.person and a.rectype = g.RECTYPE and a.sec = g.sec and a.term = g.term and a.Q_ID = g.Q_ID and g.AD_ID = 5 ), '0 |  0.00%') A5,
NVL((SELECT h.PERCENTVALUE FROM coe_data h where a.person = h.person and a.rectype = h.RECTYPE and a.sec = h.sec and a.term = h.term and a.Q_ID = h.Q_ID and h.AD_ID = 6 ), '0 |  0.00%') A6, 1 o_id
  FROM coe_data a where term = :termp and a.Q_ID = :Q_Number and a.sec = 'COE' and a.person = 'COE'
UNION
SELECT DISTINCT a.person person, a.rectype rectype, a.sec sec, a.term term, a.Q_ID q_id,
NVL((SELECT b.PERCENTVALUE FROM coe_data b where a.person = b.person and a.rectype = b.RECTYPE and a.sec = b.sec and a.term = b.term and a.Q_ID = b.Q_ID and b.AD_ID = 1 ), '0 |  0.00%') A1,
NVL((SELECT c.PERCENTVALUE FROM coe_data c where a.person = c.person and a.rectype = c.RECTYPE and a.sec = c.sec and a.term = c.term and a.Q_ID = c.Q_ID and c.AD_ID = 2 ), '0 |  0.00%') A2,
NVL((SELECT d.PERCENTVALUE FROM coe_data d where a.person = d.person and a.rectype = d.RECTYPE and a.sec = d.sec and a.term = d.term and a.Q_ID = d.Q_ID and d.AD_ID = 3 ), '0 |  0.00%') A3,
NVL((SELECT f.PERCENTVALUE FROM coe_data f where a.person = f.person and a.rectype = f.RECTYPE and a.sec = f.sec and a.term = f.term and a.Q_ID = f.Q_ID and f.AD_ID = 4 ), '0 |  0.00%') A4,
NVL((SELECT g.PERCENTVALUE FROM coe_data g where a.person = g.person and a.rectype = g.RECTYPE and a.sec = g.sec and a.term = g.term and a.Q_ID = g.Q_ID and g.AD_ID = 5 ), '0 |  0.00%') A5,
NVL((SELECT h.PERCENTVALUE FROM coe_data h where a.person = h.person and a.rectype = h.RECTYPE and a.sec = h.sec and a.term = h.term and a.Q_ID = h.Q_ID and h.AD_ID = 6 ), '0 |  0.00%') A6, 2 o_id
  FROM coe_data a where term = :termp and a.Q_ID = :Q_Number and a.sec = :secp and a.person = :secp
UNION
SELECT DISTINCT a.person person, a.rectype rectype, a.sec sec, a.term term, a.Q_ID q_id,
NVL((SELECT b.PERCENTVALUE FROM coe_data b where a.person = b.person and a.rectype = b.RECTYPE and a.sec = b.sec and a.term = b.term and a.Q_ID = b.Q_ID and b.AD_ID = 1 ), '0 |  0.00%') A1,
NVL((SELECT c.PERCENTVALUE FROM coe_data c where a.person = c.person and a.rectype = c.RECTYPE and a.sec = c.sec and a.term = c.term and a.Q_ID = c.Q_ID and c.AD_ID = 2 ), '0 |  0.00%') A2,
NVL((SELECT d.PERCENTVALUE FROM coe_data d where a.person = d.person and a.rectype = d.RECTYPE and a.sec = d.sec and a.term = d.term and a.Q_ID = d.Q_ID and d.AD_ID = 3 ), '0 |  0.00%') A3,
NVL((SELECT f.PERCENTVALUE FROM coe_data f where a.person = f.person and a.rectype = f.RECTYPE and a.sec = f.sec and a.term = f.term and a.Q_ID = f.Q_ID and f.AD_ID = 4 ), '0 |  0.00%') A4,
NVL((SELECT g.PERCENTVALUE FROM coe_data g where a.person = g.person and a.rectype = g.RECTYPE and a.sec = g.sec and a.term = g.term and a.Q_ID = g.Q_ID and g.AD_ID = 5 ), '0 |  0.00%') A5,
NVL((SELECT h.PERCENTVALUE FROM coe_data h where a.person = h.person and a.rectype = h.RECTYPE and a.sec = h.sec and a.term = h.term and a.Q_ID = h.Q_ID and h.AD_ID = 6 ), '0 |  0.00%') A6, 3 o_id
  FROM coe_data a where term = :TERMP and a.Q_ID = :Q_NUMBER and a.sec = :SECP and a.person = :PERSONP order by o_id, rectype]]>
</sqlStatement>
</dataQuery>
<!--dataTrigger name="beforeReport" source="results_report.beforeReportTrigger"/-->
<dataStructure>
<group name="G_People" source="People_Query">
<element name="Person" value="personp"/>
<element name="Section" value="secp"/>
<element name="Course_Number" value="RECTYPEP"/>
<element name="Term" value="TERMP"/>
<element name="PERSEC" value="PERSEC"/>
<group name="G_GENERAL_QUESTIONS" source="Department_Questions_Query">
<element name="GQuestion_Text" value="text"/>
<element name="GQuestion_Number" value="Q_Number"/>
<element name="GQ1" value="A1"/>
<element name="GQ2" value="A2"/>
<element name="GQ3" value="A3"/>
<element name="GQ4" value="A4"/>
<element name="GQ5" value="A5"/>
<element name="GQ6" value="A6"/>
<group name="G_GENERAL_ANSWERS" source="Results_Query">
<element name="GAPerson" value="person"/>
<element name="GArec" value="rectype"/>
<element name="GAsec" value="sec"/>
<element name="GARQ_ID" value="Q_ID"/>
<element name="GA1" value="A1"/>
<element name="GA2" value="A2"/>
<element name="GA3" value="A3"/>
<element name="GA4" value="A4"/>
<element name="GA5" value="A5"/>
<element name="GA6" value="A6"/>
</group>
</group>
<group name="G_DEPARTMENT_QUESTIONS" source="Department_Questions_Query">
<element name="DQuestion_Text" value="text"/>
<element name="DQuestion_Number" value="Q_Number"/>
<element name="DQ1" value="A1"/>
<element name="DQ2" value="A2"/>
<element name="DQ3" value="A3"/>
<element name="DQ4" value="A4"/>
<element name="DQ5" value="A5"/>
<element name="DQ6" value="A6"/>
<group name="G_DEPARTMENT_ANSWERS" source="Results_Query">
<element name="DAPerson" value="person"/>
<element name="DArec" value="rectype"/>
<element name="DAsec" value="sec"/>
<element name="DARQ_ID" value="Q_ID"/>
<element name="DA1" value="A1"/>
<element name="DA2" value="A2"/>
<element name="DA3" value="A3"/>
<element name="DA4" value="A4"/>
<element name="DA5" value="A5"/>
<element name="DA6" value="A6"/>
</group>
</group>
</group>
</dataStructure>
</dataTemplate>
I am trying to establish all my linking in this data template. However I noticed a discrepancy between the expected output and what I received. For some reason at the 3rd level of the dataStructure (the answer level), it restarts at Q_ID = 1 instead of whatever the Q_Number is from the level above. In my case all of the answers are in the same table regardless of category. Can someone offer up any help with fixing my template?
I did notice something odd, for G_DEPARTMENT_ANSWERS it is working correct but does not work for G_GENERAL_ANSWERS.

Warren,
You need to select data source type as DataTemplate and then cut and paste your DataTemplate in the text editor window.
Make sure you define the dataSourceRef in dataTemplate Header. The dataSourceRef is the DataSource (JDBC Connection) you define through Administartion.
<dataTemplate name="Employee" description="Template description" dataSourceRef="demo">
-Ashish

Similar Messages

  • How to generate xml using "Data Template"

    Hi,
    Can any one please tell me the steps to create xml using "Data Template".
    As per the user guide the execution method for "data Template" is "Java Concurrent Program" and the Executable mentiones is "XDODTEXE".
    But there is no information about the "execution file name" and "execution path name" which is mandatory.
    Thanks and Regards,
    Sandhya

    Hi Sandhya,
    To put a Data Template into use, you don't need to define any new executables. XDODTEXE executable is already registered in the system, as it ships with the application. The Data Template is not an executable as such, but a collection of instructions for what queries to perform and what should the resulting XML look like. XDODTEXE knows how to interpret those instructions, and produce the XML output.
    (And if you add a layout template, handle that too.)
    You do need to do the following:
    1) Create a new Data Definition (XML Publisher Administrator > Data Definitions)
    2) Upload your Data Template (remember the Code for the next step)
    3) Create a Concurrent Program that is linked to the Data Definition (Short Name = Code) (System Administrator > Program > Define)
    4) Add your Concurrent Program to a Request Group (System Administrator > Security > Responsibility > Request)
    I recommend you take a look at the XML Publisher Administration and Developer's Guide, you will find more information there.
    (http://download-west.oracle.com/docs/cd/B40089_02/current/acrobat/120xdoig.pdf)
    Best Regards & Happy New Year 2008,
    Matilda Smeds

  • Create XML using Data Templates

    Is anyone familiar will a tool, other than oracle that will create XML from data template definitions.
    I trying to understand if the data template definitions are an Oracle specific tool that only Oracle can use to generate XML files.
    If this is specific to Oracle, is there an easier way to use the data templates to generate XML without registering them in the concurrent manager, XMLP Admin, and then executing the concurrent process?
    I'm looking for a shortcut to testing these files without having to register everything.

    Why not using XML Publisher Standalone aka Enterprise 5.6.2 ?
    There you can generate the XML based on data templates without registering anything. The installation is quite easy.
    Juergen

  • XML Publisher --Data Template-Help

    Hi
    we are using XML Publisher attached to R12 , we are using data template ( .XML file) in data definition .
    we have a requirement for master details report. for that we have parent query and child query .the data coming to parent query should be the parameter to child query
    Exp-- Parent Query-- select empno from emp
    Child Query --select  * from dept where empno=:p_empno (p_empno =empno from Parent query ) 
    For this requirement we are creating a data template (.XML file) . we are successfully to write for the parent query, but we fails when come to child query. Please help us how it can be wrote in data template . You can send any example related to this issue.

    This forum is noway related to XML Publisher. I had redirected you to the actual BI Publisher already once. You should post it there.

  • Timezone problem in XML from data template

    The xml returned from one of my data templates seems to be randomly applying timezones of +00:00 or +01:00 to the dates.
    This is causing a problem in the PDF output from the report where the timezone is processed and some of the dates are showing as the day before that held in the database. The sql in the data template is just returning the raw column, no extra processing there. What's going on, is this a known bug?
    Appreciate any help you can provide.
    Cheers,
    Dave
    XML extract:
    - <G_TRX>
    <EXPENSE_TEMPLATE>N/AMiscellaneous Expenses</EXPENSE_TEMPLATE>
    <TEMPLATE_DATE_CREATED>2007-09-13T11:51:46.000+01:00</TEMPLATE_DATE_CREATED>
    <TEMPLATE_DATE_INACTIVATED>2008-06-05T00:00:00.000+01:00</TEMPLATE_DATE_INACTIVATED>
    <EXPENSE_ITEM>Evening Dress Hire</EXPENSE_ITEM>
    <ITEM_DATE_CREATED>2007-09-13T12:24:54.000+01:00</ITEM_DATE_CREATED>
    <ITEM_DATE_INACTIVATED />
    <TAX_CATEGORY>PAY</TAX_CATEGORY>
    <ASSIGNMENT_DATE>2007-09-28T00:00:00.000+01:00</ASSIGNMENT_DATE>
    <TAXCAT_DATE_INACTIVATED>2007-11-07T00:00:00.000+00:00</TAXCAT_DATE_INACTIVATED>
    </G_TRX>
    - <G_TRX>
    <EXPENSE_TEMPLATE>N/AMiscellaneous Expenses</EXPENSE_TEMPLATE>
    <TEMPLATE_DATE_CREATED>2007-09-13T11:51:46.000+01:00</TEMPLATE_DATE_CREATED>
    <TEMPLATE_DATE_INACTIVATED>2008-06-05T00:00:00.000+01:00</TEMPLATE_DATE_INACTIVATED>
    <EXPENSE_ITEM>Evening Dress Hire</EXPENSE_ITEM>
    <ITEM_DATE_CREATED>2007-09-13T12:24:54.000+01:00</ITEM_DATE_CREATED>
    <ITEM_DATE_INACTIVATED />
    <TAX_CATEGORY>P11D</TAX_CATEGORY>
    <ASSIGNMENT_DATE>2007-11-08T00:00:00.000+00:00</ASSIGNMENT_DATE>
    <TAXCAT_DATE_INACTIVATED>4712-12-31T00:00:00.000+00:00</TAXCAT_DATE_INACTIVATED>
    </G_TRX>
    - <G_TRX>
    <EXPENSE_TEMPLATE>N/AMiscellaneous Expenses</EXPENSE_TEMPLATE>
    <TEMPLATE_DATE_CREATED>2007-09-13T11:51:46.000+01:00</TEMPLATE_DATE_CREATED>
    <TEMPLATE_DATE_INACTIVATED>2008-06-05T00:00:00.000+01:00</TEMPLATE_DATE_INACTIVATED>
    <EXPENSE_ITEM>Evening Dress Purchase</EXPENSE_ITEM>
    <ITEM_DATE_CREATED>2007-09-13T12:24:54.000+01:00</ITEM_DATE_CREATED>
    <ITEM_DATE_INACTIVATED />
    <TAX_CATEGORY>PAY</TAX_CATEGORY>
    <ASSIGNMENT_DATE>2007-01-01T00:00:00.000+00:00</ASSIGNMENT_DATE>
    <TAXCAT_DATE_INACTIVATED>4712-12-31T00:00:00.000+00:00</TAXCAT_DATE_INACTIVATED>
    </G_TRX>
    SQL from data template:
    - <sqlStatement name="Q_TRX">
    - <![CDATA[
    select aer.REPORT_TYPE "EXPENSE_TEMPLATE"
    ,aer.CREATION_DATE "TEMPLATE_DATE_CREATED"
    ,aer.INACTIVE_DATE "TEMPLATE_DATE_INACTIVATED" 
    ,aerp.PROMPT "EXPENSE_ITEM"
    ,aerp.CREATION_DATE "ITEM_DATE_CREATED"
    ,aerp.END_DATE "ITEM_DATE_INACTIVATED"
    ,xaetl.TAX_CATEGORY "TAX_CATEGORY"
    ,xaetl.EFFECTIVE_START_DATE "ASSIGNMENT_DATE"
    ,xaetl.EFFECTIVE_END_DATE "TAXCAT_DATE_INACTIVATED"
    from ap_expense_reports aer
    ,ap_expense_report_params aerp
    ,xx_ap_expense_tax_lines_f xaetl
    where aer.EXPENSE_REPORT_ID = aerp.EXPENSE_REPORT_ID
    and aerp.PARAMETER_ID = xaetl.expense_report_parameter_id
    AND &p_exp_item_lines_where
    AND &p_tax_category_where
    AND &p_exp_template_where
    ORDER BY aer.REPORT_TYPE
    ,aerp.PROMPT
    ,xaetl.EFFECTIVE_START_DATE
      ]]>
    </sqlStatement>

    Tim
    Is is a sample record from the sql query. Sorry it's not the same as the XML above but the data has changed on the instance so some of the fields weren't populated on those records.
    EXPENSE_TEMPLATE,TEMPLATE_DATE_CREATED,TEMPLATE_DATE_INACTIVATED,EXPENSE_ITEM,ITEM_DATE_CREATED,ITEM_DATE_INACTIVATED,TAX_CATEGORY,ASSIGNMENT_DATE,TAXCAT_DATE_INACTIVATED
    "Long Term Detached Duty",12/09/2007 14:45:57,null,"LTDD:Air Travel
    Domestic",13/09/2007 11:45:08,null,"PSA",01/01/2007,31/12/4712
    First row is column names for ease of understanding :-)
    Appreciate any info you can provide on this.
    Cheers,
    Dave

  • Use the XML with data template

    Hi,
    I want to use double sql query with data template.
    How can I do ??
    Thanks...

    it's okey, I had use a rtf file insead and search/replace my keywords using the String.replaceAll(String, String) function...

  • Data Template Question

    Okay, I'm stumped and the answer is probably right in front of me.
    Whenver I put the LESS THAN symbol in a sql statement, the template obviously thinks I'm starting a new tag. Anyone have a suggestion on how to do a LESS THAN in a template? I could use a BETWEEN, but I don't want to unless that is my only option.
    <sqlstatement name="EMPLOYEES">
    <![CDATA[SELECT emp_id,
    emp_name
    FROM employees
    WHERE emp_id <= 10]]>
    </sqlstatement>
    Thanks -

    You can solve this by using &amp;lt; instead of <= ( less than) .
    try this.
    <![CDATA[SELECT emp_id,
    emp_name
    FROM employees
    WHERE emp_id  &amp;lt;=  10]]>
    let me if does not work,it worked for me.
    - Madan
    Edited by: Madan Thota on May 8, 2009 7:02 PM

  • XML Publisher Data Template Executable Options

    Hello,
    Can someone help me find some documentation on how to decipher what the Options parameter on the XDODTEXE executable is.
    Someone has created a concurrent program, and set the options to : -Xss2048k -Xmx512m
    Tried googling with no luck....anyone?
    Thanks
    S

    ok...found the answer
    http://cyberserf.com/category/oracle-applications/

  • How to remove an XML file from Data Template in Data Definition Screen

    Hi,
    Issue: I have uploaded the file in Data definition in Data Template.
    How to remove it.
    Also what does each file type mean?
    XML Schema
    Data Template
    Preview file
    Bursting control File
    I have an XML file and XSL file. I need to have an output in XML.
    So I installed my XML file in data template in data definition.
    And XSL file in Templates.
    Am I correct?
    11.0.10.2
    Regards,
    Avijit

    Issue: I have uploaded the file in Data definition in Data Template.
    How to remove it.You cannot remove it but you can end-date it.
    Also what does each file type mean?
    XML Schema
    Data Template
    Preview file
    Bursting control FileThis is explained in "Oracle XML Publisher Administration and Developer's Guide Release 12" manual -- http://docs.oracle.com/cd/B34956_01/current/acrobat/120xdoig.pdf
    I have an XML file and XSL file. I need to have an output in XML.
    So I installed my XML file in data template in data definition.
    And XSL file in Templates.
    Am I correct?Correct -- See Chapter 2 "Creating the Template" and Chapter 5 "Data Templates and Chapter" in the same doc referenced above for details.
    Thanks,
    Hussein

  • How to implement place holder columns in data template

    Hi,
    I have a requirement where I have to mimic the functionality of place holder columns in RDF using Data Templates in XML Publisher.
    How can I call a pl/sql function at element level when we try to group records in the data template.
    To make it simple , let us say I have a requirement to retrieve the address of an employee(address line 1,address line 2, city,country)
    In RDF what I do is define 4 place holder columns to capture address attributes, and in a formula column I set values to these attributes. How do I implement this in XML Publisher data template.
    When I tried to implement the above requirement using test variables, I was able to execute a pl/sql function after the group tag, but not within the group tag.
    I got the result for calc_values3 , but didn;t get anythng for calc_values1 and 2
    Data Template:
    <dataTemplate name="XXLCPAY142R" description="online payslip" defaultPackage="XXLCPAY_ONLINEPAYSLIP_PKG" version="1.0">
    <parameters>
    <parameter name="P_ASSIGNMENT_ACTION_ID" dataType="number" />
    </parameters>
    <dataQuery>
    <sqlStatement name="Q_PAYMENT_RUN">
    <![CDATA[
    SELECT PAAPRV.assignment_action_id assignment_action_id
    ,PAAPRV.payroll_action_id payroll_action_id
    ,PAAPRV.run_assignment_action_id run_assignment_action_id
    ,PAAPRV.run_payroll_action_id run_payroll_action_id
    ,PAAPRV.person_id person_id
    ,PAAPRV.full_name full_name
    ,PAAPRV.last_name surname
    ,PAAPRV.assignment_id assignment_id
    ,PAAPRV.business_group_id business_group_id
    ,PAAPRV.assignment_number assignment_number
    ,PAAPRV.registered_employer legal_employer
    ,PAAPRV.abn abn
    ,PAAPRV.grade grade
    ,PAAPRV.payroll_id payroll_id
    ,PAAPRV.time_period_id time_period_id
    ,PAAPRV.period_start_date period_start_date
    ,PAAPRV.period_end_date period_end_date
    ,TO_CHAR(PAAPRV.period_start_date,'DD-Mon-YYYY') period_start_display
    ,TO_CHAR(PAAPRV.period_end_date,'DD-Mon-YYYY') period_end_display
    ,PAAPRV.period_number || ' ' || TO_CHAR(PAAPRV.period_end_date,'YYYY') period_number
    ,TO_CHAR(PTP.regular_payment_date,'DD-Mon-YYYY') pay_date
    ,PAAPRV.date_earned date_earned
    ,PAAF.ass_attribute2 legacy_position
    ,HR_GENERAL.DECODE_LOOKUP('EMPLOYEE_CATG',PAAF.employee_category) paypoint
    ,PPB.name salary_basis
    ,PAAF.people_group_id people_group_id
    ,PAAF.collective_agreement_id cagr_id
    FROM pay_au_asg_payment_runs_v PAAPRV
    ,per_time_periods PTP
    ,per_all_assignments_f PAAF
    ,per_pay_bases PPB
    WHERE PAAPRV.time_period_id = PTP.time_period_id
    AND PAAPRV.assignment_id = PAAF.assignment_id
    AND PAAF.pay_basis_id = PPB.pay_basis_id
    AND PAAPRV.date_earned BETWEEN PAAF.effective_start_date AND PAAF.effective_end_date
    AND PAAPRV.assignment_action_id = :P_ASSIGNMENT_ACTION_ID
    ]]>
    </sqlStatement>
    <sqlStatement name="Q_EARNINGS_DEDUCTIONS">
    <![CDATA[
    SELECT PAI.locking_action_id assignment_action_id_elements
         ,PRR.assignment_action_id assignment_action_id_run_ele
         ,PRR.run_result_id run_result_id
         ,PPA.effective_date effective_date_run
         ,PAAF.pay_basis_id pay_basis_id
         ,PETF.element_type_id element_type_id_ele
         ,NVL(PETF.reporting_name
         ,PETF.element_name) element_name_ear_ded
         ,PIVF.input_value_id input_value_id
         ,PEC.classification_name classification_name
         ,PRRV.result_value amount_elements
         ,DECODE( PEC.classification_name
         , 'Earnings' , 1
         ,'Pre Tax Deductions' , 2
         ,'Involuntary Deductions' , 3
         ,'Voluntary Deductions' , 3 ) sort_order_elements
         ,CASE NVL(PETF.reporting_name
         ,PETF.element_name)
         WHEN 'Salary' THEN 1
         ELSE 2
         END sort_order_name
         ,DECODE( PEC.classification_name
         ,'Earnings',1
         ,0
         ) earnings_count
         ,DECODE( PEC.classification_name
         ,'Earnings',0
         ,1
         ) deductions_count     
         FROM pay_action_interlocks PAI
         ,pay_assignment_actions PAA
         ,pay_payroll_actions PPA
         ,per_all_assignments_f PAAF
         ,pay_run_results PRR
         ,pay_run_result_values PRRV
         ,pay_input_values_f PIVF
         ,pay_element_types_f PETF
         ,pay_element_classifications PEC
         WHERE PAI.locked_action_id = PAA.assignment_action_id
         AND PAA.payroll_action_id = PPA.payroll_action_id
         AND PAA.assignment_id = PAAF.assignment_id
         AND PAA.assignment_action_id = PRR.assignment_action_id
         AND PRR.run_result_id = PRRV.run_result_id
         AND PRRV.input_value_id = PIVF.input_value_id
         AND PRR.element_type_id = PETF.element_type_id
         AND PETF.classification_id = PEC.classification_id
         AND PPA.effective_date BETWEEN PAAF.effective_start_date AND PAAF.effective_end_date
         AND PPA.effective_date BETWEEN PETF.effective_start_date AND PETF.effective_end_date
         AND PPA.effective_date BETWEEN PIVF.effective_start_date AND PIVF.effective_end_date
         AND PPA.action_type IN ( 'R','Q' )
         AND PRR.status IN ('P','PA')
         AND PEC.classification_name IN ( 'Earnings'
         ,'Pre Tax Deductions'
         ,'Involuntary Deductions'
         ,'Voluntary Deductions')
         AND PIVF.name = 'Pay Value'
         AND PAI.locking_action_id = :assignment_action_id
         ORDER BY sort_order_elements ASC, sort_order_name ASC
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataTrigger name="beforeReport" source="XXLCPAY_ONLINEPAYSLIP_PKG.BEFORE_REPORT" />
    <dataStructure>
    <group name="G_PAYMENT_RUN" source="Q_PAYMENT_RUN">
    <element name="assignment_action_id" value="assignment_action_id"/>
    <element name="payroll_action_id" value="payroll_action_id"/>
    <element name="run_assignment_action_id" value="run_assignment_action_id"/>
    <element name="run_payroll_action_id" value="run_payroll_action_id"/>
    <element name="person_id" value="person_id"/>
    <element name="full_name" value="full_name"/>
    <element name="surname" value="surname"/>
    <element name="assignment_id" value="assignment_id"/>
    <element name="business_group_id" value="business_group_id"/>
    <element name="assignment_number" value="assignment_number"/>
    <element name="legal_employer" value="legal_employer"/>
    <element name="abn" value="abn"/>
    <element name="grade" value="grade"/>
    <element name="payroll_id" value="payroll_id"/>
    <element name="time_period_id" value="time_period_id"/>
    <element name="period_start_date" value="period_start_date"/>
    <element name="period_end_date" value="period_end_date"/>
    <element name="period_start_display" value="period_start_display"/>
    <element name="period_end_display" value="period_end_display"/>
    <element name="period_number" value="period_number"/>
    <element name="pay_date" value="pay_date"/>
    <element name="date_earned" value="date_earned"/>
    <element name="legacy_position" value="legacy_position"/>
    <element name="paypoint" value="paypoint"/>
    <element name="salary_basis" value="salary_basis"/>
    <element name="people_group_id" value="people_group_id"/>
    <element name="cagr_id" value="cagr_id"/>
    <group name="G_EARNINGS_DEDUCTIONS" source="Q_EARNINGS_DEDUCTIONS">
    <element name="assignment_action_id_elements" value="assignment_action_id_elements"/>
    <element name="assignment_action_id_run_ele" value="assignment_action_id_run_ele"/>
    <element name="run_result_id" value="run_result_id"/>
    <element name="effective_date_run" value="effective_date_run"/>
    <element name="pay_basis_id" value="pay_basis_id"/>
    <element name="element_type_id" value="element_type_id"/>
    <element name="element_name_ear_ded" value="element_name_ear_ded"/>
    <element name="input_value_id" value="input_value_id"/>
    <element name="classification_name" value="classification_name"/>
    <element name="amount_elements" value="amount_elements"/>
    <element name="sort_order_elements" value="sort_order_elements"/>
    <element name="sort_order_name " value="sort_order_name "/>
    <element name="earnings_count" value="earnings_count"/>
    <element name="deductions_count" value="deductions_count"/>
    <element name="calc_values" value="XXLCPAY_ONLINEPAYSLIP_PKG.CALC_VALUES(67772)"/>
    <element name="calc_values1" value="XXLCPAY_ONLINEPAYSLIP_PKG.RETURN_TEST"/>
    <element name="calc_values2" dataType="number" value="XXLCPAY_ONLINEPAYSLIP_PKG.P_TEST" function="XXLCPAY_ONLINEPAYSLIP_PKG.P_TEST"/>
    </group>
    </group>
    <element name="calc_values3" dataType="number" value="XXLCPAY_ONLINEPAYSLIP_PKG.P_TEST"/>
    </dataStructure>
    </dataTemplate>
    CREATE OR REPLACE PACKAGE XXLCPAY_ONLINEPAYSLIP_PKG
    AS
    P_TEST NUMBER;
    P_ASSIGNMENT_ACTION_ID NUMBER;
    FUNCTION BEFORE_REPORT RETURN BOOLEAN;
    FUNCTION RETURN_TEST RETURN NUMBER;
    FUNCTION RETURN_TEST1 RETURN NUMBER;
    FUNCTION RETURN_TEST2 RETURN NUMBER;
    FUNCTION CALC_VALUES(element_type_id number) RETURN NUMBER;
    END XXLCPAY_ONLINEPAYSLIP_PKG;
    CREATE OR REPLACE PACKAGE BODY XXLCPAY_ONLINEPAYSLIP_PKG
    AS
    P_TEST1 NUMBER;
    P_TEST2 NUMBER;
    FUNCTION BEFORE_REPORT RETURN BOOLEAN
    IS
    BEGIN
    P_TEST := 2;
    FND_FILE.PUT_LINE(FND_FILE.LOG,'From Before Report');
    RETURN(TRUE);
    END BEFORE_REPORT;
    FUNCTION RETURN_TEST RETURN NUMBER
    IS
    BEGIN
    FND_FILE.PUT_LINE(FND_FILE.LOG,'Call 1');
    RETURN(P_TEST);
    END RETURN_TEST;
    FUNCTION CALC_VALUES(element_type_id number) RETURN NUMBER
    IS
    BEGIN
    FND_FILE.PUT_LINE(FND_FILE.LOG,'Call 2');
    p_test1 := null;
    p_test2 := null;
    if ( element_type_id = 67772 ) then
    P_TEST1 := 5;
    P_TEST2 := 7;
    elsif (element_type_id = 67804 ) then
    P_TEST1 := 9;
    P_TEST2 := 11;
    end if;
    RETURN(1);
    END CALC_VALUES;
    FUNCTION RETURN_TEST1 RETURN NUMBER
    IS
    BEGIN
    RETURN(P_TEST1);
    END RETURN_TEST1;
    FUNCTION RETURN_TEST2 RETURN NUMBER
    IS
    BEGIN
    RETURN(P_TEST2);
    END RETURN_TEST2;
    END XXLCPAY_ONLINEPAYSLIP_PKG;
    /

    For this, you need to have a master query and child query.
    1) In your master query you will have to identify one unique column and call a pl/sql pkg function which calculates all values for your place holder columns and inserts rows into a pl/sql table with the index as your unique column
    ex: Master query returns
    empnum name amount
    1 scott 250
    2 bob 350
    and your calculated value is 10 percent of the amount
    your pl/sql pkg should insert records into the pl/sql table like r(1):= 250*0.1 = 25 r(2):= 350*0.1 = 35
    2) The child query will get executed for each row of you rmaster query, so you should be able to read the values based on which master records row it is executing for
    Please bear in mind that you have to make sure that the report is not executed by two different people at the same time, else you have to consider session or any other unique identifier in addition to your master records unique identifier.
    Cheers,
    Girish.

  • Is it possible to use an XML Data Template to create a report in APEX?

    Hi,
    I have created an XML Data Template in BI Publisher passing one parameter and running two queries, then created an RTF Document Template to present the data.
    I can create a nice report in BI Publisher using the two elements. I have used RTF Document Templates to publish reports in APEX but the data comes from a Report region running a single query.
    I would like to run a report based in this kind of XML Data Template, in order to use several children queries related to a parent query. Is it possible to do it in APEX, or you have to use BI Publisher?
    Francisco
    ===========================
    Below is a simple data template definition:
    <dataTemplate name="cotizacion_template" description="Prueba de data template para cotizaciones" dataSourceRef="dbxprts">
         <parameters>
              <parameter name="p_id_cotizacion" dataType="character" defaultValue="1009" include_in_output="true"/>
         </parameters>
         <dataQuery>
              <sqlStatement name="header_query">
                   <![CDATA[select id_cotizacion, fecha_cotizacion, id_clipro from f_cotizaciones where id_cotizacion = :p_id_cotizacion]]>
              </sqlStatement>
              <sqlStatement name="detail_query">
                   <![CDATA[select id_cotizacion as id_cot_child, id_detalle_cotizacion, partida, cantidad, id_producto from f_detalle_cotizaciones where id_cotizacion = :id_cotizacion]]>
              </sqlStatement>
         </dataQuery>
         <dataStructure>
              <group name="F_COTIZACIONES" source="header_query">
                   <element name="ID_COTIZACION" value="ID_COTIZACION"/>
                   <element name="ID_CLIPRO" value="ID_CLIPRO"/>
                   <element name="SUMA_CANTIDAD" value="F_DETALLE_COTIZACIONES.CANTIDAD" function="SUM()"/>
                   <group name="F_DETALLE_COTIZACIONES" source="detail_query">
                        <element name="PARTIDA" value="PARTIDA"/>
                        <element name="CANTIDAD" value="CANTIDAD"/>
                        <element name="ID_PRODUCTO" value="ID_PRODUCTO"/>
                   </group>
              </group>
         </dataStructure>
    </dataTemplate>

    Hi,
    I have the similar question. I used data templates in BI Publisher but now I want to use the same data template in Apex to print some reports.
    I tried to some examples but these were only using report queries. I also tried with the Web Service but this didn't work for me either maybe because I didn't
    used it in the right way. When I used the WS I received the binary of the report so the WS worked it was just the how and where to use it that didn't work for me.
    Now this older entry is BUMPED maybe we find a solution for our problem this way.
    regards,
    Steven

  • [CS5.5/6] - XML / Data Merge questions & Best practice.

    Fellow Countrymen (and women),
    I work as a graphic designer for a large outlet chain retailer which is constantly growing our base of centers.  This growth has brought a workload that used to be manageable with but two people to a never ending sprint with five.  Much of what we do is print, which is not my forte, but is also generally a disorganized, ad-hoc affair into which I am wading to try to help reduce overall strain.
    Upon picking up InDesign I noted the power of the simple Data Merge function and have added it to our repetoire in mass merging data sources.  There are some critical failures I see in this as a tool going forward for our purposes, however:
    1) Data Merge cannot handle information stored and categorized in a singular column well.  As an example we have centers in many cities, and each center has its own list of specific stores.  Data merge cannot handle a single column, or even multiple column list of these stores very easily and has forced us into some manual operations to concatenate the data into one cell and then, using delimiter characters, find and replace hard returns to seperate them.
    2) Data Merge offers no method of alternate alignment of data, or selection by ranges.  That is to say:  I cannot tell Data merge to start at Cell1 in one column, and in another column select say... Cell 42 as the starting point.
    3) Data merge only accepts data organized in a very specific, and generally inflexible pattern.
    These are just a few limitations.
    ON TO MY ACTUAL DILEMMA aka Convert to XML or not?
    Recently my coworker has suggested we move toward using XML as a repository / delivery system that helps us quickly get data from our SQL database into a usable form in InDesign. 
    I've watched some tutorials on Lynda.com and havent yet seen a clear answer to a very simple question:
    "Can XML help to 'merge' large, dynamic, data sets like a list of 200 stores per center over 40 centers based off of a single template file?"
    What I've seen is that I would need to manually duplicate pages, linking the correct XML entry as I go rather than the program generating a set of merged pages like that from Data Merge with very little effort on my part.  Perhaps setting up a master page would allow for easy drag and drop fields for my XML data?
    I'm not an idiot, I'm simply green with this -- and it's kind of scary because I genuinely want us to proceed forward with the most flexible, reliable, trainable and sustainable solution.  A tall order, I know.  Correct me if I'm wrong, but XML is that beast, no?
    Formatting the XML
    Currently I'm afraid our XML feed for our centers isnt formatted correctly with the current format looking as such:
    <BRANDS>
         <BRAND>
              • BrandID = xxxx
              [Brand Name]
              [Description]
              [WebMoniker]
              <CATEGORIES>
                   <CATEGORY>
                        • xmlns = URL
                        • WebMoniker = category_type
              <STORES>
                   <STORE>
                        • StoreID = ID#
                        • CenterID = ID#
    I dont think this is currently usable because if I wanted to create a list of stores from a particular center, that information is stored as an attribute of the <Store> tag, buried deep within the data, making it impossible to 'drag-n-drop'. 
    Not to mention much of the important data is held in attributes rather than text fields which are children of the tag.
    Im thinking of proposing the following organizational layout:
    <CENTERS>
         <CENTER>
         [Center_name]
         [Center_location]
              <CATEGORIES>
                   <CATEGORY>
                        [Category_Type]
                        <BRANDS>
                             <BRAND>
                                  [Brand_name]
    My thought is that if I have the <CENTER> tag then I can simply drag that into a frame and it will auto populate all of the brands by Category (as organized in the XML) for that center into the frame.
    Why is this important?
    This is used on multiple documents in different layout styles, and since our store list is ever changes as leases end or begin, over 40 centers this becomes a big hairy monster.  We want this to be as automated as possible, but I'd settle for a significant amount of dragging and dropping as long as it is simple and straightforward.  I have a high tollerance for druding through code and creating work arounds but my co-workers do not.  This needs to be a system that is repeatable and understandable and needs to be able to function whether I'm here or not -- Mainly because I would like to step away from the responsibility of setting it up every time
    I'd love to hear your raw, unadulterated thoughts on the subject of Data merge and XML usage to accomplish these sorts of tasks.  What are your best practices and how would you / do you accomplish these operations?
    Regards-
    Robert

    From what I've gleaned through watching Lynda tutorials on the subject is that what I'm hoping to do is indeed possible.
    Peter, I dont disagree with you that there is a steep learning curve for me as the instigator / designer of this method for our team, but in terms of my teammates and end-users that will be softened considerably.  Even so I'm used to steep learning curves and the associated frustrations -- but I cope well with new learning and am self taught in many tools and programs.
    Flow based XML structures:
    It seems as though as long as the initial page is set up correctly using imported XML, individual data records that cascade in a logical fashion can be flowed automatically into new pages.  Basically what you do is to create an XML based layout with the dynamic portion you wish to flow in a single frame, apply paragraph styles to the different tags appropriately and then after deleting unused records, reimport the XML with some specific boxes checked (depending on how you wish to proceed).
    From there simply dragging the data root into the frame will cause overset text as it imports all the XML information into the frame.  Assuming that everything is cascaded correctly using auto-flow will cause new pages to be automatically generated with the tags correctly placed in a similar fashion to datamerge -- but far more powerful and flexible. 
    The issue then again comes down to data organization in the XML file.  In order to use this method the data must be organized in the same order in which it will be displayed.  For example if I had a Lastname field, and a Firstname field in that order, I could not call the Firstname first without faulting the document using the flow method.  I could, however, still drag and drop content from each tag into the frame and it would populate correctly regardless of the order of appearance in the XML.
    Honestly either method would be fantastic for our current set of projects, however the flow method may be particularly useful in jobs that would require more than 40 spreads or simple layouts with huge amounts of data to be merged.

  • Need to generate XML based on Data template

    Hi,
    I'm unable to submit (the second submit) my request using the demo links (XDO 5.6.3 or XDO 5.7) provided in http://bipublisher.us.oracle.com/?tab=samples&header=dataTemplate to generate the XML based on the data template.
    Heard that these links are available for Oracle EBS internal use. I work with EBS-CRM. I need to generate XML based on a data template and use the XML in the template. Data template has two queries for a template.
    Pls help.
    Thanks,
    Impha

    Impha
    Please use the internal mailing list for your questions the forum is meant for external customers. If you do not know the ML name - drop me a mail
    Tim

  • Getting while attaching .rtf file in data template

    Hi All,
    When i am attaching a .RTF file to a data template , i am getting the following erro :
    The referring page may have come from a previous session. Please select Close Window to proceed
    i tried by login again but same error coming every time, please help me on thsi.
    Thanks

    <?xml version = "1.0" encoding="UTF-8" ?>
    <dataTemplate name="XMLTEST" description = "testing the" Version = "1.0">
    <properties>
    <property name="xml_tag_case" value="upper" />
    <property name="include_parameters" value="true"/>
    <property name="include_null_Element" value="true"/>
    </properties>
    <parameters>
    <parameter name="P1" dataType = "CHARACTER"></parameter>
    </parameters>
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[
    SELECT CASH_RECEIPT_ID , AMOUNT , SET_OF_BOOKS_ID
    FROM AR_CASH_RECEIPTS_ALL
    WHERE STATUS = :P1
    ]]>
    </sqlStatement>
    </dataQuery>
    <datastructure>
    <group name = "G1" SOURCE = "Q1" groupFilter="">
    <element name="CASH_RECEIPT" value ="CASH_RECEIPT"/>
    <element name="AMOUNT" value="AMOUNT"/>
    <element name="SET_OF_BOOKS_ID" value="SET_OF_BOOKS_ID"/>
    </group>
    </datastructure>
    </dataTemplate>
    i have modified the date datatype. im still seeing the same output. how do i change the element to be derived value? can you help me with the syntax.
    Thanks!

  • How to call a PL/SQL procedure from a xml Data Template

    We have a requirement in which we need to call a pl/sql package.(dot)procedure from a Data Template of XML Publisher.
    we have registered a Data Template & a RTF Template in the XML Publisher Responsibility in the Oracle 11.5.10 instance(Front End).
    In the Data Query part of the Data Template , we have to get the data from a Custom View.
    This view needs to be populated by a PL/SQL procedure.And this procedure needs to be called from this Data Template only.
    Can anybody suggest the solution.
    Thanks,
    Sachin

    Call the procecure in the After Parameter Form trigger, which can be scripted in the Data Template.
    BTW, there is a specialized XML Publisher forum:
    BI Publisher

Maybe you are looking for