Using Rotative ViewAsPdf with MVC 5
<p>I'm using Rotative ViewAsPdf to convert the view to pdf using the below code, the project required a login and all controllers have [SessionExpire].</p>

<p>I'm passing the SchoolCode to the view using ViewBag to display the selected school details, the view is working fine but when calling the below Action the pdf file display the tables without any data!</p>

<p>Any idea why? 
Is there any other way to save the view with query string and login required as pdf? </p>

<pre><code>public ActionResult DownloadViewPDF()
{
    ViewBag.SChoolCode = Request.QueryString["sid"];
    var a = new ViewAsPdf();
    a.ViewName = "SchoolDetails";
    var pdfBytes = a.BuildPdf(ControllerContext);
    MemoryStream ms = new MemoryStream(pdfBytes);
    return new FileStreamResult(ms, "application/pdf");
}
</code></pre>

<p>SchoolDetails view is using the below ajax</p>

<pre><code>        $.ajax({
            url: '@Url.Action("GetSchoolSearch")',
            type: 'POST',
            datatype: 'json',
            async: false,
            data: {
                p_SchoolCode: v_SchoolID,
            },
            success: function (result) {
                if (result.GetSchoolSearch != null) {
                    ko.cleanNode(document.getElementById('tblSInfo'));
                    ko.applyBindings(result, document.getElementById('tblSInfo'));
                    ResultArray = result.GetSchoolSearch;
                    jQuery.each(ResultArray, function (i, val) {
                        v_SchoolDesc = val["SCHOOL_DESC_AR"];
                        $("#sDesc").html(v_SchoolDesc);
                    })
                }
                else {
                    alert("Not Found!")
                    self.close();
                }
            }
        });
</code></pre>

<p>This is the output of the view</p>

<p><a href="https://i.stack.imgur.com/Hvcu6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hvcu6.png" alt="enter image description here"></a></p>

<p>But the pdf is blank:</p>

<p><a href="https://i.stack.imgur.com/SKhUR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SKhUR.png" alt="enter image description here"></a></p>