/Reports/GeneralReport.cs
http://github.com/khaneh/Orders · C# · 160 lines · 127 code · 15 blank · 18 comment · 0 complexity · 045c763ec99d17ee5309c8b557df82c8 MD5 · raw file
- using System;
- using System.ComponentModel;
- using CrystalDecisions.Shared;
- using CrystalDecisions.ReportSource;
- using CrystalDecisions.CrystalReports.Engine;
-
- namespace Reports
- {
- /// <summary>
- /// Summary description for GeneralReport.
- /// </summary>
- public class GeneralReport : ReportClass
- {
- private string fileName=null;
- public GeneralReport(string rptFileName)
- {
- fileName=rptFileName;
- }
-
- public override string ResourceName
- {
- get
- {
- return fileName;
- }
- set
- {
- // Do nothing
- }
- }
- [Browsable(false)]
- [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
- public CrystalDecisions.CrystalReports.Engine.Section ReportHeaderSection1
- {
- get
- {
- return this.ReportDefinition.Sections[0];
- }
- }
-
- [Browsable(false)]
- [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
- public CrystalDecisions.CrystalReports.Engine.Section PageHeaderSection1
- {
- get
- {
- return this.ReportDefinition.Sections[1];
- }
- }
-
- [Browsable(false)]
- [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
- public CrystalDecisions.CrystalReports.Engine.Section DetailSection1
- {
- get
- {
- return this.ReportDefinition.Sections[2];
- }
- }
-
- [Browsable(false)]
- [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
- public CrystalDecisions.CrystalReports.Engine.Section ReportFooterSection1
- {
- get
- {
- return this.ReportDefinition.Sections[3];
- }
- }
-
- [Browsable(false)]
- [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
- public CrystalDecisions.CrystalReports.Engine.Section PageFooterSection1
- {
- get
- {
- return this.ReportDefinition.Sections[4];
- }
- }
-
- }
-
- [System.Drawing.ToolboxBitmapAttribute(typeof(CrystalDecisions.Shared.ExportOptions), "report.bmp")]
- public class CachedGeneralReport : Component, ICachedReport
- {
-
- private string fileName=null;
-
- public CachedGeneralReport(string rptFileName)
- {
- fileName=rptFileName;
- }
-
- [Browsable(false)]
- [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
- public virtual bool IsCacheable
- {
- get
- {
- return true;
- }
- set
- {
- //
- }
- }
-
- [Browsable(false)]
- [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
- public virtual bool ShareDBLogonInfo
- {
- get
- {
- return false;
- }
- set
- {
- //
- }
- }
-
- [Browsable(false)]
- [DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
- public virtual System.TimeSpan CacheTimeOut
- {
- get
- {
- return CachedReportConstants.DEFAULT_TIMEOUT;
- }
- set
- {
- //
- }
- }
-
- public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
- {
- GeneralReport rpt = new GeneralReport(fileName);
- rpt.Site = this.Site;
- return rpt;
- }
-
- public virtual string GetCustomizedCacheKey(RequestContext request)
- {
- String key = null;
- // // The following is the code used to generate the default
- // // cache key for caching report jobs in the ASP.NET Cache.
- // // Feel free to modify this code to suit your needs.
- // // Returning key == null causes the default cache key to
- // // be generated.
- //
- // key = RequestContext.BuildCompleteCacheKey(
- // request,
- // null, // sReportFilename
- // this.GetType(),
- // this.ShareDBLogonInfo );
- return key;
- }
- }
- }