• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Engine.ReportDocument类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



ReportDocument类属于CrystalDecisions.CrystalReports.Engine命名空间,在下文中一共展示了ReportDocument类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: cmdLoad_Click

        private void cmdLoad_Click(System.Object eventSender, System.EventArgs eventArgs)
        {
            ADODB.Recordset rs = default(ADODB.Recordset);
            ADODB.Recordset rsData = default(ADODB.Recordset);
            //Dim Report As New cryItemGroupCompare
            //ReportNone.Load("cryNoRecords.rpt")
            CrystalDecisions.CrystalReports.Engine.ReportDocument Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            CrystalDecisions.CrystalReports.Engine.ReportDocument ReportNone = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            Report.Load("cryItemGroupCompare.rpt");
            ReportNone.Load("cryNoRecords");
            modReport.cnnDBreport.Execute("DELETE LinkItem.* FROM LinkItem;");
            rs = modReport.getRSreport(ref "SELECT * FROM Link Where LinkID=1 AND Link_SectionID=1");
            modReport.cnnDBreport.Execute("INSERT INTO LinkItem ( LinkItem_LinkID, LinkItem_DayEndID, LinkItem_Value ) SELECT 1, DayEndStockItemLnk.DayEndStockItemLnk_DayEndID, DayEndStockItemLnk.DayEndStockItemLnk_QuantitySales FROM DayEndStockItemLnk INNER JOIN aStockItem ON DayEndStockItemLnk.DayEndStockItemLnk_StockItemID = aStockItem.StockItemID WHERE " + rs.Fields("Link_SQL").Value + ";");
            rs = modReport.getRSreport(ref "SELECT * FROM Link Where LinkID=2 AND Link_SectionID=1");
            modReport.cnnDBreport.Execute("INSERT INTO LinkItem ( LinkItem_LinkID, LinkItem_DayEndID, LinkItem_Value ) SELECT 2, DayEndStockItemLnk.DayEndStockItemLnk_DayEndID, Sum(DayEndStockItemLnk.DayEndStockItemLnk_QuantitySales) AS SumOfDayEndStockItemLnk_QuantitySales FROM DayEndStockItemLnk INNER JOIN aStockItem ON DayEndStockItemLnk.DayEndStockItemLnk_StockItemID = aStockItem.StockItemID " + rs.Fields("Link_SQL").Value + " GROUP BY DayEndStockItemLnk.DayEndStockItemLnk_DayEndID;");

            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
            rs = modReport.getRSreport(ref "SELECT Report.Report_Heading, aCompany.Company_Name FROM aCompany, Report;");
            Report.SetParameterValue("txtCompanyName", rs.Fields("Company_Name"));
            Report.SetParameterValue("txtDayEnd", rs.Fields("Report_Heading"));
            rs.Close();
            rs = modReport.getRSreport(ref "SELECT Link.* From Link Where (((Link.Link_SectionID) = 1)) ORDER BY Link.Link_SectionID;");
            if (rs.BOF | rs.EOF) {
                ReportNone.SetParameterValue("txtCompanyName", Report.ParameterFields("txtCompanyName").ToString);
                ReportNone.SetParameterValue("txtTitle", Report.ParameterFields("txtTitle").ToString);
                My.MyProject.Forms.frmReportShow.Text = ReportNone.ParameterFields("txtTitle").ToString;
                My.MyProject.Forms.frmReportShow.CRViewer1.ReportSource = ReportNone;
                My.MyProject.Forms.frmReportShow.mReport = ReportNone;
                My.MyProject.Forms.frmReportShow.sMode = "0";
                My.MyProject.Forms.frmReportShow.CRViewer1.Refresh();
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
                My.MyProject.Forms.frmReportShow.ShowDialog();
                return;
            }
            rsData = modReport.getRSreport(ref "SELECT LinkItem.*, Format([DayEnd_Date],'ddd dd mmm\", \"yyyy') AS dateName, DayEnd.DayEnd_Date FROM DayEnd INNER JOIN LinkItem ON DayEnd.DayEndID = LinkItem.LinkItem_DayEndID;");
            if (rsData.BOF | rsData.EOF) {
                ReportNone.SetParameterValue("txtCompanyName", Report.ParameterFields("txtCompanyName").ToString);
                ReportNone.SetParameterValue("txtTitle", Report.ParameterFields("txtTitle").ToString);
                My.MyProject.Forms.frmReportShow.Text = ReportNone.ParameterFields("txtTitle").ToString;
                My.MyProject.Forms.frmReportShow.CRViewer1.ReportSource = ReportNone;
                My.MyProject.Forms.frmReportShow.mReport = ReportNone;
                My.MyProject.Forms.frmReportShow.sMode = "0";
                My.MyProject.Forms.frmReportShow.CRViewer1.Refresh();
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
                My.MyProject.Forms.frmReportShow.ShowDialog();
                return;
            }

            Report.Database.Tables(1).SetDataSource(rs);
            Report.Database.Tables(2).SetDataSource(rsData);
            //Report.VerifyOnEveryPrint = True
            My.MyProject.Forms.frmReportShow.Text = Report.ParameterFields("txtTitle").ToString;
            My.MyProject.Forms.frmReportShow.CRViewer1.ReportSource = Report;
            My.MyProject.Forms.frmReportShow.mReport = Report;
            My.MyProject.Forms.frmReportShow.sMode = "0";
            My.MyProject.Forms.frmReportShow.CRViewer1.Refresh();
            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            My.MyProject.Forms.frmReportShow.ShowDialog();
        }
