on 01-12-2016 4:50 PM
Hi,
I am trying to update the cross tab summary field to hyperlink using Restful SDK. When I update the field the response shows the field is updated successfully but when I open the report still the field is reading as text instead of hyperlink. Any help will be appreciated.
Thanks,
Madhu V
Hi Madhu,
Are you saving the document after the update?
if so, try returning the xml for the field after you've updated it. and then manually change a field to a hyperlink in the designer and return the XML for that field as well so you can compare the two to see what's different.
Dan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dan,
Yes, I saved the document. I tried your suggestion and the only difference I see from the field changed in the designer and through SDK is the order of the attributes in the formula.
ex:
SDK Response:
<formula dataType="String" type="HyperLink">
Designer Field:
<formula type="HyperLink" dataType="String">
Thanks,
Madhu V
Hi Dan,
I am using the report element API which is returning the type="HyperLink". The API call is "/biprws/raylight/v1/documents/documentID/reports/reportID/elements/elementID".
The steps used to create the report in design mode:
1. Created a report with a cross tab report with one summary field.
2. Replaced the summary field with the link <a href="link">Summary Field</a>
3. Right clicked the field and selected linking tab.
4. Then selected the option "Read content as Hyperlink"
5. Used the restful API element call to read the cell attributes.
Thanks,
Madhu V
Thanks Madhu,
I was able to reproduce what you are seeing. Much like in the designer, setting the hyperlink is going to be a two-step process.
here's what I did to get it working:
Step 1 edit the formula
GET .../<documentId>/reports/1/elements/5
...
<content>
<expression>
<formula type="Text" dataType="Numeric" dataObjectId="DP1.DO93">= [Sales revenue]</formula>
</expression>
</content>
</element>
PUT .../<documentId>/reports/1/elements/5
...
<content>
<expression>
<formula type="HyperLink" dataType="Numeric">="<a href=\"http://sap.com\" title=\"\" target=\"_blank\" nav=\"web\">"+ [Sales revenue]+"</a>"</formula>
</expression>
</content>
</element>
Step 2 update the specification to define the cell contents as a "weblink"
GET .../<documentId>/reports/1/specification
...
<TDCELL bId="5" width="2988" height="576" autofitWidth="no" leftPadding="252" rigthPadding="252" bottomPadding="216" topPadding="216" what="text" colspan="1">
<STYLE>
<BACKGROUND type="box" hAlign="center" vAlign="center" />
</STYLE>
<CONTENT>="<a href=\"http://sap.com\" title=\"\" target=\"_blank\" nav=\"web\">"+ [Sales revenue]+"</a>"</CONTENT>
</TDCELL>
...
change the what='text" to what="weblink"
PUT .../<documentId>/reports/1/specification
...
<TDCELL bId="5" width="2988" height="576" autofitWidth="no" leftPadding="252" rigthPadding="252" bottomPadding="216" topPadding="216" what="weblink" colspan="1">
<STYLE>
<BACKGROUND type="box" hAlign="center" vAlign="center" />
</STYLE>
<CONTENT>="<a href=\"http://sap.com\" title=\"\" target=\"_blank\" nav=\"web\">"+ [Sales revenue]+"</a>"</CONTENT>
</TDCELL>
...
Final step: save the changes
PUT .../<documentId>
I hope this helps,
Dan
Hi Dan,
For some reason I am not able to get the property what="text" from the TDcell when I use
"/<DocumentID>/reports/1/specification" . If I change the "read as hyperlink" property in the designer then I am able to get the property what="weblink". May be I have to find a way to add the new attribute to the TDCell to make it weblink. I will keep you posted.
Thanks,
Madhu V
Thanks Dan for your help, Finally I am able to make it work by using Step 2 method.
"<documented>/reports/reported/specification" to read and update the document.
basically changing the what='text' to what='weblink'.
and saving the document.
It worked because my text inside the field is a hyperlink. Only thing I noticed is that sometimes the property what='text' is not in the XML response.
Thanks,
Madhu V
Hello,
Did you need additional assistance?
Regards,
Anthony
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.