当前位置: 首页>>代码示例>>C#>>正文


C# ReportDocument.Load方法代码示例

本文整理汇总了C#中ReportDocument.Load方法的典型用法代码示例。如果您正苦于以下问题:C# ReportDocument.Load方法的具体用法?C# ReportDocument.Load怎么用?C# ReportDocument.Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ReportDocument的用法示例。


在下文中一共展示了ReportDocument.Load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ShowGenericRpt

        public void ShowGenericRpt()
        {
            try
            {
                bool isValid = true;

                string strReportName = System.Web.HttpContext.Current.Session["ReportName"].ToString();    // Setting ReportName

                if (string.IsNullOrEmpty(strReportName))
                {
                    isValid = false;
                }

                if (isValid)
                {
                    ReportDocument rd = new ReportDocument();
                    string strRptPath = System.Web.HttpContext.Current.Server.MapPath("~/") + "Report//" + strReportName;
                    rd.Load(strRptPath);
                    rd.VerifyDatabase();
                    rd.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "crReport");
                    // Clear all sessions value
                    Session["ReportName"] = null;
                }
                else
                {
                    Response.Write("<H2>Nothing Found; No Report name found</H2>");
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.ToString());
            }
        }
开发者ID:NguyenHoangDuy,项目名称:MVC_ESM,代码行数:33,代码来源:GenericReportViewerController.cs

示例2: CrystalReportViewer1_Loaded

 private void CrystalReportViewer1_Loaded(object sender, RoutedEventArgs e)
 {
     ReportDocument report = new ReportDocument();
     if (m_isurduvisible)
     {
         report.Load("../../Reports/SaleReceipt_u.rpt");
     }
     if (!m_isurduvisible)
     {
         report.Load("../../Reports/SaleReceipt_e.rpt");
     }
     
     ArrayList reportdata = new ArrayList();
     reportdata.Add(productSold);
   
     using(var db = new HCSMLEntities1())
     {               
         try
         {
             report.SetDataSource(from c in db.saleproducts where c.seqid == productSold.seqid select c);
         }
         catch (NotSupportedException ex)
         {}
         catch (Exception ex)
         {}
        
     }
     crystalReportsViewer1.ViewerCore.ReportSource = report;
     report.Dispose();
 }
开发者ID:sohaibjaved44,项目名称:HCS,代码行数:30,代码来源:winFeedMillReportViewer.xaml.cs

示例3: GetVendorListByActivationStatus

        public ReportDocument GetVendorListByActivationStatus(string sortedBy, string sortingOrder, string isActive, LumexDBPlayer db)
        {
            try
            {
                LumexSessionManager.Add("rptName", "Vendor_List");
                ReportDocument reportDocument = new ReportDocument();

                db.AddParameters("@SortedBy", sortedBy.Trim());
                db.AddParameters("@SortingOrder", sortingOrder.Trim());
                db.AddParameters("@IsActive", isActive.Trim());

                if (isActive == "All")
                {
                    reportDocument.Load(reportPath + "GET_VENDORS.rpt");
                }
                else
                {
                    reportDocument.Load(reportPath + "GET_VENDORS_BY_ACTIVATION_STATUS.rpt");
                }

                reportDocument.SetDataSource(db.ExecuteDataTable("REPORT_GET_VENDORS_BY_ACTIVATION_STATUS", true));

                return reportDocument;
            }
            catch (Exception)
            {
                throw;
            }
        }
开发者ID:atiburrahman09,项目名称:Signbd,代码行数:29,代码来源:GeneralReportsDAL.cs

