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


C# ReportDocument.Refresh方法代码示例

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


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

示例1: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        ReportDocument rd = new ReportDocument();
        //if (!this.Page.IsPostBack)
        //{
        string CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        //string orderBy = Request.QueryString["orderby"].ToString();//排序

        string orderString = Request.QueryString["orderby"].ToString();//排序
        string order = "DESC";//排序:升序
        string orderBy = (!string.IsNullOrEmpty(orderString)) ? orderString.Substring(0, orderString.Length - 2) : "ProviderNo";//要排序的字段,如果为空,默认为"ID"
        if (orderString.EndsWith("_a"))
        {
            order = "ASC";//排序:降序
        }
        orderBy = orderBy + " " + order;

        string ProviderID = Request.QueryString["ProviderID"];
        string ProductID = Request.QueryString["ProductID"];
        string StartConfirmDate = Request.QueryString["StartConfirmDate"];
        string EndConfirmDate = Request.QueryString["EndConfirmDate"];
      

           DataTable dt = null;
           if (Request.QueryString["dataSource"].ToString() == "Arrive")
           {

               dt = PurchaseArriveBus.PurchaseArriveCollectListPrint(ProviderID, ProductID, StartConfirmDate, EndConfirmDate, CompanyCD, orderBy);
           }
           else
           {
               dt = PurchaseArriveBus.PurchaseOrderCollectListPrint(ProviderID, ProductID, StartConfirmDate, EndConfirmDate, CompanyCD, orderBy);
           }

           rd.Load(Server.MapPath(@"~/OperatingModel/CrystalReport/PurchaseManager/PurchaseDetailCollect.rpt"));
        //绑定数据
        rd.SetDataSource(dt);
        rd.Refresh();
        this.CrystalReportViewer1.ReportSource = rd;
        rd.SetParameterValue("creator", "制表人:" + ((UserInfoUtil)SessionUtil.Session["UserInfo"]).EmployeeName);
        string DateParam = string.Empty;
        if (!string.IsNullOrEmpty(StartConfirmDate))
        {
            DateParam += "起始日期:" + StartConfirmDate;
        }
        if (!string.IsNullOrEmpty(EndConfirmDate))
        {
            DateParam += "  终止日期:" + EndConfirmDate;
        }
        rd.SetParameterValue("StartEndDate", DateParam);

        //}
    }
开发者ID:kosmos-zhang,项目名称:erp-aspnet,代码行数:53,代码来源:PurchaseDetailsPrint.aspx.cs

示例2: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        ReportDocument rd = new ReportDocument();


        int User = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).EmployeeID;

        //设置行为参数
        string orderString = Request.Params["orderby"];//排序
        string order = "DESC";//排序:升序
        string orderBy = (!string.IsNullOrEmpty(orderString)) ? orderString.Substring(0, orderString.Length - 2) : "ProductID";//要排序的字段,如果为空,默认为"ProductID"
        if (orderString.EndsWith("_a"))
        {
            order = "ASC";//排序:降序
        }


        string ProductID = Request.Params["ProductID"];
        string StartPurchaseDate = Request.Params["StartPurchaseDate"];
        string EndPurchaseDate = Request.Params["EndPurchaseDate"];


        orderBy = orderBy + " " + order;
        //string temp = JsonClass.DataTable2Json();
        DataTable dt = PurchaseOrderBus.SelectPurchaseHistoryAskPricePrint(orderBy, ProductID, StartPurchaseDate, EndPurchaseDate);


        rd.Load(Server.MapPath(@"~/OperatingModel/CrystalReport/PurchaseManager/PurchaseHistoryAskPriceInfo.rpt"));
        CrystalReportViewer1.LogOnInfo.Add(ReportUtil.GetTableLogOnInfo("officedba.V_PurchaseHistoryAskPriceInfo"));
        
        //UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
        //rd.DataDefinition.FormulaFields["Creator"].Text = "\"" + "制表人:" + ((UserInfoUtil)SessionUtil.Session["UserInfo"]).EmployeeName + "\"";
        //绑定数据
        rd.SetDataSource(dt);
        rd.Refresh();
        this.CrystalReportViewer1.ReportSource = rd;
        string DateParam = string.Empty;
        if (!string.IsNullOrEmpty(StartPurchaseDate))
        {
            DateParam += "起始日期:" + StartPurchaseDate;
        }
        if (!string.IsNullOrEmpty(EndPurchaseDate))
        {
            DateParam += "  终止日期:" + EndPurchaseDate;
        }
        rd.SetParameterValue("StartEndDate", DateParam);
        rd.SetParameterValue("Creator", "" + "制表人:" + ((UserInfoUtil)SessionUtil.Session["UserInfo"]).EmployeeName + "");
    }