开发者ID:nodoid,项目名称:PointOfSale,代码行数:59,代码来源:frmItemGroup.cs


示例2: frmPrinter

        public frmPrinter(DataTable dtDatos, CrystalDecisions.CrystalReports.Engine.ReportDocument oReporte, string cTitulo)
        {
            _Datos = dtDatos;
            _Reporte = oReporte;
            _Titulo = cTitulo;

            InitializeComponent();
        }
开发者ID:faustorichardson,项目名称:ardcombustible,代码行数:8,代码来源:frmPrinter.cs


示例3: frmPrintPreview

        // private Logger log;
        public frmPrintPreview(string FormTitle, CrystalDecisions.CrystalReports.Engine.ReportDocument RptDoc, bool pv_bSetContent, bool pv_bDisplayPrintButton)
            : base()
        {
            //This call is required by the Windows Form Designer.
            InitializeComponent();
            log = LogManager.GetCurrentClassLogger();
            //Add any initialization after the InitializeComponent() call
            this.Text = FormTitle;
            this.RptDoc = RptDoc;
            cmdTrinhKy.Visible = pv_bSetContent;
            mv_bSetContent = pv_bSetContent;
            this.crptViewer.ShowRefreshButton = false;
            this.crptViewer.ShowPrintButton = pv_bDisplayPrintButton;

            txtCopyPage.LostFocus += new EventHandler(txtSoCopyPage_LostFocus);
            InitializeEvents();

            CauHinh();
        }
开发者ID:vmshis2015,项目名称:VMSPharmacy,代码行数:20,代码来源:frmPrintPreview.cs


示例4: creaReporte

        private ReportDocument creaReporte(string archivoReporte)
        {
            CrystalDecisions.CrystalReports.Engine.ReportDocument Rpt1 = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

            //  ======  Seleccion del reporte
            switch (archivoReporte)
            {
                case "Solicitud":
                    {
                        Rpt1 =  new SOPORTEC.Reportes.Solicitud();
                        break;
                    }
                //case "equipoS":
                //    {
                //        Rpt1 = new Reportes.solicitudes() ;
                //        break;
                //    }
            }
            return Rpt1;
        }
开发者ID:mchevez,项目名称:pruebagithub,代码行数:20,代码来源:cReportes.cs


示例5: frmPrintPreview

 // private Logger log;
  public frmPrintPreview(string FormTitle, CrystalDecisions.CrystalReports.Engine.ReportDocument RptDoc, bool pv_bSetContent,bool pv_bDisplayPrintButton,string TitleReport)
      : base()
  {
      
      //This call is required by the Windows Form Designer.
      InitializeComponent();
      log = LogManager.GetCurrentClassLogger();
      Utility.loadIconToForm(this);
      //Add any initialization after the InitializeComponent() call
      this.Text = FormTitle;
      this.RptDoc = RptDoc;
      this.sTIEUDE = TitleReport;
      
      this.crptViewer.ReportSource = this.RptDoc;
      cmdTrinhKy.Visible = pv_bSetContent;
      mv_bSetContent = pv_bSetContent;
      this.crptViewer.ShowRefreshButton = false;
      this.crptViewer.ShowPrintButton = pv_bDisplayPrintButton;
      InitializeEvents();
      sTIEUDE = new cls_SignInfor().SetTieuDe(RptDoc.ToString(), sTIEUDE);
    
  }
开发者ID:khaha2210,项目名称:radio,代码行数:23,代码来源:frmPrintPreview.cs


示例6: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            DataSet ds = new DataSet();
            DataTable dt = new DataTable();
            crvReporte.Visible = true;
            string fechainicial = Request.QueryString["fechainicial"].ToString();
            string fechafinal = Request.QueryString["fechafinal"].ToString();
            string idsede = Request.QueryString["idsede"].ToString();
            string idproyecto = Request.QueryString["idproyecto"].ToString();
            string idestado = Request.QueryString["idestado"].ToString();

            ds = objPedidoDAO.ListarReportePedidos(AppUtilidad.stringToDateTime(fechainicial, "DD/MM/YYYY"),
                                                   AppUtilidad.stringToDateTime(fechafinal, "DD/MM/YYYY"),
                                                   Convert.ToInt32(idsede),
                                                   Convert.ToInt32(idproyecto),
                                                   idestado);

            dt = ds.Tables[0];
            CrystalDecisions.CrystalReports.Engine.ReportDocument rDoc;
            rDoc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            rDoc.Load(Server.MapPath("rptReportePedidos.rpt")); // Your .rpt file path
            rDoc.SetDataSource(dt); //set dataset to the report viewer.
            rDoc.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, false, "Listado");
        }
开发者ID:jtomaylla,项目名称:AppWeb,代码行数:24,代码来源:rptReportePedidos1.aspx.cs