示例4: GeneratePDF

		private void GeneratePDF()
		{
            ReportDocument rpt = new ReportDocument();
            switch (cboView.SelectedItem.Value)
            {
                case "0":
                    rpt.Load(Server.MapPath(Constants.ROOT_DIRECTORY + "/Reports/ChartOfAccountsDetails.rpt"));
                    break;
                case "1":
                    rpt.Load(Server.MapPath(Constants.ROOT_DIRECTORY + "/Reports/ChartOfAccountsSummary.rpt"));
                    break;
            }

			ExportOptions exportop = new ExportOptions();
			DiskFileDestinationOptions dest = new DiskFileDestinationOptions();
			
			string strPath = Server.MapPath(@"\RetailPlus\temp\");

			string strFileName = "chartofacc_" + Session["UserName"].ToString() + "_" + DateTime.Now.ToString("yyyyMMddhhmmssff") + ".pdf";
			if (System.IO.File.Exists(strPath + strFileName))
				System.IO.File.Delete(strPath + strFileName);

			dest.DiskFileName = strPath + strFileName;

			exportop = rpt.ExportOptions;
	
			SetDataSource(rpt);

			exportop.DestinationOptions = dest;
			exportop.ExportDestinationType = ExportDestinationType.DiskFile;
			exportop.ExportFormatType = ExportFormatType.PortableDocFormat;
			rpt.Export();   rpt.Close();    rpt.Dispose();
			
			fraViewer.Attributes.Add("src","/RetailPlus/temp/" + strFileName);
		}
开发者ID:marioricci,项目名称:erp-luma,代码行数:35,代码来源:_Reports.ascx.cs

示例5: btnGenerar_Click

 private void btnGenerar_Click(object sender, EventArgs e)
 {
     if (rbgTipoConsulta.SelectedIndex == 0)
     {
         ReportDocument rpt = new ReportDocument();
         rpt.Load(Application.StartupPath+ "//Taller//crptOrdenesTrabajosG.rpt");
         rptOrdenesTrabajos report = new rptOrdenesTrabajos(rpt);
         report.ShowDialog();
     }
     if (rbgTipoConsulta.SelectedIndex == 1)
     {
         ReportDocument rpt = new ReportDocument();
         rpt.Load(Application.StartupPath + "//Taller//crptOrdenesTrabajosC.rpt");
         rptOrdenesTrabajos report = new rptOrdenesTrabajos(rpt);
         report.ShowDialog();
     }
     if (rbgTipoConsulta.SelectedIndex == 2)
     {
         ReportDocument rpt = new ReportDocument();
         rpt.Load(Application.StartupPath + "//Taller//crptOrdenesTrabajosV.rpt");
         rpt.Load(@"C:\Users\Mario\Desktop\Proyecto\taller\SistemasIntegrados\datos\Taller\crptOrdenesTrabajosV.rpt");
         rptOrdenesTrabajos report = new rptOrdenesTrabajos(rpt);
         report.ShowDialog();
     }
 }
开发者ID:Kendry06,项目名称:BaseSistemasIntegrados,代码行数:25,代码来源:frmRptOrdenesdeTrabajo.cs

示例6: Page_Init

        protected void Page_Init(object sender, EventArgs e)
        {
            //if (!IsPostBack)
            //{
                int temp;

                if (Request["tipo"] != null && int.TryParse(Request["tipo"].ToString(), out temp)
                    && (int.Parse(Request["tipo"].ToString()) == 1 || int.Parse(Request["tipo"].ToString()) == 2)
                    && Request["codigo"] != null && int.TryParse(Request["codigo"].ToString(), out temp))
                {
                    ReportDocument doc = new ReportDocument();
                    Hashtable hash = null;

                    if (int.Parse(Request["tipo"].ToString()) == 1) //Movimentação
                    {
                        IList<Movimento> lm = new List<Movimento>();
                        lm.Add(Factory.GetInstance<IMovimentacao>().BuscarPorCodigo<Movimento>(int.Parse(Request["codigo"].ToString())));
                        hash = Factory.GetInstance<IMovimentacao>().RetornaHashMovimentacaoRemanejamento<IList<Movimento>>(int.Parse(Request["tipo"].ToString()), lm);

                        DSCorpoMovimentacao dsc = new DSCorpoMovimentacao();
                        DSCabecalhoMovimentacao dscab = new DSCabecalhoMovimentacao();

                        dsc.Tables.Add((DataTable)hash["corpo"]);
                        dscab.Tables.Add((DataTable)hash["cabecalho"]);

                        doc.Load(Server.MapPath("RelatoriosCrystal/RelMovimentacao.rpt"));
                        doc.SetDataSource(dscab.Tables[1]);
                        doc.Subreports[0].SetDataSource(dsc.Tables[1]);

                        CrystalReportViewer_Relatorio.ReportSource = doc;
                        CrystalReportViewer_Relatorio.DataBind();
                    }
                    else //Remanejamento
                    {
                        IList<RemanejamentoMedicamento> lrm = new List<RemanejamentoMedicamento>();
                        lrm.Add(Factory.GetInstance<IMovimentacao>().BuscarPorCodigo<RemanejamentoMedicamento>(int.Parse(Request["codigo"].ToString())));
                        hash = Factory.GetInstance<IMovimentacao>().RetornaHashMovimentacaoRemanejamento<IList<RemanejamentoMedicamento>>(int.Parse(Request["tipo"].ToString()),lrm);

                        DSCorpoRemanejamento dsr = new DSCorpoRemanejamento();
                        DSCabecalhoRemanejamento dsc = new DSCabecalhoRemanejamento();

                        dsr.Tables.Add((DataTable)hash["corpo"]);
                        dsc.Tables.Add((DataTable)hash["cabecalho"]);

                        doc.Load(Server.MapPath("RelatoriosCrystal/RelRemanejamento.rpt"));
                        doc.SetDataSource(dsc.Tables[1]);
                        doc.Subreports[0].SetDataSource(dsr.Tables[1]);

                        CrystalReportViewer_Relatorio.ReportSource = doc;
                        CrystalReportViewer_Relatorio.DataBind();
                    }
                }
            //}
        }
开发者ID:vivermais,项目名称:vivermais,代码行数:54,代码来源:FormImprimirMovimentoRemanejamento.aspx.cs

示例7: getReportDocument

        private ReportDocument getReportDocument()
        {
            ReportDocument rpt = new ReportDocument();

            if (!chkGroupItems.Checked)
                rpt.Load(Server.MapPath(Constants.ROOT_DIRECTORY + "/Reports/_MostSalableItemsReport.rpt"));
            else
                rpt.Load(Server.MapPath(Constants.ROOT_DIRECTORY + "/Reports/_MostSalableItemsReportGrouped.rpt"));

            return rpt;
        }
开发者ID:marioricci,项目名称:erp-luma,代码行数:11,代码来源:_MostSalableItemsReport.ascx.cs

示例8: btnSearch_Click

        private void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                int DoctorID;
                //string DoctorName;
                string StartDate;
                string EndDate;
                DoctorID = Convert.ToInt32(cbDoctor.SelectedValue.ToString());
               // DoctorName=Convert.ToString(cbDoctor.SelectedText.ToString());
                StartDate = Convert.ToString(dtpStartDate.Text);

                EndDate = Convert.ToString(dtpEndDate.Text);

                ReportDocument reportDocument = new ReportDocument();
                ParameterField paramField = new ParameterField();
                ParameterFields paramFields = new ParameterFields();
                ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
                string ReportPath = ConfigurationManager.AppSettings["ReportPath"];

                paramField.Name = "@DoctorID";
                //paramField.Name = "@DoctorName";
                paramField.Name = "@StartDate";
                paramField.Name = "@EndDate";
                paramDiscreteValue.Value = 1;
                if (chkdailyreport.Checked == true)
                {
                    reportDocument.Load(ReportPath + "Report\\DoctorPay_CrystalReportNew1.rpt");
                }
                else
                {
                    reportDocument.Load(ReportPath + "Report\\DoctorPayment_ReportNew.rpt");
                }

                ConnectionInfo connectionInfo = new ConnectionInfo();
                connectionInfo.DatabaseName = "DB_MedicalShop_02Sept20159PM";
                //connectionInfo.UserID = "wms";
                //connectionInfo.Password = "wms";
                connectionInfo.IntegratedSecurity = true;
                SetDBLogonForReport(connectionInfo, reportDocument);

                reportDocument.SetParameterValue("@DoctorID", DoctorID);
                //reportDocument.SetParameterValue("@DoctorName", DoctorName);
                reportDocument.SetParameterValue("@StartDate", StartDate);
                reportDocument.SetParameterValue("@EndDate", EndDate);
                SupplierCrystalRpt.ReportSource = reportDocument;

                SupplierCrystalRpt.ToolPanelView = CrystalDecisions.Windows.Forms.ToolPanelViewType.None;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
开发者ID:Anshul0305,项目名称:lotas,代码行数:54,代码来源:Form_DoctorPaymentReport.cs

示例9: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            Label1.Text = Session["uname"].ToString();
            ReportDocument cryRpt = new ReportDocument();
            cryRpt.Load(Server.MapPath("SoldProduct.rpt"));

            /*    ParameterFieldDefinitions PFDS;
                ParameterFieldDefinition PFD;
                ParameterValues PVS = new ParameterValues();
                ParameterDiscreteValue PDV = new ParameterDiscreteValue();
                PVS.Clear();
                PDV.Value = "";
                PFDS = cryRpt.DataDefinition.ParameterFields;
                PFD = PFDS["@sDate"];
                PVS = PFD.CurrentValues;
                //
                PVS.Add(PDV);
                PFD.ApplyCurrentValues(PVS);

                PDV.Value = "";
                PFDS = cryRpt.DataDefinition.ParameterFields;
                PFD = PFDS["@eDate"];
                PVS = PFD.CurrentValues;
                //PVS.Clear();
                PVS.Add(PDV);
                PFD.ApplyCurrentValues(PVS);*/

            cryRpt.SetDatabaseLogon("sa", "123", "server", "auction");
            CrystalReportViewer1.ReportSource = cryRpt;
            CrystalReportViewer1.RefreshReport();
        }
