Create a CSP Page with DataTable
Hi All,
i searching for a sample, how to create a CSP Page in cache 2017.2, witch show a Tables result in a grid.
To someone knows a tutorial, or a documentation?
THX an
BR
Hi All,
i searching for a sample, how to create a CSP Page in cache 2017.2, witch show a Tables result in a grid.
To someone knows a tutorial, or a documentation?
THX an
BR
Hello -
There are multiple means of rendering a table in a "grid", from a simple html table populated with an SQL query, to ZEN "Grid" object
For the html table, the following code would give you a table from the SQL query
<script language=SQL name="query">
SELECT * FROM User.DataTable
</script>
<table border=1 bgcolor="">
<tr>
<csp:while counter=queryCol condition="(queryCol<query.GetColumnCount())">
<th align=left><b>#(query.GetColumnHeader(queryCol))#</b></th>
</csp:while>
</tr>
<csp:while counter=queryRow condition=query.Next()>
<tr class='#($S(queryRow#2:"DarkRow",1:"LightRow"))#'>
<csp:while counter=queryCol condition="(queryCol<query.GetColumnCount())">
<td>#(query.GetData(queryCol))#</td>
</csp:while>
</tr>
</csp:while>
</table>
For the ZEN example, take a look at your "local" sample page: <localhost>/csp/samples/ZENTest.DynaGridTest.cls
Hey Milton,
thanks for your answer, sorry but i really don't know how to use it.
Maybe you have an idea.
What i'm looking for is, i have a desktop application created in VB.NET witch save the data in tables without any cache Class, i only use SQL to CRUD the data into the Database.
So i want that some of my colleges take a look to the data on WEB (CSP-Page) with a Login.
Thanks in advance.
BG
Darko Susnjara
Consider using REST. Creating REST in InterSystems Cache 2017.2 is very easy.
you may take this example from OpenExchange:
https://openexchange.intersystems.com/package/Light-weight-EXCEL-download
Al you have to do is to out-comment in ClassMethod OnPreHTTP() #; set %response.ContentType="application/vnd.ms-excel"
this line :
and the table goes to your browser.