示例7: LoadCrystalReport

    private void LoadCrystalReport(string s_FileName, string s_rptFilePath, DataTable dt_Source, string reportFormatType)
    {
        CrystalDecisions.CrystalReports.Engine.ReportDocument report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

        report.Load(s_rptFilePath);
        report.SetDataSource(dt_Source);



        //判斷輸出檔案型態
        switch (reportFormatType)
        {
            case "EXCEL":

                System.IO.Stream streamXLS = report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.Excel);
                byte[] bytesXLS = new byte[streamXLS.Length];
                streamXLS.Read(bytesXLS, 0, bytesXLS.Length);
                streamXLS.Seek(0, System.IO.SeekOrigin.Begin);

                //export file  
                Response.ClearContent();
                Response.ClearHeaders();
                Response.AddHeader("content-disposition", "attachment;filename=" + s_FileName);//excel檔名  


                Response.ContentType = "application/vnd.ms-excel";


                Response.OutputStream.Write(bytesXLS, 0, bytesXLS.Length);
                Response.Flush();
                Response.Close();

                break;
            case "PDF":

                string s_par_Program_ID = string.Empty;
                string s_par_LoginUser = string.Empty;

                s_par_Program_ID = this.PageCode;
                s_par_LoginUser = Session["UID"].ToString();


                System.IO.Stream streamPDF = report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                byte[] bytesPDF = new byte[streamPDF.Length];
                streamPDF.Read(bytesPDF, 0, bytesPDF.Length);
                streamPDF.Seek(0, System.IO.SeekOrigin.Begin);

                //export file  
                Response.ClearContent();
                Response.ClearHeaders();
                Response.AddHeader("content-disposition", "attachment;filename=" + s_FileName);//excel檔名  
                Response.ContentType = "application/pdf";
                Response.OutputStream.Write(bytesPDF, 0, bytesPDF.Length);
                Response.Flush();
                Response.Close();
                break;
            default:

                break;
        }

    }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:62,代码来源:SYS17A.aspx.cs


示例8: LoadCrystalReport

    /// <summary>
    /// 利用 CrystalReport 列印 Excel 報表
    /// </summary>
    /// <param name="s_FileName">Excel報表的檔名</param>
    /// <param name="s_rptFilePath">rpt檔的路徑</param>
    /// <param name="dt_Source">要列印的資料</param>
    /// /// <param name="reportFormatType">檔案型態</param>
    private void LoadCrystalReport(string s_FileName, string s_rptFilePath, DataTable dt_Source, string reportFormatType)
    {
        CrystalDecisions.CrystalReports.Engine.ReportDocument report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

        report.Load(s_rptFilePath);
        report.SetDataSource(dt_Source);


        string par_ChanNo = string.Empty;
        string par_Store = string.Empty;

        #region 前置檢查與參數過濾

        par_ChanNo = Server.UrlDecode(Request.QueryString["Chan"].ToString());
        par_Store = Server.UrlDecode(Request.QueryString["Store"].ToString());
        #endregion


        #region 組合查詢條件至ArrayList

        ArrayList returnList = new ArrayList();

        returnList.Clear();

        report.SetParameterValue("ChanNo", par_ChanNo);
        report.SetParameterValue("Store", par_Store);

        #endregion


        //判斷輸出檔案型態
        switch (reportFormatType)
        {
            case "EXCEL":

                System.IO.Stream streamXLS = report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.Excel);
                byte[] bytesXLS = new byte[streamXLS.Length];
                streamXLS.Read(bytesXLS, 0, bytesXLS.Length);
                streamXLS.Seek(0, System.IO.SeekOrigin.Begin);

                //export file  
                Response.ClearContent();
                Response.ClearHeaders();
                Response.AddHeader("content-disposition", "attachment;filename=" + s_FileName);//excel檔名  


                Response.ContentType = "application/vnd.ms-excel";


                Response.OutputStream.Write(bytesXLS, 0, bytesXLS.Length);
                Response.Flush();
                Response.Close();
                report.Close();
                break;
            case "PDF":


                System.IO.Stream streamPDF = report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                byte[] bytesPDF = new byte[streamPDF.Length];
                streamPDF.Read(bytesPDF, 0, bytesPDF.Length);
                streamPDF.Seek(0, System.IO.SeekOrigin.Begin);

                //export file  
                Response.ClearContent();
                Response.ClearHeaders();
                Response.AddHeader("content-disposition", "attachment;filename=" + s_FileName);//excel檔名  
                Response.ContentType = "application/pdf";
                Response.OutputStream.Write(bytesPDF, 0, bytesPDF.Length);
                Response.Flush();
                Response.Close();
                report.Close();

                break;
            default:

                break;
        }

    }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:86,代码来源:POP_VGR024_2.aspx.cs


示例9: ShowReport

    /// <summary>
    /// 顯示報表
    /// </summary>
    private void ShowReport(DataSet ds)
    {
        #region 利用CrystalReport列印報表

        //使用者名稱
        DataTable dt1 = new DataTable();
        dt1 = (DataTable)Session["UserInfo"];
        string Login_Name = dt1.Rows[0]["Name"].ToString();
        string strFileName = "";

        CrystalDecisions.CrystalReports.Engine.ReportDocument report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
        ReportDocument SubReport = new ReportDocument();

        report.Load(Server.MapPath("./REPORT/CAA271/CAA27R01.rpt"));
        strFileName = HttpUtility.UrlEncode("結帳與開立憑證檢核表.PDF", System.Text.Encoding.UTF8);

        SubReport = report.OpenSubreport("CAA27R01_1");
        SubReport.SetDataSource(ds);

        report.SetDataSource(ds);

        report.SetParameterValue("par_Program_ID", "CAA27R01");
        report.SetParameterValue("par_LoginUser", Session["UID"].ToString() + Login_Name);

        System.IO.Stream streamPDF = report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
        byte[] bytesPDF = new byte[streamPDF.Length];
        streamPDF.Read(bytesPDF, 0, bytesPDF.Length);
        streamPDF.Seek(0, System.IO.SeekOrigin.Begin);

        //export file  
        Response.ClearContent();
        Response.ClearHeaders();
        Response.AddHeader("content-disposition", "attachment;filename=" + strFileName);//pdf檔名  
        Response.ContentType = "application/pdf";
        Response.OutputStream.Write(bytesPDF, 0, bytesPDF.Length);
        Response.Flush();
        Response.Close();
        report.Close();
        #endregion
    }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:43,代码来源:CAA271.aspx.cs