开发者ID:kosmos-zhang,项目名称:erp-aspnet,代码行数:48,代码来源:PurchaseHistoryAskPriceInfoPrint.aspx.cs

示例3: ViewReport

        public static CrystalDecisions.Windows.Forms.CrystalReportViewer ViewReport(string reportName, List<KeyValuePair<string, object>> Param_Values)
        {
            ReportDocument _reportDocument = new ReportDocument();
            CrystalDecisions.Windows.Forms.CrystalReportViewer crystalReportViewer1 = new CrystalDecisions.Windows.Forms.CrystalReportViewer();
            crystalReportViewer1.ToolPanelView = CrystalDecisions.Windows.Forms.ToolPanelViewType.None;
            TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
            TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
            ConnectionInfo crConnectionInfo = new ConnectionInfo();
            Tables crTables;
            // load report      

            _reportDocument.Load(AppDomain.CurrentDomain.BaseDirectory.ToString() + "\\Reports\\" + reportName);
            // set report Connection info
            string[] LoginData = ConfigurationManager.ConnectionStrings["Local"].ConnectionString.ToString().Split(';');
            if (!string.IsNullOrEmpty(LoginData[3].ToString()) && LoginData[3].ToString() != "")
                crConnectionInfo.Password = LoginData[3].Split('=')[1].ToString();

            crConnectionInfo.UserID = LoginData[2].Split('=')[1].ToString();
            crConnectionInfo.DatabaseName = LoginData[1].Split('=')[1];
            crConnectionInfo.ServerName = LoginData[0].Split('=')[1];
            crTables = _reportDocument.Database.Tables;
            foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in crTables)
            {
                crtableLogoninfo = CrTable.LogOnInfo;
                crtableLogoninfo.ConnectionInfo = crConnectionInfo;
                CrTable.ApplyLogOnInfo(crtableLogoninfo);
            }
            _reportDocument.Refresh();
            // set report Parameter          
            if (Param_Values != null)
            {
                foreach (KeyValuePair<string, object> Param_Value in Param_Values)
                {
                    // _reportDocument.SetParameterValue("SalesHeaderID",Param_Value.Value);
                    _reportDocument.SetParameterValue((string)Param_Value.Key, (object)Param_Value.Value);
                }
            }
            crystalReportViewer1.ReportSource = _reportDocument;
            crystalReportViewer1.Refresh();
            
            crystalReportViewer1.Name = "crystalReportViewer1";

            return crystalReportViewer1;

        }
开发者ID:kimboox44,项目名称:POS,代码行数:45,代码来源:Utility.cs

示例4: Print

        public static bool Print(string reportName, int copies, List<KeyValuePair<string, object>> Param_Values)
        {
            ReportDocument _reportDocument = new ReportDocument();
            TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
            TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
            ConnectionInfo crConnectionInfo = new ConnectionInfo();
            Tables CrTables;

            bool status = false;
            _reportDocument.Load(AppDomain.CurrentDomain.BaseDirectory.ToString() + "\\Reports\\" + reportName);

            string[] LoginData = ConfigurationManager.ConnectionStrings["Production"].ConnectionString.ToString().Split(';');

            if (!string.IsNullOrEmpty(LoginData[3].ToString()) && LoginData[3].ToString() != "")
                crConnectionInfo.Password = LoginData[3].Split('=')[1].ToString();

            crConnectionInfo.UserID = LoginData[2].Split('=')[1].ToString();
            crConnectionInfo.DatabaseName = LoginData[1].Split('=')[1];
            crConnectionInfo.ServerName = LoginData[0].Split('=')[1];
            CrTables = _reportDocument.Database.Tables;
            foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
            {
                crtableLogoninfo = CrTable.LogOnInfo;
                crtableLogoninfo.ConnectionInfo = crConnectionInfo;
                CrTable.ApplyLogOnInfo(crtableLogoninfo);
            }
            _reportDocument.Refresh();
            // set report Parameter
            if (Param_Values != null)
            {
                foreach (KeyValuePair<string, object> Param_Value in Param_Values)
                {
                    // _reportDocument.SetParameterValue("SalesHeaderID",Param_Value.Value);
                    _reportDocument.SetParameterValue((string)Param_Value.Key, (object)Param_Value.Value);
                }
            }
            for (int i = 0; i < copies; i++)
            {
                _reportDocument.PrintToPrinter(1, true, 0, 0);
                status = true;
            }
            return status;
        }
