cancel
Showing results for 
Search instead for 
Did you mean: 

Change text format in webi report

Former Member
0 Kudos

Hi,

I am able to export the webi report in xls using the RESTFUL SDK but the text field is wrapped. I can do that in webi, but is there a way i can unwrap the text (hard code it in the code) while exporting?

Thanks,
Arun

Accepted Solutions (1)

Accepted Solutions (1)

daniel_paulsen
Active Contributor
0 Kudos

There is a way, but the trick is to know which cells you want to prevent wrapping on.  If you do it to all cells, you may end up affecting the whole formatting of the report.

I ran a quick test with a one-cell report that had wrapping enabled on the cell.  I retrieved the report specification and changed the "autofitWidth" attribute on the cell to "yes" and changed the style "wrapText" to "no".  I then PUT back the specification and exported. The width auto-sized and the word wrap went away.

       <CELL bId="5" name="Cell 1" x="3456" y="2772" hideAlways="no" width="7056" height="576" autofitWidth="yes" leftPadding="216" rigthPadding="216" bottomPadding="144" topPadding="144" what="text">

            <STYLE>

                <BORDER side="top" width="50" style="plain" />

                <BORDER side="left" width="50" style="plain" />

                <BORDER side="right" width="50" style="plain" />

               <FONT wrapText="no" />

            </STYLE>

            <CONTENT>here is some lengthy text that wraps</CONTENT>

        </CELL>

I did this using the report's specification just for a quick test, but you could also do it using the .../reports/<reportId>/elements/<elementID> api and change the same attributes in the <size> and <alignment> tags on the individual report element.

Dan

Former Member
0 Kudos

Thanks much. I can get the elementID from the postman. So after editing you used the PUT command to load it back to the report? In that case, the report element will be permanently unwrapped in the report correct?

Former Member
0 Kudos

Hi Daniel,

POSTMAN ran for 1 hr and did not yield the required xml. I got only this much from the the 10K+ page report -

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

<report>

   

    <id>4</id>

   

    <name>With Comments</name>

   

    <reference>4.RS</reference>

   

    <showDataChanges>false</showDataChanges>

   

    <style>

       

        <hyperLinkColors visited="#000000" link="#0000ff" hover="#000000" active="#000000"/>

   

    </style>

   

    <pageSettings>

       

        <margins left="828" right="828" top="828" bottom="828"/>

       

        <format orientation="Landscape" height="39600" width="30600">LETTER</format>

       

        <records vertical="100" horizontal="20"/>

       

        <scaling wide="1" factor="100"/>

   

    </pageSettings>

</report>

Arun

former_member197386
Active Contributor
0 Kudos

Hello Arun,

According to the documentation, you should request using "text/xml" on "/specification" of the report to get the output explained by Dan.

Regards,

Anthony

Former Member
0 Kudos

Hello Anthony,

Thank you for the reply. So if my understanding is correct "text/xml" in POSTMAN and GET should be GET http://<hostname:6405/biprws/raylight/v1/documents/reports/reportsid/specification

Is that correct?

Also i have a question, when i use PUT it will modify the report correct?

Thanks,
Arun

daniel_paulsen
Active Contributor
0 Kudos

yes, your understanding is correct. Use "text/xml" for the Accept header on a GET and use it in the Content-Type header for a PUT

When you modify the report, the cached copy is modified and not the original document.  The original document is modified once you save it back to the CMS with

PUT   /documents/<docId>

Dan

Former Member
0 Kudos

Thanks Daniel. Will check and confirm.

former_member197386
Active Contributor
0 Kudos

Let us know when you will be able to check Arun.

Best regards,

Anthony

Former Member
0 Kudos

Hi Anthony,

Apologize for the delay, caught up with other things so did not get time to check. Though i believe it will work, it won't help much in my requirement . I am exporting all the reports through a JSP code and while exporting i need to change the wrapping of text for one element for a particular report. Through POSTMAN i could change it one time in the cache but i cannot integrate it with the JSP code so that every time jsp runs and exports the report, that element is changed. I have to do it every time through postman correct?

Thanks,
Arun

daniel_paulsen
Active Contributor
0 Kudos

Hi Arun,

You can implement this in your JSP code just as you did in Postman.  When working in the JSP code, you are still working with the cached object so you can change whatever you like prior to exporting through the restful API without saving the changes back to the original template document.  Once you are done you can close the document without saving the changes back to the CMS:

PUT  .../documents/<docId>

body:

<document>

   <state>Unused</state>

</document>

In my previous post, the PUT command without a request body will save changes to the CMS server and update the original template document.

Dan

Former Member
0 Kudos

Hi Daniel,

Thank you, that's what i am researching now,  how to implement this in jsp?

If you have any ideas, code samples etc please share. I would appreciate that.

Thanks,
Arun

former_member197386
Active Contributor
0 Kudos

Hello Arun,

If you have already implemented REST call in the JSP, it is exactly the same technic. Just a matter of sending the proper HTTP call and getting the response properly.

Regards,

Anthony

Answers (1)

Answers (1)

Former Member
0 Kudos

Any suggestions please?

daniel_paulsen
Active Contributor
0 Kudos

Hi Arun,

How do you do it in Webi?  Does it export differently or do you resize the cell?

If you actuallly make a change to the webi report and then export from webi, then if you save that change, it should export the same when using the SDK.

Dan

Former Member
0 Kudos

Thank you Daniel for the reply. Currently users are doing like that, but they need a solution where webi by default takes unwrapped text while exporting because some of the documents are over 10,000 and takes time to manually edit it.

I could use Resful SDK to export to excel and the output is wrapped like webi. Wondering there is a way to unwrap and export?