示例10: LoadCrystalReport

    /// <summary>
    /// 利用 CrystalReport 列印 Excel 報表
    /// </summary>
    /// <param name="s_FileName">Excel報表的檔名</param>
    /// <param name="s_rptFilePath">rpt檔的路徑</param>
    /// <param name="dt_Source">要列印的資料</param>
    /// /// <param name="reportFormatType">檔案型態</param>
    private void LoadCrystalReport(string s_FileName, string s_rptFilePath, DataTable dt_Source, string reportFormatType)
    {
        CrystalDecisions.CrystalReports.Engine.ReportDocument report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

        report.Load(s_rptFilePath);
        report.SetDataSource(dt_Source);

        string par_ProgramID = string.Empty;
        string par_LoginUser = string.Empty;

        DropDownList ReasonS = (DropDownList)this.SLP_CodeFileS.FindControl("D1");
        DropDownList ReasonE = (DropDownList)this.SLP_CodeFileE.FindControl("D1");

        string[] fileds ={ "STORE" };
        DataTable Dt = SelectDistinct(dt_Source, fileds);

        #region 前置檢查與參數過濾

        string par_S_PDate = this.SLP_SLPDateRangeOut.StartDate;
        string par_E_PDate = this.SLP_SLPDateRangeOut.EndDate;
        string par_S_ChanNo = this.SLP_StoreChainS.Text + " " + this.SLP_StoreChainS.Name;
        string par_E_ChanNo = this.SLP_StoreChainE.Text + " " + this.SLP_StoreChainE.Name;
        string par_AcceptDate = this.SLP_SLPDate.Text;
        string par_S_Route = this.SLP_RouteS.Text + " " + this.SLP_RouteS.Name;
        string par_E_Route = this.SLP_RouteE.Text + " " + this.SLP_RouteE.Name;
        string par_S_ReasonNo = ReasonS.SelectedValue + " " + ReasonS.SelectedItem.Text;
        string par_E_ReasonNo = ReasonE.SelectedValue + " " + ReasonE.SelectedItem.Text;
        string par_S_Store = this.SLP_StoreS.Text + " " + this.SLP_StoreS.Name;
        string par_E_Store = this.SLP_StoreE.Text + " " + this.SLP_StoreE.Name;
        par_ProgramID = this.PageCode;
        par_LoginUser = Session["UID"].ToString();

        string par_STORE_CNT = Dt.Rows.Count.ToString();

        #endregion

        #region 組合查詢條件至ArrayList

        ArrayList returnList = new ArrayList();

        returnList.Clear();

        report.SetParameterValue("par_S_PDate", par_S_PDate);
        report.SetParameterValue("par_E_PDate", par_E_PDate);
        report.SetParameterValue("par_S_ChanNo", par_S_ChanNo);
        report.SetParameterValue("par_E_ChanNo", par_E_ChanNo);
        report.SetParameterValue("par_AcceptDate", par_AcceptDate);
        report.SetParameterValue("par_S_Route", par_S_Route);
        report.SetParameterValue("par_E_Route", par_E_Route);
        report.SetParameterValue("par_S_ReasonNo", par_S_ReasonNo);
        report.SetParameterValue("par_E_ReasonNo", par_E_ReasonNo);
        report.SetParameterValue("par_S_Store", par_S_Store);
        report.SetParameterValue("par_E_Store", par_E_Store);

        report.SetParameterValue("par_ProgramID", par_ProgramID);
        report.SetParameterValue("par_LoginUser", par_LoginUser);

        report.SetParameterValue("par_STORE_CNT", par_STORE_CNT);

        #endregion

        //判斷輸出檔案型態
        switch (reportFormatType)
        {
            case "EXCEL":

                System.IO.Stream streamXLS = report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.Excel);
                byte[] bytesXLS = new byte[streamXLS.Length];
                streamXLS.Read(bytesXLS, 0, bytesXLS.Length);
                streamXLS.Seek(0, System.IO.SeekOrigin.Begin);

                //export file  
                Response.ClearContent();
                Response.ClearHeaders();
                Response.AddHeader("content-disposition", "attachment;filename=" + s_FileName);//excel檔名  
                Response.ContentType = "application/vnd.ms-excel";
                Response.OutputStream.Write(bytesXLS, 0, bytesXLS.Length);
                Response.Flush();
                Response.Close();

                break;
            case "PDF":

                System.IO.Stream streamPDF = report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                byte[] bytesPDF = new byte[streamPDF.Length];
                streamPDF.Read(bytesPDF, 0, bytesPDF.Length);
                streamPDF.Seek(0, System.IO.SeekOrigin.Begin);

                //export file  
                Response.ClearContent();
                Response.ClearHeaders();
                Response.AddHeader("content-disposition", "attachment;filename=" + s_FileName);//excel檔名  
                Response.ContentType = "application/pdf";
//.........这里部分代码省略.........
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:101,代码来源:CGR071.aspx.cs


示例11: LoadCrystalReport

    /// <summary>
    /// 利用 CrystalReport 列印 Excel 報表
    /// </summary>
    /// <param name="s_FileName">Excel報表的檔名</param>
    /// <param name="s_rptFilePath">rpt檔的路徑</param>
    /// <param name="dt_Source">要列印的資料</param>
    /// /// <param name="reportFormatType">檔案型態</param>
    private void LoadCrystalReport(string s_FileName, string s_rptFilePath, DataTable dt_Source, string reportFormatType)
    {
        CrystalDecisions.CrystalReports.Engine.ReportDocument report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

        report.Load(s_rptFilePath);
        report.SetDataSource(dt_Source);


        string par_ProgramID = string.Empty;
        string par_LoginUser = string.Empty;

        #region 前置檢查與參數過濾

        string par_S_PDate = this.SLP_SLPDateRange.StartDate;
        string par_E_PDate = this.SLP_SLPDateRange.EndDate;
        string par_BatchNo = this.txtBatchNo.Text;
        string par_ChanNo = this.SLP_StoreChain.Text + " " + this.SLP_StoreChain.Name;
        string par_ChanSourceNo = this.txtChanSourceNo.Text;
        string par_S_SignDate = this.SLP_SignDate.StartDate;
        string par_E_SignDate = this.SLP_SignDate.EndDate;
        string par_Item = this.SLP_SKU.Text + " " + this.SLP_SKU.Name;
        string par_Period = this.SLP_ItemPeriod.Text + " " + this.SLP_ItemPeriod.Name;
        string par_ItemMap = this.txtItemMap.Text;

        par_ProgramID = this.PageCode;
        par_LoginUser = Session["UID"].ToString();
        #endregion


        #region 組合查詢條件至ArrayList

        ArrayList returnList = new ArrayList();

        returnList.Clear();

        report.SetParameterValue("par_S_PDate", par_S_PDate);
        report.SetParameterValue("par_E_PDate", par_E_PDate);
        report.SetParameterValue("par_BatchNo", par_BatchNo);
        report.SetParameterValue("par_ChanNo", par_ChanNo);
        report.SetParameterValue("par_ChanSourceNo", par_ChanSourceNo);
        report.SetParameterValue("par_S_SignDate", par_S_SignDate);
        report.SetParameterValue("par_E_SignDate", par_E_SignDate);
        report.SetParameterValue("par_Item", par_Item);
        report.SetParameterValue("par_Period", par_Period);
        report.SetParameterValue("par_ItemMap", par_ItemMap);

        report.SetParameterValue("par_ProgramID", par_ProgramID);
        report.SetParameterValue("par_LoginUser", par_LoginUser);
        #endregion

        //判斷輸出檔案型態
        switch (reportFormatType)
        {
            case "EXCEL":

                System.IO.Stream streamXLS = report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.Excel);
                byte[] bytesXLS = new byte[streamXLS.Length];
                streamXLS.Read(bytesXLS, 0, bytesXLS.Length);
                streamXLS.Seek(0, System.IO.SeekOrigin.Begin);

                //export file  
                Response.ClearContent();
                Response.ClearHeaders();
                Response.AddHeader("content-disposition", "attachment;filename=" + s_FileName);//excel檔名  

                Response.ContentType = "application/vnd.ms-excel";

                Response.OutputStream.Write(bytesXLS, 0, bytesXLS.Length);
                Response.Flush();
                Response.Close();

                break;
            case "PDF":
                System.IO.Stream streamPDF = report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                byte[] bytesPDF = new byte[streamPDF.Length];
                streamPDF.Read(bytesPDF, 0, bytesPDF.Length);
                streamPDF.Seek(0, System.IO.SeekOrigin.Begin);

                //export file  
                Response.ClearContent();
                Response.ClearHeaders();
                Response.AddHeader("content-disposition", "attachment;filename=" + s_FileName);//excel檔名  
                Response.ContentType = "application/pdf";
                Response.OutputStream.Write(bytesPDF, 0, bytesPDF.Length);
                Response.Flush();
                Response.Close();
                break;
            default:

                break;
        }

    }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:100,代码来源:VGR051.aspx.cs