开发者ID:Dashboard-X,项目名称:EcommercePortals,代码行数:31,代码来源:SoldProduct.aspx.cs

示例10: CriaPDF

        protected void CriaPDF()
        {
            Hashtable hash = (Hashtable)Session["HashVagasDisponivel"];

            //CrystalReportViewer_AgendaPrestador.DisplayToolbar = true;
            //CrystalReportViewer_AgendaPrestador.EnableDatabaseLogonPrompt = false;

            DSRelatorioVagasDisponivel conteudo = new DSRelatorioVagasDisponivel();
            conteudo.Tables.Add((DataTable)hash["corpo"]);

            ReportDocument repDoc = new ReportDocument();
            repDoc.Load(Server.MapPath("RelatoriosCrystal/CrystalReportViewer_VagasDisponivel.rpt"));
            repDoc.SetDataSource(conteudo.Tables[1]);

            //repDoc.Database.Tables["CabecalhoAgendaPrestador"].SetDataSource((DataTable)hash["cabecalho"]);
            //repDoc.Database.Tables["RelatorioAgendaPrestador"].SetDataSource((DataTable)hash["corpo"]);

            System.IO.Stream s = repDoc.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
            Response.ClearContent();
            Response.ClearHeaders();
            Response.ContentType = "applicattion/octect-stream";
            Response.AddHeader("Content-Disposition", "attachment;filename=RelatorioVagasDisponivel.pdf");
            Response.AddHeader("Content-Length", s.Length.ToString());
            Response.BinaryWrite(((System.IO.MemoryStream)s).ToArray());
            Response.End();
        }
