コード例 #1
0
        public Webb.Reports.WebbReport CreateReport(string exePath, string templatePath)
        {
            if (!this._IsCommandInitialized)
            {
                return(null);
            }

            string strXtraReportFilePath = templatePath;

            WebbReport m_Report = null;

            if (strXtraReportFilePath != string.Empty)
            {
                m_Report = new WebbReport();

                if (File.Exists(strXtraReportFilePath))
                {
                    Webb.Utility.ReplaceRefPathInRepxFile(strXtraReportFilePath, exePath);                      //Modify template file

                    m_Report.LoadLayout(strXtraReportFilePath);

                    Webb.Utility.CurFileName = strXtraReportFilePath;                           //06-23-2008@Scott

                    string strWebbReportTemplateFilePath = strXtraReportFilePath.Replace(Webb.Utility.ReportExt, Webb.Utility.WebbReportExt);

                    if (File.Exists(strWebbReportTemplateFilePath))
                    {
                        WebbReportTemplate template = new WebbReportTemplate();

                        template.Load(strWebbReportTemplateFilePath);

                        m_Report.ApplyTemplate(template);
                    }
                }
            }

            return(m_Report);
        }