示例12: ShowReport

    /// <summary>
    /// 產生報表
    /// </summary>
    /// <param name="dt">DataTable資料</param>
    /// <param name="exp_type">產生PDF或Excel</param>
    private void ShowReport(DataTable dt, string exp_type)
    {
        try
        {
            CrystalDecisions.CrystalReports.Engine.ReportDocument report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

            report.Load(Server.MapPath("./REPORT/VAM111/VAM11R.rpt"));
            report.SetDataSource(dt);

            DataTable dt1 = new DataTable();
            dt1 = (DataTable)Session["UserInfo"];
            string Login_Name = dt1.Rows[0]["Name"].ToString();

            //CrystalReport Parameter 參數設定
            string Program_ID = string.Empty;
            string LoginUser = string.Empty;

            string strParFDate = string.Empty;
            string strParFSType = string.Empty;
            string strParFTaxType = string.Empty;

            Program_ID = this.PageCode + "R";
            LoginUser = Session["UID"].ToString();

            string V_REPORT_TYPE = ""; //資料選擇
            if (rdoType1.Checked) V_REPORT_TYPE = "全部";
            if (rdoType2.Checked) V_REPORT_TYPE = "廠商進貨";
            if (rdoType3.Checked) V_REPORT_TYPE = "廠商退貨";
            report.SetParameterValue("par_Program_ID", Program_ID);
            report.SetParameterValue("par_LoginUser", LoginUser);
            report.SetParameterValue("par_LoginName", Login_Name);
            string inDate = (SLP_SLPDateRange.StartDate + ((SLP_SLPDateRange.StartDate.Length == 0 && SLP_SLPDateRange.EndDate.Length == 0) ? "" : "~") + SLP_SLPDateRange.EndDate);
            if (inDate == "") inDate = "全部";
            report.SetParameterValue("par_Date", "進/退貨日期:" + inDate);

            //string vendor1 = ((TextBox)((ASP.vdm_slp_slp_vendorbase_ascx)SLP_VendorBase1).FindControl("TextBoxName")).Text;
            string vendor1 = GetVendorName(SLP_VendorBase1.Text.Trim());
            //string vendor2 = ((TextBox)((ASP.vdm_slp_slp_vendorbase_ascx)SLP_VendorBase2).FindControl("TextBoxName")).Text;
            string vendor2 = GetVendorName(SLP_VendorBase2.Text.Trim());

            if (SLP_VendorBase1.Text.Trim().Length != 0 && vendor1 == "") vendor1 = Page.Request.Form[((TextBox)((ASP.vdm_slp_slp_vendorbase_ascx)SLP_VendorBase1).FindControl("TextBoxName")).UniqueID];

            if (SLP_VendorBase2.Text.Trim().Length != 0 && vendor2 == "") vendor2 = Page.Request.Form[((TextBox)((ASP.vdm_slp_slp_vendorbase_ascx)SLP_VendorBase2).FindControl("TextBoxName")).UniqueID];

            string vendor = (SLP_VendorBase1.Text + vendor1 + ((SLP_VendorBase1.Text.Trim().Length == 0 && SLP_VendorBase2.Text.Trim().Length == 0) ? "" : "~") + SLP_VendorBase2.Text + vendor2);
            if (SLP_VendorBase1.Text.Trim().Length == 0 && SLP_VendorBase2.Text.Trim().Length == 0) vendor = "全部";
            report.SetParameterValue("par_Vendor", "供應商:" + vendor);
            report.SetParameterValue("par_Tax", "課稅別:" + ((DropDownList)SLP_EnumBase.FindControl("D1")).SelectedItem.Text);
            report.SetParameterValue("par_Type", "資料選擇:" + V_REPORT_TYPE);

            //檔案匯出
            if (exp_type == "btnExport")
            {
                System.IO.Stream streamXLS = report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.Excel);
                byte[] bytesXLS = new byte[streamXLS.Length];
                streamXLS.Read(bytesXLS, 0, bytesXLS.Length);
                streamXLS.Seek(0, System.IO.SeekOrigin.Begin);
                //Export File  
                Response.ClearContent();
                Response.ClearHeaders();
                string rpt_name = "供應商暫估貨款明細表.xls";
                Response.AddHeader("content-disposition", "attachment;filename=" + HttpUtility.UrlEncode(rpt_name, System.Text.Encoding.UTF8));//匯出檔名  
                Response.ContentType = "application/vnd.ms-excel";
                Response.OutputStream.Write(bytesXLS, 0, bytesXLS.Length);
            }
            else
            {
                System.IO.Stream streamPDF = report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
                byte[] bytesPDF = new byte[streamPDF.Length];
                streamPDF.Read(bytesPDF, 0, bytesPDF.Length);
                streamPDF.Seek(0, System.IO.SeekOrigin.Begin);
                //Export File  
                Response.ClearContent();
                Response.ClearHeaders();
                string rpt_name = "供應商暫估貨款明細表.PDF";
                Response.AddHeader("content-disposition", "attachment;filename=" + HttpUtility.UrlEncode(rpt_name, System.Text.Encoding.UTF8));//匯出檔名  
                Response.ContentType = "application/pdf";
                Response.OutputStream.Write(bytesPDF, 0, bytesPDF.Length);
            }
            Response.Flush();
            Response.Close();
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        finally { }
    }
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:93,代码来源:VAM111.aspx.cs


