Add TableView

Description of the limitation and why it is relevant to address

As a developer I want to be able to add a simple TableView so that I can quickly show tabular results to my users

I think this is relevant for the VIKTOR platform because tabular results are very frequent and there is not a very simple way to achieve this at the moment

Submitter proposed design (optional)

provide a dedicated TableView

Current workarounds

The current workarounds are quite nice, but:

Updated status to “in-progress” since we have started the implementation on this.

The TableView has been released in the latest SDK release 14.13.0 :partying_face:

As easy as:

    @TableView("Student Grades", duration_guess=1)
    def table_view(self, **kwargs):
        data = [
            [128, "John", 6.9, False, date(1994, 6, 3)],
            [129, "Jane", 8.1, True, date(1995, 1, 24)],
            [130, "Mike", 7.5, False, date(1989, 12, 4)],
        ]

        return TableResult(data)
  • This makes it very easy to add tabular results in your app.
  • Default sorting and filtering
  • CSV download out-of- the box
  • Possibilities to style cells

Read more about it in the docs.

Looking forward to hear about your experiences @rvandijk , @rkg

1 Like

Is it possible to add this table view to the word/pdf report?

It is possible to fill a table using the render_word_file function of the SDK. You can find information on how to do this here.

That only works when you know the cells where the values go into. I need to print a fairly large table that spans across multiple pages. Also the table dimensions itself is dynamic, so I can’t place a tag for each of the cell.

Current workaround of adding a plotly table as a figure in the word is a temporary fix for me, but since the table spans across multiple page, it clips off the portions of the table that can’t fit within page.

Is it possible to combine TableView with DataView?
UseCase would be raw data in table and summary in DataView

No that’s not possible at the moment.