开发者ID:kimboox44,项目名称:POS,代码行数:43,代码来源:Utility.cs

示例5: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session["dtTrialBalanceReport"] != null) //&& reportType > 0)
                {
                   // string financialPeriodName = Shared.GetFinancialPeriodName();

                    DataTable dt = (DataTable)Session["dtTrialBalanceReport"];
                    string rptFullPath = Server.MapPath("rptTrialBalance.rpt");
                    ReportDocument rpt = new ReportDocument();

                    rpt.Load(rptFullPath);
                    rpt.SetDataSource(dt);

                    TextObject txtTitle2 = (TextObject)rpt.ReportDefinition.ReportObjects["txtFinancialPeriodName"];
                    txtTitle2.Text = "2011";

                    rpt.Refresh();

                    MemoryStream memStream = (MemoryStream)rpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

                    Response.Clear();
                    Response.Buffer = true;
                    Response.ContentType = "application/pdf";
                    Response.BinaryWrite(memStream.ToArray());
                    Response.End();

                    memStream.Dispose();
                }
                else
                    Response.Redirect("TrialBalance.aspx", false);

            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
            finally
            {
                Session.Remove("dtTrialBalanceReport");
            }
        }
开发者ID:zafore,项目名称:GL,代码行数:43,代码来源:ViewTrialBalance.aspx.cs

示例6: btnShow_Click

        private void btnShow_Click(object sender, EventArgs e)
        {
            ReportDocument reportDocument = new ReportDocument();
            string filePath = String.Format("{0}\\SalesDetails.rpt", System.Configuration.ConfigurationManager.AppSettings["ReportFolderPath"]);
            
            reportDocument.Load(filePath);

            

            reportDocument.Refresh();
            reportDocument.SetParameterValue("@startdate", dtpStartDate.Value.Date);
            reportDocument.SetParameterValue("@enddate", dtpEndDate.Value.Date);

            reportDocument.SetParameterValue("@startdate", dtpStartDate.Value.Date, reportDocument.Subreports[0].Name.ToString());
            reportDocument.SetParameterValue("@enddate", dtpEndDate.Value.Date, reportDocument.Subreports[0].Name.ToString());


            FormReport frm = new FormReport();
            frm.Text = "Sales Report";
            frm.crystalReportViewer1.ReportSource = reportDocument;
            frm.Visible = true;
        }
开发者ID:anaya-upadhyay,项目名称:RestaurantBillingSystem,代码行数:22,代码来源:UcReportSalesDetails.cs

示例7: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session["vwCashRecieptsReport"] != null)
                {
                    DataTable dt = (DataTable)Session["vwCashRecieptsReport"];
                        dt.Rows[0]["AmountText"] = new NumberToWords.NumberToWords().GetAmountWord(decimal.Parse(dt.Rows[0]["Credit"].ToString()), NumberToWords.NumberToWords.ValueTypes.Money);

                    string rptFullPath = Server.MapPath("rptCashReciepts.rpt");
                    ReportDocument rpt = new ReportDocument();

                    rpt.Load(rptFullPath);
                    rpt.SetDataSource(dt);
                    rpt.Refresh();

                    MemoryStream memStream = (MemoryStream)rpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

                    Response.Clear();
                    Response.Buffer = true;
                    Response.ContentType = "application/pdf";
                    Response.BinaryWrite(memStream.ToArray());
                    Response.End();

                    memStream.Dispose();
                }
                else
                    Response.Redirect("Payments.aspx", false);

            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
            finally
            {
                Session.Remove("vwCashRecieptsReport");
            }
        }
