ICachedReport 인터페이스
이 인터페이스는 구현 클래스를 Crystal Reports SDK를 사용하여 ASP.NET Cache 개체로 캐시할 수 있는 것으로 식별합니다.
이 형식의 멤버 목록을 보려면 ICachedReport 멤버를 참조하십시오.
ICachedReport
[Visual Basic]
Public Interface ICachedReport
Inherits System.Object
[C#]
public interface ICachedReport : System.Object
설명
미리 만들어진 캐싱 메커니즘을 사용하려면 사용자의 고유 클래스에 이 인터페이스를 구현합니다. 사용자가 구현하는 메서드 및 속성은 보고서를 캐싱하는 데 필요한 정보를 검색하기 위해 ReportDocument 개체 모델에 의해 호출됩니다. 클래스의 인스턴스를 CrystalReportViewer 컨트롤의 ReportSource 속성으로 설정하여 캐싱을 활성화합니다.
예제
다음 예제는 ICachedReport 인터페이스를 구현하는 클래스를 만듭니다.
[Visual Basic]
Imports System
Imports System.ComponentModel
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.ReportSource
Imports CrystalDecisions.Shared
Public Class CachedReport
Inherits Component
Implements ICachedReport
Private blIsCacheable As Boolean
Private blShareDBLogonInfo As Boolean
Private tsCacheTimeOut As TimeSpan
Private Report As New ReportDocument()
Private reportName As String
Public Sub New(ByVal s As String)
reportName = s
End Sub
Public Overridable Property IsCacheable() As [Boolean] _
Implements CrystalDecisions.ReportSource.ICachedReport.IsCacheable
Get
Return blIsCacheable
End Get
Set(ByVal Value As [Boolean])
blIsCacheable = Value
End Set
End Property
Public Overridable Property ShareDBLogonInfo() _
As [Boolean] Implements _
CrystalDecisions.ReportSource.ICachedReport.ShareDBLogonInfo
Get
Return blShareDBLogonInfo
End Get
Set(ByVal Value As [Boolean])
blShareDBLogonInfo = Value
End Set
End Property
Public Overridable Property CacheTimeOut() _
As TimeSpan Implements _
CrystalDecisions.ReportSource.ICachedReport.CacheTimeOut
Get
Return tsCacheTimeOut
End Get
Set(ByVal Value As TimeSpan)
tsCacheTimeOut = Value
End Set
End Property
Public Overridable Function CreateReport() _
As ReportDocument Implements _
CrystalDecisions.ReportSource.ICachedReport.CreateReport
Report.Load _
(reportName, OpenReportMethod.OpenReportByTempCopy)
Report.Site = Me.Site
Return Report
End Function
Public Overridable Function GetCustomizedCacheKey _
(ByVal request As RequestContext)
As [String] Implements _
CrystalDecisions.ReportSource. _
ICachedReport.GetCustomizedCacheKey
Dim key As [String] = Nothing
key = RequestContext.BuildCompleteCacheKey _
(request, reportName, Me.GetType(), Me.ShareDBLogonInfo)
Return key
End Function
End Class
[C#]
using System;
using System.ComponentModel;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.ReportSource;
using CrystalDecisions.Shared;
public class CachedReport : Component, ICachedReport
{
protected ReportDocument Report = new ReportDocument();
protected bool isCacheable;
protected bool shareDBLogonInfo;
protected string reportName;
protected TimeSpan cacheTimeOut;
public CachedReport(string s)
{
reportName = s;
}
public virtual Boolean IsCacheable
{
get
{
return isCacheable;
}
set
{
isCacheable = value;
}
}
public virtual Boolean ShareDBLogonInfo
{
get
{
return shareDBLogonInfo;
}
set
{
shareDBLogonInfo = value;
}
}
public virtual TimeSpan CacheTimeOut
{
get
{
return cacheTimeOut;
}
set
{
cacheTimeOut = value;
}
}
public virtual ReportDocument CreateReport()
{
Report.Load
(reportName, OpenReportMethod.OpenReportByTempCopy);
Report.Site = this.Site;
return Report;
}
public virtual String GetCustomizedCacheKey
(RequestContext request)
{
String key = null;
key = RequestContext.BuildCompleteCacheKey(
request,
reportName,
this.GetType(),
this.ShareDBLogonInfo);
return key;
}
}
요구 사항
네임스페이스 CrystalDecisions.ReportSource
어셈블리 CrystalDecisions.ReportSource (CrystalDecisions.ReportSource.dll)
참고 항목
ICachedReport 멤버 | CrystalDecisions.ReportSource 네임스페이스
©2005 Business Objects SA All rights reserved.
Business Objects SA http://www.businessobjects.com/ 지원 서비스 http://korea.businessobjects.com/services/ |