on 01-07-2016 4:31 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
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
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
Any suggestions please?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.