コード例 #1
0
        public ActionResult GetReport(string id)
        {
            // Create the report object and load data from xml file
            var report = new StiReport();

            // Load report from MDZ document file
            // If not found - load from MRT template
            switch (id)
            {
            // Interactive Reports
            case "DrillDownSorting":

            // Parameters
            case "ParametersDetailedCategories":
            case "ParametersDetailedOrders":
            case "ParametersHighlightCondition":
            case "ParametersSelectingCountry":
            case "ParametersInvoice":

            // {Today} function is used
            case "MultiColumnListContainers":
                var data = new DataSet("Demo");
                data.ReadXml(Server.MapPath("~/Content/Data/Demo.xml"));
                report.Load(Server.MapPath("~/Content/ReportTemplates/" + id + ".mrt"));
                report.RegData(data);
                break;

            default:
                report.LoadPackedDocument(Server.MapPath("~/Content/ReportSnapshots/" + id + ".mdz"));
                break;
            }

            return(StiMvcViewerFx.GetReportResult(report));
        }
コード例 #2
0
        public ActionResult GetReport(int?id)
        {
            // Create the report object
            StiReport report = new StiReport();

            // Load report
            switch (id)
            {
            // Load report snapshot
            case 1:
                report.LoadDocument(Server.MapPath("~/Content/Reports/SimpleList.mdc"));
                break;

            // Load report template
            case 2:
                report.Load(Server.MapPath("~/Content/Reports/TwoSimpleLists.mrt"));
                break;

            // Load compiled report class
            case 3:
                report = new StiMasterDetail();
                break;

            // Load compiled report class
            case 4:
                report = new StiParametersSelectingCountryReport();
                break;

            // Load report snapshot
            default:
                report.LoadDocument(Server.MapPath("~/Content/Reports/SimpleList.mdc"));
                break;
            }

            // Load data from XML file for report template
            if (!report.IsDocument)
            {
                DataSet data = new DataSet("Demo");
                data.ReadXml(Server.MapPath("~/Content/Data/Demo.xml"));

                report.RegData(data);
            }

            return(StiMvcViewerFx.GetReportResult(report));
        }