开发者ID:Shibrain,项目名称:GL,代码行数:39,代码来源:ViewCashReceiptReport.aspx.cs

示例8: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Session["dtAccountBalance"] != null) //&& reportType > 0)
            {
                DataTable dt = (DataTable)Session["dtAccountBalance"];
                string rptFullPath = Server.MapPath("rptAccountsBalances.rpt");
                ReportDocument rpt = new ReportDocument();

                rpt.Load(rptFullPath);
                rpt.SetDataSource(dt);
                rpt.Refresh();

                MemoryStream memStream = (MemoryStream)rpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

                Response.Clear();
                Response.Buffer = true;
                Response.ContentType = "application/pdf";
                Response.BinaryWrite(memStream.ToArray());
                Response.End();

                memStream.Dispose();
            }
            else
                Response.Redirect("AccountBalance.aspx", false);

        }
        catch (Exception ex)
        {
            Response.Write(ex.Message);
        }
        finally
        {
            Session.Remove("dtAccountBalance");
        }
    }
开发者ID:zafore,项目名称:GL,代码行数:37,代码来源:ViewAccountBalanceReport.aspx.cs

示例9: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        string cs = ConfigurationManager.ConnectionStrings["BarsslsConnection"].ConnectionString;
        using (SqlConnection con = new SqlConnection(cs))

        {
        SqlDataAdapter da = new SqlDataAdapter(@" SELECT customers.customer_name, customers.sales_rep, customers.customer_type, customers.RW_rep_ID, customers.date_opened, customers.broker_ID, customers.cust_region " +
                                                        "FROM BARSSLS.dbo.customers customers ", con);

        DataSet ds = new DataSet();

        ReportDocument rd = new ReportDocument();

        rd.Load(Server.MapPath("~/Reports/CrystalReps.rpt"));
        rd.Refresh();
        rd.SetDataSource(ds);// if you have any data source
        CrystalReportViewer1.ReportSource = rd;
        CrystalReportViewer1.DataBind();

        ConnectionInfo myConnectionInfo = new ConnectionInfo();
        myConnectionInfo.ServerName = "corp-bi-dev01";
        myConnectionInfo.DatabaseName = "BARSSLS";
        myConnectionInfo.UserID = "weboe";
        myConnectionInfo.Password = "W3b0e";

        TableLogOnInfos mytableloginfos = new TableLogOnInfos();
        mytableloginfos = CrystalReportViewer1.LogOnInfo;

            foreach (TableLogOnInfo myTableLogOnInfo in mytableloginfos)
            {
                myTableLogOnInfo.ConnectionInfo = myConnectionInfo;
            }
        //setDBLOGONforREPORT(myConnectionInfo);

        }
    }
开发者ID:BarsCarlos,项目名称:TPMSWebNew,代码行数:36,代码来源:ReportWebForm.aspx.cs

示例10: Print

    private void Print()
    {
        string ChangeNo = Request["ChangeNo"].ToString();
        DataTable dt = ProductPriceChangeBus.GetProductPriceInfoByID(int.Parse(Request["ChangeNo"]));
        if (dt!=null&&dt.Rows.Count > 0)
        {
            ReportDocument oRpt = new ReportDocument();
            //SubreportObject chlidobj = new SubreportObject();//子报表对象
            //报表文件路径
            string path = Server.MapPath(@"~/OperatingModel/CrystalReport/SubStoreManager/PrintProductPrice.rpt");
            oRpt.Load(path);


            CrystalReportViewer1.LogOnInfo.Add(ReportUtil.GetTableLogOnInfo("officedba.View_PrintProductPrice"));

            //数据源赋值对应好报表文件配置好的数据源格式
            oRpt.SetDataSource(dt);//设置报表显示的数据源,支持Table及DataSet
            oRpt.Refresh();

            CrystalReportViewer1.ReportSource = oRpt;
            oRpt.SetParameterValue("creator", "制表人:" + ((UserInfoUtil)SessionUtil.Session["UserInfo"]).EmployeeName);
        }
      
    }
