Most of your reporting needs can be met using Data Views and Reports. However, if you have unique requirements that can't be addressed with these tools—or if you want a more customized experience—the Dynamic Data Block provides a flexible solution. You should be able to use data views and reports to meet most of your reporting requirements. If you have a special requirement that can’t be met, or you prefer a different user experience than what reports provide, there is the Dynamic Data block. When you add a Dynamic Data block to a page (see the Designing and Building Websites Using Rock guide for details on adding blocks to pages), you have the ability to craft the display of filtered data. Let's walk through the various options of this block. Some settings depend on whether you're using Grid or a Lava Template for Results Formatting. We'll start with the Lava Template option which covers the first six common settings. Page Name/Description - This allows you to reset the title and description of the page from within the block. The ability to do this is controlled by the Update Page block setting discussed later.SQL Query - This is the SQL query or stored procedure call (more on procedures below) for defining the data to be displayed. SQL is a standard reporting language used by most databases. There are plenty of resources online for learning its syntax.Query is a Stored Procedure - This setting tells Rock that you will be calling a stored procedure, as opposed to using a straight SQL statement. This allows Rock to configure any parameters needed for the stored procedure.Query Parameters - When using stored procedures, you can pass in parameters to create dynamic filters. More on this feature is covered below in the Extra Power from Stored Procedures section.Timeout Length - As a safeguard against queries that take too long to run, you can specify a timeout period (in seconds). If the query exceeds this limit, it will stop running.Results Formatting: Lava Template - By default, the query will be shown as a grid on the page. If you'd prefer, you can select Lava Template and provide a template that will be used to transform the query results into your own custom layout. This is incredibly powerful because you can start to create your own mini-applications using these dynamic data blocks for displaying data. The Column Configuration section will only display if Grid is selected. Grid is covered in the next example.Lava Template - This is where you put your custom Lava template that will be used to format the query results output. This version of the Dynamic Data block makes it easy to tap into the power of Rock's new grid system, allowing you to create a great viewing experience when using the Grid Results Formatting option. Results Formatting: Grid - Selecting this option displays query results in a grid format. When using the Grid, the Column Configuration section appears, enabling you to customize how columns behave.Reload Columns From Query - When you first supply a SQL Query, the Column Configuration section will be empty. Click this button to read your query to set up configuration options for each column. Use this button again whenever you modify the SELECT columns in your query to refresh the available configuration settings.Column Type - This setting controls how each column in your SQL query is displayed and behaves. Think of it as a way to tell Rock what kind of data is in each column — like numbers, dates, or text — so it can properly format the data and make it easier to work with.Text: Displays values as plain text, perfect for names, descriptions, or labels.Boolean: Shows values as "True" or "False," useful for yes/no or on/off data.Currency: Formats values as monetary amounts, adding the appropriate currency symbol and decimal places.Date: Displays only the date, such as "01/03/2025," for when the time portion does not exist or is unimportant.DateTime: Displays both the date and time, such as "01/03/2025 2:30 PM," for more precise records.HTML: Supports custom HTML formatting, ideal for rich text, links, or content you've styled in your SELECT.Number: Formats values as numbers, making them sortable and usable for calculations.Person: Beautifully formats the value as a person record, making it easy for you to 'wow' your staff members. Response Visibility - This field controls whether a column is shown or hidden based on the size of the viewer's web browser window. It allows you to optimize reports for different screen sizes, ensuring that important information is always visible, while less critical details appear only on larger screens. Width: For even more control, you can specify a custom width for a column using either pixels (px) or percentages (%). For example, use 200px for a fixed width of 200 pixels, or 50% to make the column take up half the available space. Extra-Small: Always visible, even on very small screens, such as mobile devices.Small: Shown on slightly larger screens, like small tablets.Medium: Displays on medium-sized screens, such as larger tablets or small desktops.Large: Visible only on larger screens, like standard desktops or laptops.Extra-Large: Shown on very wide screens, such as large monitors. Column Options - These dynamic options depend on the Column Type selected earlier. The most common options are:Enable Filtering: Controls whether or not the column should include an appropriate filter.Hide from Grid: By default, all the columns returned by the SQL query or stored procedure will be displayed. This is helpful if your SQL defines columns that you want to be displayed when exporting to Excel or CSV, but not displayed on the page.Exclude from Export: Prevents the column from being included in exports. Show Checkbox Selection Column - Adds a checkbox to each row for use with Grid Actions, such as exporting or launching workflows for a subset of results.Disable Paging - By default, the grid shows the first 50 results and provides paging options to view more. Enable this option to turn off paging and display all results at once. The choice is yours.Person Report - If your query returns a list of people, you'll want to enable this option. This will add several feature options that are specific to listing individuals. Be sure that your query returns the Id field so that these features will work as planned.Grid Actions - Lets you pick which grid actions are available on the dynamic report. You'll see additional options depending for Communicate, Person Merge, Bulk Update and Launch Workflow if the Person Report option is enabled.Enable Sticky Header - Enabling this means that the grid's column headers will stay visible on the screen as you scroll down the list of results.Panel Title - Here you can provide the title for the grid's results panel.Selection URL - The URL someone is redirected to when they click on a row in the grid. Any column's value can be used in the URL by including it in braces. For example, if the grid includes an Id column that contains Person Ids, you can link to the Person view, by specifying a value here of ~/Person/{Id}.Communication Merge Fields - List any field you want to be available on the communications page as merge fields.Communication Recipient Fields - This is where you can specify which column(s) contain a Person Id field, to use as the recipient for a communication. You don't need to use this if your query has a Person Id column named "Id".Encrypted Fields - This option allows a report to decrypt any fields that are returned from the query as encrypted values. For example, if you create a report that displays Social Security Numbers and those numbers are stored in a person attribute with the SSN field type, the values in the report will be encrypted. Adding the SSN value to the Encrypted Fields will result in the values being decrypted before being displayed in the report. (Note: a Decrypt filter is available in the Text Filters section of the Lava manual.Page Title Lava - This allows you to set the page's title with Lava. You can also use data from the result set(s).Grid Header Content - This allows you to set the grid's header content with Lava. Just like the Page Title Lava, you can use data from the result set(s).Grid Footer Content - This allows you to set the grid's footer content with Lava. Just like the Page Title Lava, you can use data from the result set(s). Source From the Example Below is an example like the one above. SQL SELECT [Id] , [NickName] , [LastName] , [Email] FROM [Person] WHERE [BirthMonth] = MONTH(GETDATE()) AND [BirthDay] = DAY(GETDATE()) AND [RecordStatusValueId] = 3 Lava <strong>Today's Birthdays</strong> <ul> {% for row in rows %} <li> <a href="/Person/{{ row.Id }}"> {{ row.NickName }} {{ row.LastName }} </a> <a href="/Communication?person={{ row.Id }}"> <i class="ti ti-mail"></i> </a> </li> {% endfor %} </ul> Important! When writing your query, it is important the [Id] field for the person starts with a capital 'I'. If not, links to send communications will not work. NoteThat Figure Is More Than an Example...The settings for the example above will list out all the people in the database whose birthday is the current date as a bulleted list linked to send an email. Throw that on your internal homepage and go buy yourself a coffee! Now that you're familiar with how to set up the Dynamic Data block, you might want to know about the block settings that are available. Name - In most cases the default name will work, but you can change the name of the block if you want to.Enable Quick Return - If this is enabled then people who visit this page will have it added to their Quick Returns bookmarks. If you have multiple Dynamic Data blocks on the same page, only one of them should have this enabled.Update Page - This setting, when enabled, lets you change the page's Name and Description by editing the block as described above.Enabled Lava Commands - You may need to enable one or more of these if you're including Lava in your Dynamic Data block. Extra Power from Stored Procedures OK, we're going to geek out here for a second... By using SQL Server Stored Procedures, it can get even more powerful. When calling a stored procedure, you can pass the procedure any of the query string parameters from the URL. For instance, if the page the block is placed on is accessed from the URL: https://<your server>/page/123?GroupId=12 You can pass the value of the GroupId to your stored procedure as a parameter. The stored procedure can then use this value to help return relevant data (say group members for the group). You can also pass in the current person's person Id field. This allows you to further personalize the data to the person requesting the page. Just think of all the fun you can have with this block! In order to make this all work, you'll need to define each of the parameters you want passed to your stored procedure in the Parameters field discussed above. Rock will look for each of these parameters in the URL’s query string and, if found, pass in the value to the procedure. If you would like the current person’s Id to pass in, you'll likewise need to add in the parameter CurrentPersonId. TipInception TimeThis functionality gets truly powerful when you have dynamic data blocks calling dynamic data blocks. So, you might have one dynamic data block that lists every serving group in your database. Then it links to a different page passing the selected group id, with a dynamic data block that shows the group members. Using the Lava template option, all of this can be designed to make the pages look like custom application logic. BAM!