Jump to content
  • 0

How to display the latest customer as 'New Customer' + a few information of the new customer in the header.


Cherry
 Share

Question

2 answers to this question

Recommended Posts

  • 0
12 hours ago, Cherry said:

image.thumb.png.81b1ad04ff47134028f40cc24e5ea702.png

 

1.) Create Calculated Field:

STUFF((SELECT TOP 1 ', ' + (COLUMNAME1)+', '+ (COLUMNNAME2) FROM TABLENAME ORDER BY COLUMNNAMEOFDATE DESC FOR XML PATH ('')), 1, 1, '')

This will get one record that has the latest DATE according to DATE column.

If you want to append more columns, just add like +','+(COLUMNNAME3). If the column is not Text(255) DataType, use Convert (+','+ CONVERT(VARCHAR, COLUMNNAME3))

 

2.) Create this div in Header, same ID, Disable Advanced HTML Editor

image.png.83714b355d02a1dfe9da592bd5dcaccf.png

 

3.) FOOTER SCRIPT:

<script>


var x = document.querySelector("table[id^='cbTable_']").rows[1].cells[1].innerHTML;

var container = document.getElementById("customer-info");

container.innerHTML=x;

</script>

This just gets 2nd row, and 2nd column of the table (HEADER included), my Calculated Field is the 2nd field in my DataPage Settings that's why I use cells[1], you may change depending on the position of the Calculated Field, counting starts from 0

image.png.c269d616ffbb6fdcb99bc164a522d0c4.png


Hide Column in Tabular Report to Hide Calculated Field: 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...