开发者ID:kosmos-zhang,项目名称:erp-aspnet,代码行数:24,代码来源:PrintProductPrice.aspx.cs

示例11: PrintReport

        private void PrintReport(TipoPDF tpPdf)
        {
            ReportDocument rpt = new ReportDocument();

            string sRelatorio = "RelDanfe.rpt"; //padrão
            if (tpPdf.ToString().Equals("ENVIADO")) { sRelatorio = (cbxFormDanfe.SelectedIndex == 0 ? "RelDanfe.rpt" : "RelDanfePaisagem.rpt"); }
            else if (tpPdf.ToString().Equals("CANCELADO")) { sRelatorio = "RelDanfeCancelados.rpt"; }
            else if (tpPdf.ToString().Equals("CONTINGENCIA")) { sRelatorio = "RelDanfeContingencia.rpt"; }



            if (LeRegWin.LeRegConfig("UsaRelatorioEspecifico") == "True")
            {
                string sCaminho = LeRegWin.LeRegConfig("CaminhoRelatorioEspecifico") + "\\" + sRelatorio;
                rpt.Load(sCaminho);
            }
            else
            {
                rpt.Load(Application.StartupPath + "\\Relatorios" + "\\" + sRelatorio);
            }
            //if (cbxFormDanfe.SelectedIndex != 0)
            //{
            //    rpt.PrintOptions.PaperOrientation = PaperOrientation.Landscape;
            //    rpt.PrintOptions.PaperSize = PaperSize.PaperA4;
            //    rpt.PrintOptions.PrinterName = @"\\hlp030\Samsung ML-2010 Series";                 
            //}
            rpt.SetDataSource(dsdanfe);
            rpt.Refresh();
            // rpt.PrintToPrinter(1, false, 0, 0);
            frmPreviwDanfe frm = new frmPreviwDanfe(rpt);
            frm.ShowDialog();
        }
开发者ID:dramosti,项目名称:GeraXml_2.0,代码行数:32,代码来源:frmArquivosXmlNfe.cs

示例12: Report

        public ActionResult Report(RequestIssue requestıssue, FormCollection formcollection)
        {
            ReportDocument rptH = new ReportDocument();

            rptH.FileName = Server.MapPath("~/RDLC/SurveyReport.rpt");

            rptH.Refresh();
            //rptH.Load();

            var value = new ParameterDiscreteValue();

            var requests_ = db.RequestIssues.AsNoTracking().Include(p => p.Locations).Include(p => p.Personnels).Include(p => p.CorporateAccounts);

            int x_index = 0;
            foreach (int req_ in requests_.Select(i => i.RequestIssueID).ToList())
            {
                value.Value = req_;

                rptH.ParameterFields["RequestIDs"].CurrentValues.Add(value);
                x_index++;
            }

            if (x_index == 0)
            {
                return RedirectToAction("Index", new { custommerr = "Belirttiğiniz Kriterlere Uygun Kayıt(lar) Bulunamadı" });
            }

            // rptH.SetDataSource([datatable]);
            var cd = new System.Net.Mime.ContentDisposition
            {
                // for example foo.bak
                FileName = "rapor_klimasanHelpDeskAnketler.pdf",

                // always prompt the user for downloading, set to true if you want
                // the browser to try to show the file inline
                Inline = false,
            };

            Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
            Response.AppendHeader("Content-Disposition", cd.ToString());
            return File(stream, "application/pdf");
        }
开发者ID:bclark00,项目名称:klmnscamp,代码行数:42,代码来源:SurveyTableController.cs

