<pre lang="c#"><pre lang="c#"><pre lang="c#">
protected void Page_Init(object sender, EventArgs e) { var ds = new DataSet(); var rptCriteria = new ReportCriteria(); if (Session["RptCriteria"] != null) rptCriteria = (ReportCriteria)Session["RptCriteria"]; if (Session["Report"] != null) ds = (DataSet)Session["Report"]; if (rptCriteria.Report == "P1") { _reportDocument.Load(Server.MapPath("~/Reports/PAYESummery.rpt")); _rptName = "PAYESummary-Part I"; } else if (rptCriteria.Report == "P2") { _reportDocument.Load(Server.MapPath("~/Reports/PAYESummeryPart2.rpt")); _rptName = "PAYESummary-Part II"; } else if (rptCriteria.Report == "P3") // T9 table { _reportDocument.Load(Server.MapPath("~/Reports/t9report.rpt")); _rptName = "T9 Report"; } else { Label2.Text = "errorrrr"; } if (ds != null && ds.Tables.Count > 0) { Label2.Text = ds.Tables[0].Rows.Count.ToString(); } //----------------------------------------------------------- crConnectionInfo.ServerName = ConfigurationManager.AppSettings["ServerName"]; crConnectionInfo.DatabaseName = ConfigurationManager.AppSettings["DatabaseName"]; crConnectionInfo.UserID = ConfigurationManager.AppSettings["UserID"]; crConnectionInfo.Password = ConfigurationManager.AppSettings["Password"]; //----------------------------------------------------------- var crTableLogOnInfo = new TableLogOnInfo(); crDatabase = _reportDocument.Database; crTables = crDatabase.Tables; foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in crTables) { crTableLogOnInfo = crTable.LogOnInfo; crTableLogOnInfo.ConnectionInfo = crConnectionInfo; crTable.ApplyLogOnInfo(crTableLogOnInfo); } _reportDocument.SetDataSource(ds); _reportDocument.VerifyDatabase(); rptViwer1.ReportSource = _reportDocument; rptViwer1.Zoom(75); // rptViwer1.DataBind(); rptViwer1.RefreshReport();
<table> <tr> <td> <asp:Label ID="Label2" runat="server" Text=""></asp:Label> </td> <td width="120px">Document Type</td> <td> <asp:DropDownList ID="ddlDocType" Width ="145px" runat="server" Enabled ="true"> <asp:ListItem Value ="PDF" Text ="Adobe (PDF)"></asp:ListItem> <asp:ListItem Value ="EXL" Text ="MS Excel"></asp:ListItem> </asp:DropDownList> <asp:Button ID="btnDownload" runat="server" Text="Download" Width ="80px" onclick="btnDownload_Click" /> </td> </tr> </table>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)