示例13: ShowReport

    private void ShowReport(DataTable dt,string V_FORM_TYPE,DateTime D_START_DATE,DateTime D_END_DATE,String V_ADJ_IN_DESC,String V_ADJ_OUT_DESC)
    {
        #region 利用CrystalReport列印報表

        //使用者名稱
        DataTable dt1 = new DataTable();
        dt1 = (DataTable)Session["UserInfo"];
        string Login_Name = dt1.Rows[0]["Name"].ToString();

        CrystalDecisions.CrystalReports.Engine.ReportDocument report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

        report.Load(Server.MapPath("./REPORT/PSS031/PSS031R01.rpt"));
        report.SetDataSource(dt);
        report.SetParameterValue("par_Program_ID", "PSS031R");
        report.SetParameterValue("par_LoginUser", Session["UID"].ToString() + Login_Name);
        report.SetParameterValue("par_YEAR_MONTH", this.SLP_YearMonth1.Text.Trim());

        if (rblRptType.Items[0].Selected)
            report.SetParameterValue("par_TYPE", "差異");
        else
            report.SetParameterValue("par_TYPE", "全部");

        if (this.SLP_SKU_B.Text.Trim() == "" && this.SLP_SKU_E.Text.Trim() == "")
        {
            report.SetParameterValue("par_ITEM", "全部");
        }
        else
        {
            report.SetParameterValue("par_ITEM", this.SLP_SKU_B.Text.Trim() + "~" + this.SLP_SKU_E.Text.Trim());
        }

        if (this.SLP_ItemPeriod_B.Text.Trim() == "" && this.SLP_ItemPeriod_E.Text.Trim() == "")
        {
            report.SetParameterValue("par_PERIOD", "全部");
        }
        else
        {
            report.SetParameterValue("par_PERIOD", this.SLP_ItemPeriod_B.Text.Trim() + "~" + this.SLP_ItemPeriod_E.Text.Trim());
        }

        if (this.slp_TAX_TYPE.Text.Trim() == "" )
        {
            report.SetParameterValue("par_TAX_TYPE", "全部");
        }
        else if (this.slp_TAX_TYPE.Text.Trim() == "0")
        {
            report.SetParameterValue("par_TAX_TYPE", "應稅");
        }
        else if (this.slp_TAX_TYPE.Text.Trim() == "1")
        {
            report.SetParameterValue("par_TAX_TYPE", "免稅");
        }
        else if (this.slp_TAX_TYPE.Text.Trim() == "2")
        {
            report.SetParameterValue("par_TAX_TYPE", "零稅");
        }

        report.SetParameterValue("par_START_DATE", D_START_DATE);

        report.SetParameterValue("par_END_DATE", D_END_DATE);

        report.SetParameterValue("par_ADJ_IN_DESC", V_ADJ_IN_DESC);

        report.SetParameterValue("par_ADJ_OUT_DESC", V_ADJ_OUT_DESC);
        
       
        
        //檔案匯出
        if (V_FORM_TYPE == "XLS")
        {
            System.IO.Stream streamXLS = report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.Excel);
            byte[] bytesXLS = new byte[streamXLS.Length];
            streamXLS.Read(bytesXLS, 0, bytesXLS.Length);
            streamXLS.Seek(0, System.IO.SeekOrigin.Begin);
            //Export File  
            Response.ClearContent();
            Response.ClearHeaders();
            Response.AddHeader("content-disposition", "attachment;filename=" + HttpUtility.UrlEncode("進銷存差異明細表.XLS", System.Text.Encoding.UTF8));//匯出檔名  
            Response.ContentType = "application/xls";
            Response.OutputStream.Write(bytesXLS, 0, bytesXLS.Length);
            Response.Flush();
            Response.Close();
        }
        else
        {
            System.IO.Stream streamPDF = report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
            byte[] bytesPDF = new byte[streamPDF.Length];
            streamPDF.Read(bytesPDF, 0, bytesPDF.Length);
            streamPDF.Seek(0, System.IO.SeekOrigin.Begin);
            //Export File  
            Response.ClearContent();
            Response.ClearHeaders();
            Response.AddHeader("content-disposition", "attachment;filename=" + HttpUtility.UrlEncode("進銷存差異明細表.PDF", System.Text.Encoding.UTF8));//匯出檔名  
            Response.ContentType = "application/pdf";
            Response.OutputStream.Write(bytesPDF, 0, bytesPDF.Length);
            Response.Flush();
            Response.Close();
        }
        report.Close();
        #endregion