示例13: btnImpressao_Click

        private void btnImpressao_Click(object sender, EventArgs e)
        {
            try
            {
                if ((bsGrid.DataSource as List<belPesquisaCCe>) != null)
                {

                    if ((bsGrid.DataSource as List<belPesquisaCCe>).Where(c => c.bSeleciona && c.QT_ENVIO > 0).Count() > 0)
                    {
                        belCarregaDataSet objbelCarregaDataSet = new belCarregaDataSet((bsGrid.DataSource as List<belPesquisaCCe>).Where(c => c.bSeleciona && c.QT_ENVIO > 0).ToList<belPesquisaCCe>());

                        string sCaminho = "";

                        if (Acesso.NM_RAMO != Acesso.BancoDados.TRANSPORTE)
                            sCaminho = Util.GetPathRelatorio("CCe.rpt");
                        else
                            sCaminho = Util.GetPathRelatorio("CCeCTe.rpt");
                        ReportDocument rpt = new ReportDocument();
                        rpt.Load(sCaminho);
                        DirectoryInfo dinfo = new DirectoryInfo(Pastas.CCe + "\\PDF");
                        if (!dinfo.Exists)
                        {
                            dinfo.Create();
                        }

                        string sCaminhoSave;
                        foreach (dsCCe ds in objbelCarregaDataSet.objListaDS)
                        {
                            sCaminhoSave = dinfo.FullName + "\\" + ds.CCe[0].NFE.ToString() + ".pdf";

                            rpt.SetDataSource(ds);
                            rpt.Refresh();
                            Util.ExportPDF(rpt, sCaminhoSave);
                        }

                        EnviaEmailCCe((bsGrid.DataSource as List<belPesquisaCCe>).Where(c => c.bSeleciona && c.QT_ENVIO > 0).ToList<belPesquisaCCe>());

                        rpt.Load(sCaminho);
                        rpt.Refresh();

                        frmRelatorio frm = new frmRelatorio(rpt, "Impressão de CC-e");
                        frm.Show();
                    }
                    else
                    {
                        KryptonMessageBox.Show("Não há Cartas de Correções válidas selecionadas!", Mensagens.MSG_Aviso, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                new HLPexception(ex);
            }
        }
开发者ID:dramosti,项目名称:GeraXml_3.0,代码行数:54,代码来源:frmGeraArquivoCCe.cs

示例14: btnImpressao_Click


//.........这里部分代码省略.........
                                if (!objListDados[i].Cancelado)
                                {
                                    objDataSet.PopulaDataSet(dsLotacao, objListDados[i].sCaminhoXml, i + 1, objListDados[i].sProtocolo);
                                    dsPadraoPDF = new dsCTe();
                                    objDataSet.PopulaDataSet(dsPadraoPDF, objListDados[i].sCaminhoXml, 1, objListDados[i].sProtocolo);
                                    GeraPDF(dsPadraoPDF, TipoPDF.LOTACAO, objListDados[i]);
                                    //GeraPDF(dsLotacao, TipoPDF.LOTACAO, objListDados[i]);

                                }
                                else
                                {
                                    objDataSet.PopulaDataSet(dsLotacaoCancelado, objListDados[i].sCaminhoXml, i + 1, objListDados[i].sProtocolo);
                                    dsPadraoPDF = new dsCTe();
                                    objDataSet.PopulaDataSet(dsPadraoPDF, objListDados[i].sCaminhoXml, 1, objListDados[i].sProtocolo);
                                    GeraPDF(dsPadraoPDF, TipoPDF.LOTACAO_CANCELADO, objListDados[i]);

                                    //GeraPDF(dsLotacaoCancelado, TipoPDF.LOTACAO_CANCELADO, objListDados[i]);
                                }
                            }
                            else
                            {
                                if (!objListDados[i].Cancelado)
                                {
                                    objDataSet.PopulaDataSet(dsPadrao, objListDados[i].sCaminhoXml, i + 1, objListDados[i].sProtocolo);
                                    dsPadraoPDF = new dsCTe();
                                    objDataSet.PopulaDataSet(dsPadraoPDF, objListDados[i].sCaminhoXml,1, objListDados[i].sProtocolo);
                                    GeraPDF(dsPadraoPDF, TipoPDF.PADRAO, objListDados[i]);
                                }
                                else
                                {
                                    objDataSet.PopulaDataSet(dsPadraoCancelado, objListDados[i].sCaminhoXml, i + 1, objListDados[i].sProtocolo);
                                    dsPadraoPDF = new dsCTe();
                                    objDataSet.PopulaDataSet(dsPadraoPDF, objListDados[i].sCaminhoXml, 1, objListDados[i].sProtocolo);
                                    GeraPDF(dsPadraoPDF, TipoPDF.PADRAO_CANCELADO, objListDados[i]);

                                    //GeraPDF(dsPadraoCancelado, TipoPDF.PADRAO_CANCELADO, objListDados[i]);
                                }
                            }
                        }
                    }

                    if (Convert.ToBoolean(Acesso.EMAIL_AUTOMATICO))
                    {
                        EnviaEmail(objListDados);
                    }
                    if (dsPadrao.infCte.Count() > 0)
                    {
                        ReportDocument rpt = new ReportDocument();
                        rpt.Load(Util.GetPathRelatorio("rptCtePadrao.rpt"));
                        rpt.SetDataSource(dsPadrao);
                        rpt.Refresh();

                        frmRelatorio frm = new frmRelatorio(rpt, "Impressão de DACTE - Carga Fracionada");
                        frm.Show();
                    }
                    if (dsPadraoCancelado.infCte.Count() > 0)
                    {
                        ReportDocument rpt = new ReportDocument();
                        rpt.Load(Util.GetPathRelatorio("rptCtePadraoCancelado.rpt"));
                        rpt.SetDataSource(dsPadraoCancelado);
                        rpt.Refresh();

                        frmRelatorio frm = new frmRelatorio(rpt, "Impressão de DACTE - Carga Fracionada(Cancelados)");
                        frm.Show();
                    }
                    if (dsLotacao.infCte.Count() > 0)
                    {
                        ReportDocument rpt = new ReportDocument();
                        rpt.Load(Util.GetPathRelatorio("rptCteLotacao.rpt"));
                        rpt.SetDataSource(dsLotacao);
                        rpt.Refresh();

                        frmRelatorio frm = new frmRelatorio(rpt, "Impressão de DACTE - Lotação");
                        frm.Show();
                    }
                    if (dsLotacaoCancelado.infCte.Count() > 0)
                    {
                        ReportDocument rpt = new ReportDocument();
                        rpt.Load(Util.GetPathRelatorio("rptCteLotacaoCancelado.rpt"));
                        rpt.SetDataSource(dsLotacaoCancelado);
                        rpt.Refresh();

                        frmRelatorio frm = new frmRelatorio(rpt, "Impressão de DACTE - Lotação(Cancelados)");
                        frm.Show();
                    }
                }
                else
                {
                    KryptonMessageBox.Show("Nenhum CT-e válido foi Selecionado para Impressão.", Mensagens.MSG_Aviso, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }



                #endregion
            }
            catch (Exception ex)
            {
                new HLPexception(ex);
            }
        }
