Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
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
MachineName | ServerName |
---|---|
1 | Server1, Server2, Server3 |
2 | Server4, Server5, Server6 |
Expected
MachineName | ServerName |
---|---|
1 | Server1 Server2 Server3 |
2 | Server4 Server5 Server6 |
Solved! Go to Solution.
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.
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.
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.