Oracle Analytics Cloud and Server

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

RTF template PDF ouput issue when using for-each-group@section

Received Response
371
Views
8
Comments

Summary

RTF template PDF ouput issue when using for-each-group@section

Content

Hello,

I have building RTF template, where we have issue generating blank PDF ouput when using for-each-group@section. error message: "There was an error opening this document. This file cannot be opened because it has no pages".

Details:

We have Datamodel containing only one dataset G_1, whenever there is no G_1 group data report should create blank page

sample XML looks like below when there is no data for dataset G_1 :

<?xml version="1.0" encoding="UTF-8"?>

<!--Generated by Oracle BI Publisher 11.1.1.9.0 -Dataengine, datamodel:_XYZ_xdm -->

<DATA_DS><DIRECTORY_OUTPUT>/Shared</DIRECTORY_OUTPUT><P_INVOICE>1234</P_INVOICE>

</DATA_DS>

RTF template for example looks like:

<?for-each-group@section:G_1;./INVOICE_DIV?><?sort:current-group()/INVOICE_DIV;'ascending';data-type='text'?>

---------- Invoice Table Heading ----------------

Start Body ( using start body to repeat Invoice table heading on each page)

----------- Invoice Table values --------------

End Body

End G_1 by Invoice_DIV

if I remove the @section and use tag <?split-by-page-break:?>, the report generates blank page at the end when we have data in G_1.

Can you please suggest on how to get this sorted out.

Many Thanks

Answers

  • YGUTTIKONDA
    YGUTTIKONDA Rank 6 - Analytics Lead

    Hello,

    Just do a simple test like below ..

    <?variable:countrow;count(G_1)?>

    <?$countrow?>

    <?if:$countrow>0?> HELLO<?end if?>

    this is working .. Pl check

    -- YG

  • Apodapati2
    Apodapati2 Rank 4 - Community Specialist

    I tried to use varaible and call outside for-each-group and inside for-each-group but I am still getting the same issue.  Can you please see below correct me if I am doing wrong? can you elaborate a bit more where I need to define the variable and how I need to call if some thing wrong below?

    <?variable:countrow;count(G_1)?>

    <?if:$countrow>0?>

    <?for-each-group@section:G_1;./INVOICE_DIV?><?sort:current-group()/INVOICE_DIV;'ascending';data-type='text'?>

    ---------- Invoice Table Heading ----------------

    Start Body ( using start body to repeat Invoice table heading on each page)

    ----------- Invoice Table values --------------

    End Body

    End G_1 by Invoice_DIV

    <?end if?>

  • YGUTTIKONDA
    YGUTTIKONDA Rank 6 - Analytics Lead

    use a variable to count the rows .. and insert a IF statement to validate it and display blank page ..

    <?variable:countrow;count(G_1)?> -- this is variable deceleration and using the count of the group (G_1 in this case)

    <?$countrow?> -- Invoking the variable ..

  • Venkat Thota - BIP
    Venkat Thota - BIP Rank 7 - Analytics Coach

    follow below links

    This is know issue,

    https://blogs.oracle.com/xmlpublisher/entry/no_data_found 

    use <?if@section: not(//ID)?>No Data Found<?end if?> at last page...

  • Apodapati2
    Apodapati2 Rank 4 - Community Specialist

    I have attached a test sample XML and RTF files. can you please check.

  • YGUTTIKONDA
    YGUTTIKONDA Rank 6 - Analytics Lead

    I didn't quite understand ... is your requirement as below

    1) when there are no records you want to display a blank page  ??

    2) you want to insert a page-break for INVOICE_DIV ??

    also lets forget abt #1 , did your page-break work in the past ??

    upload your template and xml file.

    --YG

  • Apodapati2
    Apodapati2 Rank 4 - Community Specialist

    the above one works if you dont use @section in for-each-group. but I need @section in the template to page break based on INVOICE_DIV. Did you try using @section?

  • Apodapati2
    Apodapati2 Rank 4 - Community Specialist

    This worked perfectly fine, the link was helpful. Many thanks