开发者ID:dramosti,项目名称:GeraXml_3.0,代码行数:101,代码来源:frmGerarArquivosCte.cs

示例15: GeraPDF

        private void GeraPDF(dsCTe ds, TipoPDF tpPdf, string sNumCte, string sCaminhoSalvar)
        {
            try
            {

                ReportDocument rpt = new ReportDocument();

                if (tpPdf == TipoPDF.PADRAO)
                {
                    rpt.Load(Util.GetPathRelatorio("rptCtePadrao.rpt"));
                }
                else if (tpPdf == TipoPDF.PADRAO_CANCELADO)
                {
                    rpt.Load(Util.GetPathRelatorio("rptCtePadraoCancelado.rpt"));
                }
                else if (tpPdf == TipoPDF.LOTACAO)
                {
                    rpt.Load(Util.GetPathRelatorio("rptCteLotacao.rpt"));
                }
                else if (tpPdf == TipoPDF.LOTACAO_CANCELADO)
                {
                    rpt.Load(Util.GetPathRelatorio("rptCteLotacaoCancelado.rpt"));
                }
                rpt.SetDataSource(ds);
                rpt.Refresh();



                Util.ExportPDF(rpt, sCaminhoSalvar + "\\Cte_" + sNumCte + ".pdf");

            }
            catch (Exception ex)
            {
                new HLPexception(ex);
            }
        }
开发者ID:dramosti,项目名称:GeraXml_3.0,代码行数:36,代码来源:frmGerarArquivosCte.cs


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