識別執行狀態Identifying Execution State

超文字傳輸協定 (HTTP) 是一種無連接且沒有狀態 (Stateless) 的通訊協定,也就是說它不會自動指出不同的要求是否全都來自相同的用戶端,也不會自動指出某個特定瀏覽器執行個體是否仍在主動檢視網頁或網站。Hypertext Transfer Protocol (HTTP) is a connectionless and stateless protocol, which means that it does not automatically indicate whether different requests come from the same client or even whether a single browser instance is still actively viewing a page or site. 工作階段會建立邏輯連接以透過 HTTP 維護伺服器與用戶端之間的狀態。Sessions create a logical connection to maintain state between server and client over HTTP. 與特定工作階段相關的使用者特定資訊又稱為工作階段狀態。The user-specific information relevant to a particular session is known as the session state.

工作階段管理需要將 HTTP 要求與從相同工作階段產生的其他舊要求相互關聯。Session management involves correlating an HTTP request with other previous requests generated from the same session. 若沒有工作階段管理,由於 HTTP 通訊協定的無連接與無狀態的本質,這些要求會顯得與報表伺服器 Web 服務不相關。Without session management, these requests appear unrelated to the Report Server Web service because of the connectionless and stateless nature of the HTTP protocol.

Reporting ServicesReporting Services 並不會公開工作階段狀態的整體概念,例如由 ASP.NETASP.NET 所公開。does not expose a holistic concept of session state such as that exposed by ASP.NETASP.NET. 不過,當執行報表時,報表伺服器會以執行的形式在方法呼叫之間維護狀態。However, when executing reports, the report server maintains state between method calls in the form of an execution. 執行可讓使用者以數種方式和報表互動,包括從報表伺服器載入報表、設定報表的認證與參數,以及轉譯報表。An execution allows the user to interact with the report in several ways - including loading the report from the report server, setting credentials and parameters for the report, and rendering the report.

在與報表伺服器進行通訊時,用戶端會使用執行來管理報表檢視以及對報表中其他頁面的使用者導覽,並顯示或是隱藏報表的區段。While they are communicating to a report server, clients use the execution to manage report viewing and user navigation to other pages in a report, and to show or hide sections of a report. 用戶端應用程式正在執行的每個報表,會有唯一的執行。A unique execution exists for each report the client application is running.

一般而言,當使用者導覽至瀏覽器或是用戶端應用程式,並選取要檢視的報表時,執行的存留期間會開始。In general, the lifetime of an execution starts when a user navigates to a browser or client application and selects a report to view. 在已經收到對執行的上一個要求之後,將會在簡短的逾時期間之後捨棄執行 (預設逾時是 20 分鐘)。The execution is discarded after a short time out period after the last request to the execution has been received (the default time out is 20 minutes).

從 Web 服務觀點來看,當呼叫報表伺服器 Web 服務 LoadReport, LoadReportDefinition 或是 Render 方法時,存留期間即開始。From a Web service perspective, the lifetime starts when the Report Server Web service LoadReport, LoadReportDefinition, or Render methods are called. 應用程式可以使用其他方法來操作使用中執行 (例如,設定參數和設定資料來源)。The application can use other methods to manipulate the active execution (for example, setting parameters and setting data sources). 在已經收到對執行的上一個要求之後,將會在簡短的逾時期間之後捨棄執行 (預設逾時是 20 分鐘)。The execution is discarded after a short time out period after the last request to the execution has been received (the default time out is 20 minutes).

應用程式會儲存 Render,以便從 RenderStreamExecutionID 方法在 SOAP 標頭中傳回,來對 Web 服務 LoadReportLoadReportDefinition 方法之間的呼叫持續追蹤多個使用中執行。An application keep track of multiple active executions between calls to the Web service Render and RenderStream methods by saving the ExecutionID, which is returned in the SOAP header from the LoadReport and LoadReportDefinition methods.

下圖顯示報表的處理和轉譯路徑。The following diagram shows the processing and rendering path for reports.

報表處理/轉譯路徑Report processing/rendering path

為了支援上述功能,已將目前的 SOAP Render 方法分成多個方法,以包含執行初始化、處理和轉譯階段。To support the functions described above, the current SOAP Render method has been split into multiple methods encompassing execution initialization, processing, and rendering phases.

若要以程式設計的方式轉譯報表,您必須:To programmatically render a report, you must:

當報表是在工作階段中時,儲存在報表伺服器資料庫中的基礎報表有可能會變更。While a report is in session, the underlying report stored in the report server database can change. 例如,報表定義有可能會變更,報表有可能會刪除或是移動,而且使用者權限也可能會變更。For example, the report definition can change, the report can be deleted or moved, and user permissions can change. 如果報表是在使用中工作階段,它不會受到對基礎報表變更的影響 (也就是說,報表會儲存在報表伺服器資料庫中)。If the report is in an active session, it is not affected by changes made to the underlying report (that is, the report stored in the report server database).

您也可以使用 URL 存取命令來管理報表工作階段。You can also manage a report session using URL access commands.

另請參閱See Also

Render使用 REPORTING SERVICES SOAP 標頭 (SSRS)的技術參考Render Technical Reference (SSRS) Using Reporting Services SOAP Headers