Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to display the default query in big data report

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to show the default query in the big data report. The content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

In order to easily query the specified data accurately or vaguely, the report presentation page on the Web side often adds a filter panel (that is, parameter template) to the report, which is essentially the data filtering of the page parameters to the database sql.

Generally, when the parameters are empty for the first time, only the header part of the page is blank, which may give users the illusion that there is something wrong with the query. In order to avoid this phenomenon, we can set the default query for the report.

There are many ways for reports to implement default queries. Here are some examples of common settings.

1. Query all data by default if the parameter is empty

For example, if you query by region and enter the parameter value to the northeast, the report is shown as follows:

If the parameter is empty, the result is as follows:

Key settings:

Add or to the original dataset SQL statement? The settings of is null, as shown below:

The previous SQL statement and dataset parameter settings are not modified:

Add or? After is null, SQL statement and dataset parameter settings:

Note: each question mark in the statement should correspond to the dataset parameter, and if the nearest field name to the left of the two question marks is the same, then the dataset parameter name should be consistent.

For more specific settings of examples, please refer to: several methods of fetching all data for empty parameters

two。 Parameter assigns initial value to query fixed content

Still take the report in 1 as an example. If the parameter is empty, the initial display is as follows:

Report parameters assign initial values

For example, query the order information for which the owner is in the northeast and the order amount is greater than 1000.

Key settings:

In the report parameter settings panel, specify the default value for the parameter, as shown in the following figure

Note: the data type of the parameter needs to be specified in the report parameter settings, which is consistent with the database field type.

3. Dynamic assignment of initial value

In the report development stage, all of the above examples 1 and 2 are fixed to write the contents of their first query, and sometimes we want to dynamically control the content of the first default query of the report according to certain conditions.

For example, the default query of the report specifies the data of a certain day or the current day of the system. Here, take a query with empty parameters to specify the data of a certain day as an example to see how to configure the dataset and parameters.

Still take the report of example 1 as an example, and modify it as follows

The dataset SQL is modified to:

At the same time, the original parameter settings of the data set are removed.

The report parameters are modified to:

Rq is used to receive the order date value specified on the web page. The new rq1 is responsible for dynamically handling the new query operation when the rq is shown to be empty for the first time.

Big data report on how to show the default query is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report