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

Grid- Show values with Line Break(\n)

mrastogi
7-Bedrock

Grid- Show values with Line Break(\n)

Is it possible to display values of grid with line break in a single cell? If so please guide me how to alter the infotable output and replace all commas with a line break.

I have a grid with one column having some csv format values like server1, server2, server3 in a single cell. So on mashup i want the output to be displayed with a line break for eg.-

Actual

MachineNameServerName
1Server1, Server2, Server3
2Server4, Server5, Server6

Expected

MachineNameServerName
1

Server1

Server2

Server3

2

Server4

Server5

Server6

ACCEPTED SOLUTION

Accepted Solutions
mrastogi
7-Bedrock
(To:katte)

I got the solution   All you need to do is while writing the service in sql use <br>  for eg.

select * from (select z.SERVER_NAME,x.PRODUCT_NAME,x.instance_name,x.instance_type,x.URL,(x.USERNAME+'/'+x.PASSWORD)Login,z.INSTANCE_VERSION,z.BUILD_NO,x.DB_Stack,x.DB_Details,x.ASSIGNED_TEAM,x.status,x.shared_log_location,x.DB_CONNECTION,('URL: '+x.URL+ '<br> Username/Password: ' + x.USERNAME+ '/'+x.PASSWORD+ '<br> VERSION: ' +z.INSTANCE_VERSION+'<br> BUILD# ' + CAST(z.BUILD_NO AS VARCHAR(60))+'<br> DB TYPE: ' +x.DB_Stack)QA_Details from twx_instance_details x inner join

(another query)

After saving the service, go back to mashup and configure the grid column where you want the output in next line then click on tab "Column Renderer & State Formatting" then change the Renderer type to HTML and Format with "With Formatting" and you are done. What happen is we are taking the output of the respective column as HTML and so it will be displayed in next line.

View solution in original post

2 REPLIES 2
katte
12-Amethyst
(To:mrastogi)

AFAIK, Thingworx mashup doesn't recognize the "\n" character as new line. Not sure though.. I'll look for other's answers on this.

Just an FYI, You've posted the question in "ThingWorx Studio" discussion forum. It should be in "Developers" fourm, I'll be moving this to the right queue.

mrastogi
7-Bedrock
(To:katte)

I got the solution   All you need to do is while writing the service in sql use <br>  for eg.

select * from (select z.SERVER_NAME,x.PRODUCT_NAME,x.instance_name,x.instance_type,x.URL,(x.USERNAME+'/'+x.PASSWORD)Login,z.INSTANCE_VERSION,z.BUILD_NO,x.DB_Stack,x.DB_Details,x.ASSIGNED_TEAM,x.status,x.shared_log_location,x.DB_CONNECTION,('URL: '+x.URL+ '<br> Username/Password: ' + x.USERNAME+ '/'+x.PASSWORD+ '<br> VERSION: ' +z.INSTANCE_VERSION+'<br> BUILD# ' + CAST(z.BUILD_NO AS VARCHAR(60))+'<br> DB TYPE: ' +x.DB_Stack)QA_Details from twx_instance_details x inner join

(another query)

After saving the service, go back to mashup and configure the grid column where you want the output in next line then click on tab "Column Renderer & State Formatting" then change the Renderer type to HTML and Format with "With Formatting" and you are done. What happen is we are taking the output of the respective column as HTML and so it will be displayed in next line.

Announcements


Top Tags