//.........这里部分代码省略.........
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:101,代码来源:PSS031.aspx.cs


示例14: ProcesarComprobante

        private void ProcesarComprobante(out CrystalDecisions.CrystalReports.Engine.ReportDocument ReporteDocumento, eFact_Entidades.Lote Lote, int Renglon)
        {
            try
            {
                //Cursor = System.Windows.Forms.Cursors.WaitCursor;
                facturaRpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
                //facturaRpt.Load("Facturacion\\Electronica\\Reportes\\Factura.rpt");

                ////Crear un lote de un solo comprobante, para la impresion o exportacion del pdf.
                //eFact_Entidades.Lote LoteConUnSoloComprobante = new eFact_Entidades.Lote();
                //LoteConUnSoloComprobante.CuitVendedor = Lote.CuitVendedor;
                //LoteConUnSoloComprobante.FechaAlta = Lote.FechaAlta;
                //LoteConUnSoloComprobante.FechaEnvio = Lote.FechaEnvio;
                //LoteConUnSoloComprobante.IdLote = Lote.IdLote;
                //LoteConUnSoloComprobante.IdOp = Lote.IdOp;
                //LoteConUnSoloComprobante.LoteXml = Lote.LoteXml;
                //LoteConUnSoloComprobante.LoteXmlIF = Lote.LoteXmlIF;
                //LoteConUnSoloComprobante.NumeroEnvio = Lote.NumeroEnvio;
                //LoteConUnSoloComprobante.NumeroLote = Lote.NumeroLote;
                //LoteConUnSoloComprobante.PuntoVenta = Lote.PuntoVenta;
                //LoteConUnSoloComprobante.CantidadRegistros = 1;
                //LoteConUnSoloComprobante.Comprobantes.Add(Lote.Comprobantes[Renglon]);
                //LoteConUnSoloComprobante.WF = Lote.WF;
                //FeaEntidades.InterFacturas.lote_comprobantes lc = new FeaEntidades.InterFacturas.lote_comprobantes();
                //eFact_RN.Lote.DeserializarLc(out lc, LoteConUnSoloComprobante, true);
                ////Entidad para reporte crystal. Al desserializar se pierden los descuentos de la entidad original.
                //FeaEntidades.Reporte.lote_comprobantes lcReporte = new FeaEntidades.Reporte.lote_comprobantes();
                //eFact_RN.Lote.DeserializarLc(out lcReporte, LoteConUnSoloComprobante);
                //for (int i = 0; i < lc.comprobante.Length; i++)
                //{
                //    if (i == 0)
                //    {
                //        lc.comprobante[i] = lc.comprobante[Renglon];
                //        lcReporte.comprobante[i] = lcReporte.comprobante[Renglon];
                //        for (int l = 0; l < lc.comprobante[i].detalle.linea.Length; l++)
                //        {
                //            if (lc.comprobante[i].detalle.linea[l].lineaDescuentos != null)
                //            {
                //                lcReporte.comprobante[i].detalle.linea[l].lineaDescuentos = new FeaEntidades.Reporte.lineaDescuentos[lc.comprobante[i].detalle.linea[l].lineaDescuentos.Length];
                //                for (int d = 0; d < lcReporte.comprobante[i].detalle.linea[l].lineaDescuentos.Length; d++)
                //                {
                //                    lcReporte.comprobante[i].detalle.linea[l].lineaDescuentos[d] = new FeaEntidades.Reporte.lineaDescuentos();
                //                    lcReporte.comprobante[i].detalle.linea[l].lineaDescuentos[d].descripcion_descuento = lc.comprobante[i].detalle.linea[l].lineaDescuentos[d].descripcion_descuento;
                //                    lcReporte.comprobante[i].detalle.linea[l].lineaDescuentos[d].importe_descuento = lc.comprobante[i].detalle.linea[l].lineaDescuentos[d].importe_descuento;
                //                    lcReporte.comprobante[i].detalle.linea[l].lineaDescuentos[d].importe_descuento_moneda_origen = lc.comprobante[i].detalle.linea[l].lineaDescuentos[d].importe_descuento_moneda_origen;
                //                    lcReporte.comprobante[i].detalle.linea[l].lineaDescuentos[d].importe_descuento_moneda_origenSpecified = lc.comprobante[i].detalle.linea[l].lineaDescuentos[d].importe_descuento_moneda_origenSpecified;
                //                    lcReporte.comprobante[i].detalle.linea[l].lineaDescuentos[d].importe_descuento_moneda_origenSpecified = true;
                //                    lcReporte.comprobante[i].detalle.linea[l].lineaDescuentos[d].porcentaje_descuento = lc.comprobante[i].detalle.linea[l].lineaDescuentos[d].porcentaje_descuento;
                //                    lcReporte.comprobante[i].detalle.linea[l].lineaDescuentos[d].porcentaje_descuentoSpecified = lc.comprobante[i].detalle.linea[l].lineaDescuentos[d].porcentaje_descuentoSpecified;
                //                    lcReporte.comprobante[i].detalle.linea[l].lineaDescuentos[d].porcentaje_descuentoSpecified = true;
                //                }
                //            }
                //            else
                //            {
                //                lcReporte.comprobante[0].detalle.linea[l].lineaDescuentos = new FeaEntidades.Reporte.lineaDescuentos[1];
                //                lcReporte.comprobante[0].detalle.linea[l].lineaDescuentos[0] = new FeaEntidades.Reporte.lineaDescuentos();
                //                lcReporte.comprobante[0].detalle.linea[l].lineaDescuentos[0].descripcion_descuento = "";
                //                lcReporte.comprobante[0].detalle.linea[l].lineaDescuentos[0].importe_descuento = 0;
                //                lcReporte.comprobante[0].detalle.linea[l].lineaDescuentos[0].porcentaje_descuento = 0;
                //                lcReporte.comprobante[0].detalle.linea[l].lineaDescuentos[0].porcentaje_descuentoSpecified = true;
                //                lcReporte.comprobante[0].detalle.linea[l].lineaDescuentos[0].importe_descuento_moneda_origen = 0;
                //                lcReporte.comprobante[0].detalle.linea[l].lineaDescuentos[0].importe_descuento_moneda_origenSpecified = true;
                //            }
                //        }
                //    }
                //    else
                //    {
                //        lc.comprobante[i] = null;
                //        lcReporte.comprobante[i] = null;
                //    }
                //}
                
                //AsignarCamposOpcionales(lcReporte);
                //ReemplarResumenImportesMonedaExtranjera(lcReporte);
                //DataSet ds = new DataSet();
                //XmlSerializer objXS = new XmlSerializer(lcReporte.GetType());
                //StringWriter objSW = new StringWriter();
                //objXS.Serialize(objSW, lcReporte);
                //StringReader objSR = new StringReader(objSW.ToString());
                //ds.ReadXml(objSR);
                
                //string pxsd = string.Format("{0}\\Facturacion\\Electronica\\Reportes\\lote_comprobantes.xsd",System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location));
                //System.IO.File.Copy(pxsd, @System.IO.Path.GetTempPath() + "lote_comprobantes.xsd", true);
                
                //string imagen = string.Format("{0}\\Facturacion\\Electronica\\Reportes\\Imagen.xsd",System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location));
                //System.IO.File.Copy(imagen, @System.IO.Path.GetTempP 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CrystalMpq.MpqFile类代码示例发布时间:2022-05-24
下一篇:
C# Serialization.ObjectReference类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap