Given a list view with several columns: ID, First Name, and Last Name. Let’s say the “ID” column shows an ID number as a hyperlink that points to another form. The list view’s filter only shows options for filtering on the First Name and Last Name columns. Why can’t I filter on ID too?
This post is the sixth and final installment in the Build a Reporting Engine Using K2 SmartForms series.
In previous posts, I talked about some aspects of the T-SQL used to support the engine, and touched time and again on how the actual job of the interface is to build a SQL
WHERE clause to append to a
SELECT statement and execute to return data to a list.
Today I’ll talk a bit about the interface.
I can’t recall the last time I’d been this excited about building a new feature.
My client has a high-touch, high-visibility application — and I mean “high-touch” more in the sense that a lot of people use it, rather than it gets used often (quantity as opposed to duration, I guess). At the top of my clients’ Christmas list this year was a new feature for building and persisting reports that can be used to monitor the progress of work items through their process.
I wanted to build them a reporting engine that was flexible enough to provide insight from multiple data sources, and with an interface that was as familiar and intuitive as possible.
If you find yourself in situation where a subform is exhibiting unusual style behavior, check to make sure it’s being instantiated from a K2 SmartForm instead of a View.
There are a few different ways to impart style into K2 SmartForms. Perhaps the most straightforward way is by using the controls in Designer. Apart from the selection of a style sheet, these controls allow for limited manipulation of style elements on objects placed within a SmartForm. For greater style control, one must consult the style sheets that comprise the themes.
There is, however, another way: One can create a style sheet and implement it directly on a specific SmartForm. The method is hackish and not entirely comfortable architecturally, but it can be done.
This document will walk you through the method used for this “style sheet injection,” and how to deploy the style sheets to other servers.
The K2 SmartForms Picture Control is comprised of:
- The SmartForms Picture control
- A table in the K2 database
- A .NET Generic Handler
Let’s talk about each of these.
Now that we have successfully implemented the Set Language control on a form, and figured out a means of passing the selected language to a subform, it’s time to explore how well the Set Language control performs in translating text on an editable view (a datagrid).
In the second post of this series I showed how you could use XML functions to return your recordset from the database as HTML
row and cell elements (“Make the Database Return Your Recordset as an HTML Table — Using XML”, 8/6/2016). We did this by naming the XML elements after the appropriate HTML elements.
If we stopped at this point, we could create a SmartObject that returns our string of HTML
data to the caller. For example, we can already have the HTML for the rest of the report elsewhere, and this SmartObject simply “plugs in” the data to be displayed. This could be as easy as concatenating strings (say, an HTML report header, the HTML
output from the SmartObject, and an HTML report footer) in a Data Event.
We can go further. By using XSL Transform, we should be able to have the database return our entire HTML report — not just the table.