cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Get Content by ID in a HTML Report

mkocur
1-Visitor

Get Content by ID in a HTML Report

Hello Community,

I have an issue by generating a HTML Report. I want to get the content of a Requirement ( or any arbitrary category ) in a HTML report by using JavaScript. I've found a computational method provided by PTC Intgerity which facilitates to get the Content by a specific ID:

<%compute>getFieldValue(ID,"Content.fva")<%endcompute%>


This method returns the content BUT it is not able to pass the ID dynamically, e.g  the ID has to be hard-coded to be able to use this method. I'm pretty sure that the

"<%compute%><%endcompute%> " tag is computed before the HTML Report is generated (and the html and javascript code is translated in browser). When you uncomment the  <%compute>getFieldValue(ID,"Content.fva")<%endcompute%> statement and replace ID with a variable, the report cannot be generated though the statement is uncommented.

Does anybody know how I can solve this problem by getting a content by ID dynamically?

I'd really appreciate a solution and thank in advance for any kind of information

Kind regards

Martin

ACCEPTED SOLUTION

Accepted Solutions

Hello mkocur,

You're correct about how this works, and I think you've hit a limitation of our reporting engine.  The engine processes the <%...%> tags, then passes the resulting value statically to the browser to resolve.  From discussing with others who know this functionality much better than I do, it seems that the way this works doesn't allow for any sort of dynamic ID provisioning.

The two recommended ways to deal with this sort of situation are:

  1. Write a custom report in JSP with API connections:  Drawback is that this is a programatically heavy approach compared to the report engine
  2. Create a never relevant field on the item type being processed with the values required, and have the report work on that, assuming an item always has the same value:  Drawback is the additional load on the server for something that is rarely used.

Please let us know if either of those suggestions helped (by pressing the Correct Answer button), or if you need more information (by letting us know what additional information you need.

Regards,
Kael


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager

View solution in original post

4 REPLIES 4

Hello mkocur,

You're correct about how this works, and I think you've hit a limitation of our reporting engine.  The engine processes the <%...%> tags, then passes the resulting value statically to the browser to resolve.  From discussing with others who know this functionality much better than I do, it seems that the way this works doesn't allow for any sort of dynamic ID provisioning.

The two recommended ways to deal with this sort of situation are:

  1. Write a custom report in JSP with API connections:  Drawback is that this is a programatically heavy approach compared to the report engine
  2. Create a never relevant field on the item type being processed with the values required, and have the report work on that, assuming an item always has the same value:  Drawback is the additional load on the server for something that is rarely used.

Please let us know if either of those suggestions helped (by pressing the Correct Answer button), or if you need more information (by letting us know what additional information you need.

Regards,
Kael


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager

Thank you very much for your answer!

Unfortunately i have no skills in JSP and I've never heard about that before. But i will try to become acquainted in that.

Regards,

Martin

mrump
16-Pearl
(To:mkocur)

Hello mkocur,

Just to be sure I understand.

mkocur wrote:

I have an issue by generating a HTML Report. I want to get the content of a Requirement ( or any arbitrary category ) in a HTML report by using JavaScript.

Do you start your Report from integrity using a given ID?

- If so, why bother with the <%compute>getFieldValue(ID,"Content.fva")<%endcompute%>, as you can easily access the content if the ID directly during report generation on the Server.

- If not (meaning your HTML page uses some kind of Input to fetch the ID of interest and you want to reload the ID's content into you running session on demand), Michael is right and you Need to write a custom JSP with API Connections.

HTH Matthias

mkocur
1-Visitor
(To:mrump)

Hello,

Thank you very much for your answer!

the second idea is coorect. The user can specify an item's attribute with an arbitray ID for example to create a relationship or just to combine two items. Javascript should read that attribute (ID) and afterward show the content. So it's a dynamic request.

Regards,

Martin

Announcements


Top Tags