Categories
- All Categories
- 15 Oracle Analytics Sharing Center
- 15 Oracle Analytics Lounge
- 214 Oracle Analytics News
- 42 Oracle Analytics Videos
- 15.7K Oracle Analytics Forums
- 6.1K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 78 Oracle Analytics Trainings
- 14 Oracle Analytics Data Visualizations Challenge
- Find Partners
- For Partners
RTF template PDF ouput issue when using for-each-group@section

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
-
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
0 -
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?>
0 -
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 ..
0 -
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...
0 -
I have attached a test sample XML and RTF files. can you please check.
0 -
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
0 -
-
This worked perfectly fine, the link was helpful. Many thanks
0