开发者ID:vivermais,项目名称:vivermais,代码行数:26,代码来源:RelatorioVagas.aspx.cs

示例11: CriaPDF

        private void CriaPDF()
        {
            Hashtable hashtable = (Hashtable)Session["HashAgendaMontadaPublicada"];

            DSCabecalhoAgendaMontadaPublicada cabecalho = new DSCabecalhoAgendaMontadaPublicada();
            cabecalho.Tables.Add((DataTable)hashtable["cabecalho"]);

            DSRelatorioAgendaMontadaPublicada dados = new DSRelatorioAgendaMontadaPublicada();
            dados.Tables.Add((DataTable)hashtable["dados"]);

            ReportDocument repDoc = new ReportDocument();

            repDoc.Load(Server.MapPath("RelatoriosCrystal/CrystalReportViewer_AgendaMontadaPublicada.rpt"));
            repDoc.SetDataSource(dados.Tables[1]);
            repDoc.Subreports["CrystalReportViewer_CabecalhoAgendaMontadaPublicada.rpt"].SetDataSource(cabecalho.Tables[1]);

            System.IO.Stream s = repDoc.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
            Response.ClearContent();
            Response.ClearHeaders();
            Response.ContentType = "applicattion/octect-stream";
            Response.AddHeader("Content-Disposition", "attachment;filename=RelatorioDeAgendasMontadasPublicadas.pdf");
            Response.AddHeader("Content-Length", s.Length.ToString());
            Response.BinaryWrite(((System.IO.MemoryStream)s).ToArray());
            Response.End();

            Session.Remove("HashAgendaMontadaPublicada");
        }
开发者ID:vivermais,项目名称:vivermais,代码行数:27,代码来源:RelatorioAgendaMontadaPublicada.aspx.cs

