Want to create simple CSP Page to display data from a table
I want to create simple CSP page with some fields to filter and a table in the page that shows results from a table. Where to start any tips
Comments
Currently the most common approach for creating a web application/page which sources data from IRIS is to use one of the popular client side web application frameworks such as Angular, React, or vue.js. In IRIS you would build a web service which your app would call to get data.
Creating REST Services
https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=G…
I am assuming you want to create a tag-based CSP page as a quick and dirty way to through up some data in a table? If so, the basic steps would be:
- Load a JS library like https://www.tablefilter.com/ to make your filtering easy
- Write out your <table> and <th> tags
- Create a <script language='cache' runat='server'> block to hold your ObjectScript which will fetch your result set
- Use %SQL.Statement to create and run the query and fetch the data
- Iterate over the resultset, and write out a row of HTML for each row in the resultset using &html<>
- End your </script> tag and then end your </table> tag
Hope that gets you rolling!
There is my example in OEX: Light weight EXCEL download
if you omit the special setting of type, it is a normal html table.