FlexReport
SSRSレポート
PDFファイル
サンプル
ソース
using System.Web.Mvc;

namespace FlexViewerExplorer.Controllers
{
    public partial class FlexViewerController : Controller
    {
        // GET: Intro
        public ActionResult Intro()
        {
            return View();
        }
    }
}
@using FlexViewerExplorer.Models;
<div id="reportViewerContainer">
    @(Html.C1().ReportViewer()
        .Id("reportViewer")
        .CssStyle("width", "100%")
        .FilePath(ReportFiles.SelectedReportPath)
        .ReportName(ReportFiles.SelectedReportName)
        .ZoomMode(ZoomMode.PageWidth).ThresholdWidth(650))
</div>
<div id="pdfViewerContainer" class="hidden">
    @(Html.C1().PdfViewer()
        .Id("pdfViewer")
        .CssStyle("width", "100%")
        .FilePath(Documents.Pdfs.SelectedDocumentPath)
        .ZoomMode(ZoomMode.PageWidth).ThresholdWidth(650))
</div>
using Microsoft.Owin;
using Owin;
using System;
using System.IO;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;

[assembly: OwinStartupAttribute(typeof(FlexViewerExplorer.Startup))]
namespace FlexViewerExplorer
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            var pdfsFolder = GetFullRoot("PdfsRoot");
            app.UseStorageProviders().AddDiskStorage("PdfsRoot", pdfsFolder);
            var reportsFolder = GetFullRoot("ReportsRoot");
            app.UseReportProviders().AddFlexReportDiskStorage("ReportsRoot", reportsFolder);
            app.UseReportProviders().AddSsrsReportHost("c1ssrs", "http://ssrs.componentone.com:8000/ReportServer", new System.Net.NetworkCredential("ssrs_demo", "bjqveS5gh89BH1Q"));
        }
        private static string GetFullRoot(string root)
        {
            var applicationBase = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
            var fullRoot = Path.GetFullPath(Path.Combine(applicationBase, root));
            if (!fullRoot.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal))
            {
                // When we do matches in GetFullPath, we want to only match full directory names.
                fullRoot += Path.DirectorySeparatorChar;
            }

            return fullRoot;
        }
    }
}