# Trước tất cả - chặn khi thiếu điều kiện lọc

* Khi xem báo cáo, yêu cầu người dùng phải chọn điều kiện lọc trên giao diện. Nếu trông thông tin sẽ chặn lại
* Ví dụ: Báo cáo chi tiết vật tư thì cần có thông tin lọc vật tư

```csharp
// Some code
public DataTable DMain(DataTable dtColumns, DataRow drReport, FOR0025 formBaoCao)
	{
		/*
		- Sổ chi tiết công nợ, nên cần phải chọn tài khoản trước khi xem
		*/
		try
		{
			//--Nếu không phải báo cáo enter chi tiết thì mới chạy vì khi gọi enter chi tiết đã tryền tk vào rồi
			if(formBaoCao.Visible && formBaoCao.txtReport.Value == Convert.ToInt16(drReport["report"]))
			{
				DataTable dtfil = formBaoCao.GetTableValueFilterOnForm();
				// MessageBox.Show(formBaoCao.form26.Name);
				if(dtfil == null || dtfil.Rows.Count == 0)
				{
					_Func.ThongBao("Bạn vui lòng chọn tài khoản xem báo cáo!!! ",true);
					formBaoCao.StopRun = true;
				}
				else
				{
					DataRow[] drf = dtfil.Select("SourceName = 'taikhoan' and SelectedValue<>''");
					if(drf.Length == 0)
					{
						_Func.ThongBao("Bạn vui lòng chọn Tài khoản xem báo cáo!!!",true);
						formBaoCao.StopRun = true;
					}
				}
			}
			
		}
		catch(Exception ex)
		{
			MessageBox.Show(ex.Message);
		}

		return dtColumns;
	}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kythuat.dtechvn.com/bao-cao/truoc-tat-ca-chan-khi-thieu-dieu-kien-loc.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
