asapltda Posted December 24, 2023 Share Posted December 24, 2023 Good morning gentlemen, does anyone have an example of how to use Xtemplate inside DBGrid (desktop). Thank you for your cooperation Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 24, 2023 Share Posted December 24, 2023 Hello, Well, there are many examples on the forum. Quote Link to comment Share on other sites More sharing options...
asapltda Posted January 11 Author Share Posted January 11 Good evening, this is an example of what I want to do but using unigui for Desktop, . I haven't found the example for desktop, Multiple rows in a DBGRID column originating in a single record could you tell me how to do it thanks? This is the code I use on TUnimDBListGrid, function beforeInit(sender, config) { config.loadingText='Cargando'; config.grouped=false; config.selectedCls=''; config.itemTpl='<table style="width:100%;white-space: nowrap;vertical-align:middle;">'+ '<tr>' + '<td style="color:#000:padding-right:4px;" colspan="2"><strong> {8} </strong>     {1} </td>'+ '</tr>' + '<tr>' + '<td style="color:Blue: font-size:15px:padding-top:4px; padding-left:5px;color:#535454;" colspan="2" > Destino: {2}     {3} </td>'+ '</tr>' + '<tr>' + '<td style="color:#000: font-size:15px:padding-top:4px; padding-left:5px;color:#535454;" colspan="2" > <strong> Ubicac: {4}     CDesubicar: {6} </strong> </td>' + '</tr>' + '<tr>' + '<td style="color:#000: font-size:15px:padding-top:4px; padding-left:5px;color:#535454;" colspan="2" > Casig: <strong> {9} </strong> /CDesU: <strong> {10} </strong> / CCanc: <strong> {11} </strong> </td>'+ '</tr>' + '</table>'; } Quote Link to comment Share on other sites More sharing options...
irigsoft Posted January 11 Share Posted January 11 12 hours ago, asapltda said: could you tell me how to do it thanks? Hi, You can try to use html into SQL script. I use it on my Desktop. like this (H1, H2, H3 are set in CSS file): SELECT ('<H2>'+ Products."PrdName" + '</H2>' + '<ul>' + Groups."gName" + '</ul>' + CASE WHEN CONVERT (varchar (250) , STUFF ( (SELECT CHAR (10) + '|||' + REPLACE ([PName],'-','') + CHAR (10) + [PValue] FROM OtherTable1 WHERE OtherTable1."ID" = Products."ID" FOR XML Path ('')),1,1,'')) <> '' THEN '<h3>' + REPLACE (CONVERT (varchar (250) , STUFF ( (SELECT CHAR (10) + '|||' + REPLACE ([PName],'-','') + CHAR (10) + [PValue] FROM OtherTable1 WHERE OtherTable1."ID" = Products."ID" FOR XML Path ('')),1,1,'')) ,'|||','</br>') + '</h3>' ELSE '' END + '<ul><ul><h3 align="right">Price: ' + CAST (ROUND (Products."Price",2) as varchar (20)) + ', ' + lower (Products."V") + '</h3></ul></ul>' ............. ) as Opisanie FROM TableName WHERE .... css file: html,body,h1,h2,h3,h4,h5,h6 { font-family: "Segoe Script", cursive, sans-serif; line-height: 1.2; } 1 1 Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted January 11 Share Posted January 11 Good tip irigSoft 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.