cancel
Showing results for 
Search instead for 
Did you mean: 

RESTful SDK : changing the Cross Tab Field to hyperlink ( read content as hyperlink)

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

daniel_paulsen
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

daniel_paulsen
Active Contributor
0 Kudos

I can't seem to get the Type return as "Hyperlink".

Can you please provide the steps you use to create the hyplerlink in the Design mode?

Also, which API are you using to set the hyperlink?  are you using the report's specification or are you using a report element?

Dan

Former Member
0 Kudos

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

daniel_paulsen
Active Contributor
0 Kudos

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.

  1. edit the element to change the formula (make sure its xml encoded), set its type to "Hyperlink"
  2. edit the cell in the report specification to "read as hyperlink" by setting it to "weblink"
  3. save back to CMS

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">="&lt;a href=\"http://sap.com\" title=\"\" target=\"_blank\" nav=\"web\"&gt;"+ [Sales revenue]+"&lt;/a&gt;"</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>="&lt;a href=\"http://sap.com\" title=\"\" target=\"_blank\" nav=\"web\">"+ [Sales revenue]+"&lt;/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>="&lt;a href=\"http://sap.com\" title=\"\" target=\"_blank\" nav=\"web\">"+ [Sales revenue]+"&lt;/a>"</CONTENT>

</TDCELL>

...


Final step: save the changes


PUT  .../<documentId>


I hope this helps,


Dan

Former Member
0 Kudos

Thank you Dan, I will try the above steps and let you know how it goes. I will try it tomorrow coz I am off today and let you know.

Once again thank you very much for your help.

Madhu V

former_member197386
Active Contributor
0 Kudos

Hi Madhu,

You should not go to SCN when you're enjoying an off-day

Best regards,

Anthony

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Answers (1)

Answers (1)

former_member197386
Active Contributor
0 Kudos

Hello,

Did you need additional assistance?

Regards,

Anthony

Former Member
0 Kudos

Hi Anthony,

Thanks for checking. I didn't get chance to work on the solution but I will try and update you guys by tomorrow.

Thanks,

Madhu V

former_member197386
Active Contributor
0 Kudos

Ok