cancel
Showing results for 
Search instead for 
Did you mean: 

An issue when exporting a report with prompts to a PDF file with Rest Api

Former Member
0 Kudos

I came across an issue when exporting a report with prompts to a PDF file with Rest Api. The Java program is attached. No error message but I only got an empty pdf file with only report format without data. The pdf file is also attached.

I tried to update the prompted parameters and print out the parameters finally accepted by the report. I found that the second parameter is set correctly, while the first one is not set correctly. Please refer to the below output. I think possibly why I got an empty pdf file is due to that the prompt parameters are not set correctly. But I've no idea what I've done in the program is incorrect. Can anyone help me?


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

<parameters>

    <parameter dpId="DP1e" type="prompt" optional="false">

        <id>16</id>

        <technicalName>Enter a Requested Date:</technicalName>

        <name>Enter a Requested Date:</name>

        <answer type="DateTime" constrained="false">

            <info keepLastValues="false" cardinality="Single"/>

        </answer>

    </parameter>

    <parameter dpId="DP1e" type="prompt" optional="false">

        <id>17</id>

        <technicalName>Select a SLA ID:</technicalName>

        <name>Select a SLA ID:</name>

        <answer type="Text" constrained="false">

            <info keepLastValues="false" cardinality="Single">

                <lov mandatorySearch="false" searchable="true" refreshable="true" partial="false" hierarchical="false">

                    <id>UNIVERSELOV_DS7.DO1c1</id>

                    <updated>2015-11-11T17:15:46.000+08:00</updated>

                    <values>

                        <value>SLA-ST-TEST</value>

                    </values>

                    <columns mappingId="0">

                        <column type="String" id="0">SLA ID </column>

                    </columns>

                </lov>

            </info>

        </answer>

    </parameter>

</parameters>

Accepted Solutions (1)

Accepted Solutions (1)

eric_festinger
Contributor
0 Kudos

hi,

1. What do you get if you call "[GET] .../documents/{docId}/parameters" ?

2. ... and what do you get when calling "[PUT] .../documents/{docId}/parameters" with your built "message" request?

Regards,

eric

Former Member
0 Kudos

The output for GET is as follows. It seems the second text value is set correctly but the first datatime value is not set correctly.



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

<parameters> 

    <parameter dpId="DP1e" type="prompt" optional="false"> 

        <id>16</id> 

        <technicalName>Enter a Requested Date:</technicalName> 

        <name>Enter a Requested Date:</name> 

        <answer type="DateTime" constrained="false"> 

            <info keepLastValues="false" cardinality="Single"/> 

        </answer> 

    </parameter> 

    <parameter dpId="DP1e" type="prompt" optional="false"> 

        <id>17</id> 

        <technicalName>Select a SLA ID:</technicalName> 

        <name>Select a SLA ID:</name> 

        <answer type="Text" constrained="false"> 

            <info keepLastValues="false" cardinality="Single"> 

                <lov mandatorySearch="false" searchable="true" refreshable="true" partial="false" hierarchical="false"> 

                    <id>UNIVERSELOV_DS7.DO1c1</id> 

                    <updated>2015-11-11T17:15:46.000+08:00</updated> 

                    <values> 

                        <value>SLA-ST-TEST</value> 

                    </values> 

                    <columns mappingId="0"> 

                        <column type="String" id="0">SLA ID </column> 

                    </columns> 

                </lov> 

            </info> 

        </answer> 

    </parameter> 

</parameters>

The output for PUT is as follows.



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

<success>

    <message>The resource of type &quot;Document&quot; with identifier &quot;8364&quot; has been successfully updated.</message>

    <id>8364</id>

</success>

By the way, my Webi report is develop with BOE 3.x. Currently, I upgraded it to the BI platform 4.1 SP6 with the upgrading tools. I've no idea whether this will affect the PDF report exporting. But I can export PDF report in the BI launch pad.

eric_festinger
Contributor
0 Kudos

I looked again to your program: in setPrompt(...), you set "X-SAP-PVL", but not in exportPdfReport(...).

If both PVLs (the one you explicitly set, and the default one) are not the same, two distinct occurrences of the same document will be loaded into memory.

Please try again, not setting the PVL in any call, or setting the same everywhere.

eric

Former Member
0 Kudos

Thanks for your advice. I tried both ways, not setting the PVL in any call, or setting the same everywhere, but the program still doesn't work and export an empty. And the output for GET .../documents/{docId}/parameters still can't reflect the value I set for the first parameter.

eric_festinger
Contributor
0 Kudos

When refreshing the document with BI Launch, do you try the same exact date (2015-09-01T00:00:00) ? What about the timezone (I see "+08:00" in the "updated" element of your "GET" response)?


Regarding your "the output for GET .../documents/{docId}/parameters still can't reflect the value I set for the first parameter", this is normal as the prompts you are using do no store the previous answers (see tag "keepLastValues" of your "GET" response).



eric

Former Member
0 Kudos

The date time format works for the XML but doesn't work when I refresh the document in BI Launch. And when I call rest api with the same data time format used in BI Launch, I got the below error.

<error>

    <error_code>WSR 00102</error_code>

    <message>An error occurred while parsing value "09/01/2015 12:00:00 AM" of type "DateTime".</message>

</error>

eric_festinger
Contributor
0 Kudos

Yes, sure, I was not clear enough.

I meant, as it seems you're 8 hours shifted compared to UTC, what happens if you shift the time by 8 hours when answering to prompts in BI LaunchPad? For example, if you enter "08/31/2015 04:00:00 PM" (or "09/01/2015 08:00:00 AM"... i can't remember the direction).

daniel_paulsen
Active Contributor
0 Kudos

I believe Eric is on the right track and the problem that you are experiencing is that the time offset from UTC is being ignored, so your parameter is being read as if it is midnight on Nov 11.  This issue only happens when scheduling and is fixed in SP06 Patch2.

see the following thread for details: 

Dan

Former Member
0 Kudos

After removing the timezone offset, I can get the report generated correctly. Thank you very much.

eric_festinger
Contributor
0 Kudos

Great!

former_member197386
Active Contributor
0 Kudos

Nice investigation!

Anthony

Answers (0)