void OpenPDFReport()
{
if (Session["User"] != null)
{
string dirpath = Server.MapPath("ReportsDocuments\\" + Session["User"].ToString().Trim() + "\\");
if (Directory.Exists(dirpath) == true)
{
DirectoryInfo dinfo = new DirectoryInfo(dirpath);
if (dinfo != null)
{
FileInfo[] fin = dinfo.GetFiles();
string filename = Path.Combine(dirpath, "Reports" + timeframe + ".pdf");
if (File.Exists(filename))
{
hdnFile.Value = "ReportsDocuments\\" + Session["User"].ToString().Trim() + "\\Reports" + timeframe + ".pdf";
Literal li = new Literal();
li.Text = "<script>document.getElementById('doc').src = document.getElementById('hdnFile').value;</script>";
Page.Controls.Add(li);
}
}
}
}
}