Oracle Analytics Publisher

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Calling subtemplate gets me an error without error code

Received Response
31
Views
3
Comments

In may main template, I have the following code:

<?import:xdoxsl:///Custom/Procurement/POTemplate/filename_of_subtemplate.xsb?>

<?choose:?>

<?when:?><?xdofx:substr(Comments,1,3) = 'ORD')?>

<?call-template:P3PO?>

<?end when?>

<?when:?><?xdofx:substr(Segment1,1,3) = 'CON')?>

<?call-template:OptimusPO?>

<?end when?>

<?when:?> <?xdofx:substr(Segment1,1,3) = 'PUR')?>

<?call-template:CustomPO?>

<?end when?>

<?end choose?>

I have tested each templates and they are working as expected.

I am getting the error below when I tried using it as subtemplate

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • Rank 1 - Community Starter

    Hi @MandeepGupta ,

    I followed the recommendation on the link you provided and still got the same error.

    Thanks!

  • Rank 1 - Community Starter

    So, I think I fixed it initially by using this code:

    <?import:xdoxsl:///Custom/Procurement/POTemplate/AHA_Custom_PO_PDF.xsb?loc=${_XDOLOCALE}?>

    <?if xdofx:starts-with(Segment1, ‘ORD’)?>

    <?call-template:P3PO?>

    <?end if?>

    <?if xdofx:starts-with(Segment1, ‘PUR’)?>

    <?call-template:CustomPO?>

    <?end if?>

    <?if xdofx:starts-with(Segment1, ‘CON’)?>

    <?call-template: OptimusPO?>

    <?end if?>

    But with the code above, the string funtions seems to be disregarded, for some reason, all subtemplates are being called.

    The final fix I made was to create another column in the Data Model where it will contain the value of the first 3 letters of Segment1

    <?import:xdoxsl:///Custom/Procurement/POTemplate/AHA_Custom_PO_PDF.xsb?loc=${_XDOLOCALE}?>

    <?choose:?>

    <?when: PO_TYPE = ‘ORD’?>

    <?call-template:P3PO?>

    <?end when?>

    <?when: PO_TYPE = ‘PUR’?>

    <?call-template:CustomPO?>

    <?end when?>

    <?when: PO_TYPE = ‘CON’?>

    <?call-template:OptimusPO?>

    <?end when?>

    <?otherwise:?>

    <?end otherwise?>

    <?end choose?>

    Also, I noticed that it only works with choose.

    So yeah, this is fixed now. Thank you all!

Welcome!

It looks like you're new here. Sign in or register to get started.