You are viewing limited content. For full access, please sign in.

Question

Question

Expand/Collapse Table

asked on May 17, 2017 Show version history

Good morning, 

This is more of a general question than a Laserfiche-related one, but I thought I could probably get some guidance in here as well.

I have a Laserfiche Table that populates all the rows using Lookup Rules with the "as new rows" checkbox set to "checked"

So, let's say that the table has 2 columns and 5 rows coming from the database. The first column has a GUID value and the second has some numbers.

Since the values in the database came from a Laserfiche Table themselves, sometimes the same GUID belongs to more than one row. In essence, the GUID represents a form transaction. So let's say that it looks something like the screenshot attached. I'm displaying this Acceding by GUID.

I'm looking for a way so that when there is a repeated GUID like in the first 3 rows, that they show collapsed, with a + sign or something.

I was trying to implement it with something like this fiddler example: http://jsfiddle.net/73PuB/ but haven't gotten anywhere. 

If you've worked with a similar project would you be so kind in sharing your strategy/documentation/resources please?

Thank you,

Raul

GUIDTable.png
GUIDTable.png (2.92 KB)
0 0

Answer

SELECTED ANSWER
replied on May 17, 2017

Use CHAR(13) as line break.

For example, SELECT 'a'+CHAR(13)+'b'

1 0

Replies

replied on May 17, 2017 Show version history

I'm moving towards a different direction in concatenating common values into a muli-line field using the strategy below. However, when I try to separate each value with a line break, it shows the line break code in the textarea instead of an actual line break. I've already tried \r\n and \\r\\n and <br /> and even &#013; &#010; but I imagine this is being escaped so that it shows in the textbox or something. Any suggestions?

SELECT
      m.Guid
	 ,m.Col1
	 ,m.Col2
	 ,m.Col3
	 ,m.Col4

    , Column5 = STUFF((
		  SELECT ' ' + md.Col5 + '\r\n' 
          FROM dbo.tblTable md
          WHERE m.Guid = md.Guid
          FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(MAX)'), 1, 1, '')

	, Column6 = STUFF((
		  SELECT ' ' +  md.Col6 + '\r\n'
          FROM dbo.tblTable md
          WHERE m.Guid = md.Guid
          FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(MAX)'), 1, 1, '')

FROM dbo.tblTable m
JOIN dbo.tblTable s ON s.Guid = m.Guid
GROUP BY m.Guid, m.Col1, m.Col2, m.Col3, m.Col4

 

sqlExtract.png
sqlExtract.png (14.61 KB)
0 0
SELECTED ANSWER
replied on May 17, 2017

Use CHAR(13) as line break.

For example, SELECT 'a'+CHAR(13)+'b'

1 0
replied on May 18, 2017

Thanks Rui, that did the trick.

SQLExractTable.png
0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.