示例12: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                ReportDocument rd;
                rd = new ReportDocument();
            rd.Load(@"C:\Users\PLABON\Documents\Visual Studio 2013\Projects\SalesAndInventorySystem\SalesAndInventorySystemUI\Report\a.rpt");
            List<PersonType> company = companyGateway.GetCompanies();
            var companyX = company.Select(x => new {x.ID, x.Name});
            rd.SetDataSource(companyX);
            crystalReportViewer1.ReportSource = rd;

            crystalReportViewer1.Refresh();
                int a = 10;
            if (File.Exists(@"D:\" + "AAAA" + a  +".pdf"))
                File.Delete(@"D:\" + a++ + ".pdf");
            rd.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, @"D:\" + a + ".pdf");

            }
            catch (Exception)
            {

                throw;
            }
        }
开发者ID:manjurul-cse,项目名称:Sales-And-Inventory-System,代码行数:25,代码来源:Form1.cs

示例13: GenerateWord

		private void GenerateWord()
		{
            ReportDocument rpt = new ReportDocument();
            rpt.Load(Server.MapPath(Constants.ROOT_DIRECTORY + "/Reports/GeneralLedger.rpt"));

			ExportOptions exportop = new ExportOptions();
			DiskFileDestinationOptions dest = new DiskFileDestinationOptions();
			
			string strPath = Server.MapPath(@"\retailplus\temp\");

			string strFileName = "generalledger_" + Session["UserName"].ToString() + "_" + DateTime.Now.ToString("yyyyMMddhhmmssff") + ".doc";
			if (System.IO.File.Exists(strPath + strFileName))
				System.IO.File.Delete(strPath + strFileName);

			dest.DiskFileName = strPath + strFileName;

			exportop = rpt.ExportOptions;
	
			SetDataSource(rpt);

			exportop.DestinationOptions = dest;
			exportop.ExportDestinationType = ExportDestinationType.DiskFile;
			exportop.ExportFormatType = ExportFormatType.WordForWindows;
			rpt.Export();   rpt.Close();    rpt.Dispose();
			
			fraViewer.Attributes.Add("src","/retailplus/temp/" + strFileName);
		}
开发者ID:marioricci,项目名称:erp-luma,代码行数:27,代码来源:_GeneralLedger.ascx.cs

示例14: frminhoadon_Load

 private void frminhoadon_Load(object sender, EventArgs e)
 {
     DataTable ds = hdbus.getHoaDon(KHAIBAO.mabenhnhan, KHAIBAO.ngaykham);
     ds.TableName = "HoaDon";
     DataTable dt2 = ctkbus.getDonThuoc(KHAIBAO.mabenhnhan + KHAIBAO.ngaykham);
     dt2.TableName = "DonThuoc";
     DataTable dt3 = cdbus.getCachDung();
     dt3.TableName = "CachDung";
     DataTable dt4 = ltbus.getLoaiThuoc();
     dt4.TableName = "LoaiThuoc";
     DataTable dt5 = dvbus.getDonVi();
     dt5.TableName = "DonVi";
     DataSet dts = new DataSet();
     dts.Tables.Add(ds);
     dts.Tables.Add(dt2);
     dts.Tables.Add(dt3);
     dts.Tables.Add(dt4);
     dts.Tables.Add(dt5);
     if (float.Parse(ds.Rows[0]["TienThuoc"].ToString()) == 0)
     {
         ReportDocument report = new ReportDocument();
         report.Load("..\\..\\inhoadon1.rpt");
         report.SetDataSource(dts);
         crystalReportViewer.ReportSource = report;
         inhoadon1 dt = new inhoadon1();
     }
     else
     {
         ReportDocument report = new ReportDocument();
         report.Load("..\\..\\inhoadon.rpt");
         report.SetDataSource(dts);
         crystalReportViewer.ReportSource = report;
         inhoadon dt = new inhoadon();
     }
 }
开发者ID:tuanva90,项目名称:qlphongmach4,代码行数:35,代码来源:frminhoadon.cs

示例15: ConfigureCrystalReports

    /// <summary>
    /// 產生報表
    /// </summary>
    private void ConfigureCrystalReports()
    {
        try
        {
            string strDate = Session[string.Format("{0}QueryDateRange", Request["TimeStamp"].ToString())].ToString();
            if (strDate == "~") strDate = "";
            string strTime = Session[string.Format("{0}QueryTimeRange", Request["TimeStamp"].ToString())].ToString();
            if (strTime == "~") strTime = "";
            customerReport = new ReportDocument();

            //取得報表格式檔RPT
            customerReport.Load(Server.MapPath("ITM061R.rpt"));
            customerReport.SetDataSource((DataTable)Session[string.Format("{0}ITM061", Request["TimeStamp"].ToString())]);
            ParameterFields par1 = new ParameterFields();
            AddParameter("ProgramName", PageProgramName, par1);
            ParameterFields par2 = new ParameterFields();
            AddParameter("UserName", Session["UID"].ToString(), par2);
            ParameterFields par3 = new ParameterFields();
            AddParameter("QueryDateRange", strDate, par3);
            ParameterFields par4 = new ParameterFields();
            AddParameter("QueryTime", strTime, par4);
            CRV1.ParameterFieldInfo.Add(par1[0]);
            CRV1.ParameterFieldInfo.Add(par2[0]);
            CRV1.ParameterFieldInfo.Add(par3[0]);
            CRV1.ParameterFieldInfo.Add(par4[0]);
            CRV1.ReportSource = customerReport;
        }
        catch (Exception ex)
        {
            lblErrorMessage.Text = ex.Message;
        }
    }//ConfigureCrystalReports
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:35,代码来源:ITM061R.aspx.cs


注:本文中的ReportDocument.Load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。