Ejemplo n.º 1
0
        private void GenerateReportM()
        {
            LocalReportManager reportManager = new LocalReportManager(rptViewer, "MME", ConfigurationManager.AppSettings["ReportNamespace"].ToString(), ConfigurationManager.AppSettings["ReportPath"].ToString());
            string             rptName       = "MME.rdlc";
            string             rptSelect     = "F";
            var main = ReportBLL.GetBlNumberFromVoyageID(Convert.ToInt32(ddlVoyage.SelectedValue), Convert.ToInt32(ddlVessel.SelectedValue), Convert.ToInt32(ddlPOD.SelectedValue), Convert.ToInt32(ddlLocation.SelectedValue), Convert.ToInt32(ddlLine.SelectedValue));

            if (ddlCargoOrFreight.SelectedIndex == 2)
            {
                rptSelect   = "C";
                _reportName = "CARGO MANIFEST - (" + ddlLocation.SelectedItem + ")";
            }
            else
            {
                _reportName = "FREIGHT MANIFEST - (" + ddlLocation.SelectedItem + ")";
            }

            rptViewer.Reset();
            rptViewer.LocalReport.Dispose();
            rptViewer.LocalReport.DataSources.Clear();
            rptViewer.LocalReport.ReportPath = this.Server.MapPath(this.Request.ApplicationPath) + ConfigurationManager.AppSettings["ReportPath"].ToString() + "/" + rptName;
            rptViewer.LocalReport.DataSources.Add(new ReportDataSource("dsVoyage", main.Tables[0]));
            rptViewer.LocalReport.SetParameters(new ReportParameter("ReportName", _reportName));
            rptViewer.LocalReport.SetParameters(new ReportParameter("FreightOrCargo", rptSelect));
            rptViewer.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SubreportEventHandler);
            rptViewer.LocalReport.Refresh();


            //LocalReportManager reportManager = new LocalReportManager(rptViewer, "MME", ConfigurationManager.AppSettings["ReportNamespace"].ToString(), ConfigurationManager.AppSettings["ReportPath"].ToString());
            //string rptName = "MME.rdlc";
            //var main = ReportBLL.GetBlNumberFromVoyageID(Convert.ToInt64(ddlVoyage.SelectedValue));

            //_reportName = "ReportName";
            //rptViewer.Reset();
            //rptViewer.LocalReport.Dispose();
            //rptViewer.LocalReport.DataSources.Clear();
            //rptViewer.LocalReport.ReportPath = this.Server.MapPath(this.Request.ApplicationPath) + ConfigurationManager.AppSettings["ReportPath"].ToString() + "/" + rptName;
            //rptViewer.LocalReport.DataSources.Add(new ReportDataSource("dsVoyage", main.Tables[0]));
            //rptViewer.LocalReport.SetParameters(new ReportParameter("ReportName", _reportName));
            ////rptViewer.LocalReport.SetParameters(new ReportParameter("RptHeader", "FREIGHT MANIFEST - (" + ddlLocation.SelectedItem + ")"));
            //rptViewer.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SubreportEventHandler);
            //rptViewer.LocalReport.Refresh();
        }