Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to Generate RPE report (with IBM RDNG data source) with table caption being printed in center

 Hi All,


When I create a table in DNG and add table caption, in the RPE Generated report we are getting table caption at the leftmost side after table.

I wanted to know how to align table caption in RPE template


0 votes



3 answers

Permanent link

As a author of the workaround in the ticket I think I should answer this.

For the text element that is displaying the text you should add following code.

var match = {};
var patt = /(<table[^>]>(<caption[^>]>(?:.|\n)?<\/caption>)?(?:.|\n)?<\/table>)/g;
while ((match = patt.exec(div))) {
  var table = match[1];
  var caption = match[2];
  if (caption)
  {
  table = table.replace(caption, "");
  table = '<div  style="text-align:center;"><span>Table '+caption+"</span></div>" + table;
  div = div.replace(match[1], table);
}
}

This code is moving <caption> to span outside of the table (before it). That is only way how I was able to implement it.

Prashant mentioned the ticket which was requested opened by me

1 vote


Permanent link
Hi Prashant,
This is a limitation as of now, you can find the details in

0 votes

Comments

How to implement the workaround that is suggested in discussion section in work item??

Kindly let me know the procedure how to implement the workaround
 


Permanent link

The workaround provided by Bartosz is good. You can find the modified template UAS-Functional-SPP.dta that will center-align the table captions.
You can also try the macro solution (works only for Word output and not for PDF output).

0 votes

Comments
Subramanya,

You are wrong because you will be able to generate list of tables using this workaround. If You will read the code carefull it is talking <caption></caption> outside the table and encapsulate this in centered span.

This will still generate properly working ToT. You can check this by yourself or I can provide working example.

Good to know that. Sorry, I should have checked it before commenting. :)

Hi Bartosz,


I tried doing it the workaround it did not work, can you please provide working sample

Regards,
Prashanth  

 Hi Bartosz,


I tried doing it the workaround it did not work, can you please provide working sample or please provide the work instructions to implement it in RPE template

Regards,
Prashanth  

You should return div, else Script Expression will retun undefined value.

var match = {};
var patt = /(<table[^>]*>(<caption[^>]*>(?:.|\n)*?<\/caption>)?(?:.|\n)*?<\/table>)/g;
while (match = patt.exec(div)) {
  var table = match[1];
  var caption = match[2];
  if (caption)
  {
  table = table.replace(caption, "");
  table = '<div  style="text-align:center;"><span>'+caption+"</span></div>" + table;
  div = div.replace(match[1], table);
}
}
div;

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Mar 11 '21, 11:38 p.m.

Question was seen: 1,650 times

Last updated: Mar 30 '21, 9:58 a.m.

Confirmation Cancel Confirm