﻿@model CRP.Controllers.ViewModels.ReportViewModel

@{
    ViewBag.Title = "ViewReport";
}

<div class="boundary">
    <p>
        @Html.ActionLink("Back to Item", "Details", "ItemManagement", null, null, "Reports", new { id = Model.ItemId }, null) |
        @Html.ActionLink("Generate Excel Report", "CreateExcelReport", "Excel", new { id = Model.ItemReportId, itemId = Model.ItemId }, null)
    </p>
    <hr/>
    <h2>@Model.ReportName</h2>
    <table id="table" class="table table-bordered">
        <thead>
        <tr>
            @foreach (var ch in Model.ColumnNames)
            {
                <td>@ch</td>
            }
        </tr>
        </thead>
        <tbody>
        @foreach (var row in Model.RowValues)
        {
            <tr>
                @foreach (var cell in row)
                {
                    <td>@cell</td>
                }
            </tr>
        }
        </tbody>
    </table>

</div>

@section AdditionalScripts
{
    <script type="text/javascript">
        $(function() {
            $("#table").dataTable({
                responsive: true
            });

        });
    </script>
}


﻿@model CRP.Controllers.ViewModels.ReportViewModel

@{
    ViewBag.Title = "ViewReport";
}

<div class="boundary">
    <p>
        @Html.ActionLink("Generate Excel Report", "CreateExcelReport", "Excel", new { id = Model.ItemReportId, itemId = Model.ItemId }, new { @class = "btn" })
    </p>
    <p>@Html.ActionLink("Back to Item", "Details", "ItemManagement", null, null, "Reports", new { id = Model.ItemId }, null)</p>
    <hr/>
    <h2>@Model.ReportName</h2>
    <table id="table" class="table table-bordered">
        <thead>
        <tr>
            @foreach (var ch in Model.ColumnNames)
            {
                <td>@ch</td>
            }
        </tr>
        </thead>
        <tbody>
        @foreach (var row in Model.RowValues)
        {
            <tr>
                @foreach (var cell in row)
                {
                    <td>@cell</td>
                }
            </tr>
        }
        </tbody>
    </table>

</div>

@section AdditionalScripts
{
    <script type="text/javascript">
        $(function() {
            $("#table").dataTable({
                responsive: true
            });

        });
    </script>
}


Make generate Excel action a button
Make generate Excel action a button
