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


C# StiReport.Render方法代码示例

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


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

示例1: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string from = Request.Params["from"] == null ? DateTime.Now.ToString("dd/MM/yyyy") : Request.Params["from"].ToString();
         string to = Request.Params["to"] == null ? DateTime.Now.ToString("dd/MM/yyyy") : Request.Params["to"].ToString();
         Session["ssLaiLoFromDate"] = (Session["ssLaiLoFromDate"] == null || Session["ssLaiLoFromDate"] == "") ? from : Session["ssLaiLoFromDate"];
         Session["ssLaiLoToDate"] = (Session["ssLaiLoToDate"] == null || Session["ssLaiLoToDate"] == "") ? from : Session["ssLaiLoToDate"];
     }
     tmp = new StiReport();
     LoadReportANDGetData(tmp, @"\ReportSources\SALE\BaoCaoLaiLo.mrt", "SALE_report_baocaoLaiLo", Session["ssLaiLoFromDate"].ToString(), Session["ssLaiLoToDate"].ToString());
     tmp.Dictionary.Synchronize();
     StiWebViewer1.Report = tmp;
     StiWebViewer1.ShowDesignButton = true;
     StiWebViewer1.ReportDesign += StiWebViewer1_ReportDesign;
     tmp.Render(true);
 }
开发者ID:trantrung2608,项目名称:ilinkbay,代码行数:17,代码来源:BCInLaiLo.aspx.cs

示例2: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         dateDelivery.Value = DateTime.Now;
         cmbStaff.Value = -1;
         Session["ssDateDelivery"] = dateDelivery.Date.ToString("dd/MM/yyyy");
         Session["ssStaffID"] = -1;
     }
     tmp = new StiReport();
     LoadReportANDGetData(tmp, @"\ReportSources\SALE\BangKeGiaoHang.mrt", "SALE_Invoice_report_deliver_summary", int.Parse(Session["ssStaffID"].ToString()), Session["ssDateDelivery"].ToString());
     tmp.Dictionary.Synchronize();
     StiWebViewer1.Report = tmp;
     StiWebViewer1.ShowDesignButton = true;
     StiWebViewer1.ReportDesign += StiWebViewer1_ReportDesign;
     tmp.Render(true);
 }
开发者ID:trantrung2608,项目名称:ilinkbay,代码行数:17,代码来源:BangKeGiaoHang.aspx.cs

示例3: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Session["StringDate"] = null;
         DateFrom.Value = DateTime.Now;
         DateTo.Value = DateTime.Now;
         StringDate = DateFrom.Date.ToString("dd/MM/yyyy");
         Session["StringDate"] = StringDate;
     }
     tmp = new StiReport();
     // StringDate = "30/07/2014#30/08/2014";
     LoadReportANDGetData(tmp, @"\ReportSources\FINANCE\BaoCaoNgay.mrt", "FM_Report_BaoCaoNgay", Session["StringDate"].ToString());
     tmp.Dictionary.Synchronize();
     StiWebViewer1.Report = tmp;
     StiWebViewer1.ShowDesignButton = true;
     StiWebViewer1.ReportDesign += StiWebViewer1_ReportDesign;
     tmp.Render(true);
 }
开发者ID:trantrung2608,项目名称:ilinkbay,代码行数:19,代码来源:BaoCaoNgay.aspx.cs

示例4: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DateFrom.Value = DateTime.Now;
            DateTo.Value = DateTime.Now;
            Session["ssSTformDate"] = DateFrom.Date.ToString("dd/MM/yyyy");
            Session["ssSTtoDate"] = DateTo.Date.ToString("dd/MM/yyyy");
            Session["ssSTStockID"] = -1;
            Session["ssSTProductID"] = -1;

        }
        tmp = new StiReport();
        LoadReportANDGetData(tmp, @"\ReportSources\SM\BaoCaoTheKhoGiaVon.mrt", "SM_report_TheKho_giavon", int.Parse(Session["ssSTStockID"].ToString()), Session["ssSTformDate"].ToString(), Session["ssSTtoDate"].ToString(), int.Parse(Session["ssSTProductID"].ToString()));
        tmp.Dictionary.Synchronize();
        StiWebViewer1.Report = tmp;
        StiWebViewer1.ShowDesignButton = true;
        StiWebViewer1.ReportDesign += StiWebViewer1_ReportDesign;
        tmp.Render(true);
    }
开发者ID:trantrung2608,项目名称:ilinkbay,代码行数:20,代码来源:StockCard.aspx.cs

示例5: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Session["StringDate"] = null;
         DateFrom.Value = DateTime.Now;
         DateTo.Value = DateTime.Now;
         StringDate = DateFrom.Date.ToString("dd/MM/yyyy") + "#" + DateTo.Date.ToString("dd/MM/yyyy");
         Session["StringDate"] = StringDate;
         Session["BOID"] = CU.getBOID();
         Session["ContactID"] = -1;
     }
     tmp = new StiReport();
     // StringDate = "30/07/2014#30/08/2014";
     //Session["ContactID"] = CmbCustomer.Value.ToString();
     LoadReportANDGetData(tmp, @"\ReportSources\FINANCE\BCChiTietCongNoTatCaNV.mrt", "FM_Report_BaoCaoChiTietCongNoTheoTatCaNV", Session["StringDate"].ToString(), Session["ContactID"].ToString());
     tmp.Dictionary.Synchronize();
     StiWebViewer1.Report = tmp;
     StiWebViewer1.ShowDesignButton = true;
     StiWebViewer1.ReportDesign += StiWebViewer1_ReportDesign;
     tmp.Render(true);
 }
开发者ID:trantrung2608,项目名称:ilinkbay,代码行数:22,代码来源:BCCTCNTheoTatCaNV.aspx.cs

示例6: FaktLivingKomunalReport

 private void FaktLivingKomunalReport(AccountReportType accountReportType)
 {
     Account currentAccount = this.CurrentAccount;
     if (currentAccount.Id != Account.Null.Id)
     {
         System.Data.DataSet set = Mappers.RepReportMapper.FaktLivingKomunal(currentAccount.Id);
         if (((set != null) && (set.Tables.get_Count() != 0)) && (set.Tables.get_Item(0).Rows.get_Count() != 0))
         {
             StiReport report = new StiReport();
             report.Load(Resources.Rep_FaktLivingKomunal);
             report.Compile();
             report.RegData((System.Data.DataSet) set);
             report.Render(true);
             report.Show((System.Windows.Forms.IWin32Window) this.ContentControl);
         }
     }
 }
开发者ID:u4097,项目名称:SQLScript,代码行数:17,代码来源:ApartmentReports.cs

示例7: AccountServicesNotificationReport

 private void AccountServicesNotificationReport(AccountReportType accountReportType)
 {
     Account currentAccount = this.CurrentAccount;
     if (currentAccount.Id != Account.Null.Id)
     {
         System.DateTime date = System.DateTime.Now.Date;
         System.Data.DataSet set = Mappers.SimpleReportMapper.GetAccountServicesNotification(currentAccount.Id, date, 0L, 0L);
         if (((set != null) && (set.Tables.get_Count() == 2)) && (set.Tables.get_Item(0).Rows.get_Count() != 0))
         {
             set.Tables.get_Item(0).set_TableName("dataHeader");
             set.Tables.get_Item(1).set_TableName("dataServices");
             StiReport report = new StiReport();
             if (accountReportType.Template.get_Length() > 0)
             {
                 report.LoadFromString(accountReportType.Template);
             }
             report.Compile();
             report.RegData((System.Data.DataSet) set);
             report.Render(true);
             if (accountReportType.Name == "Уведомление для Грозного, без долга")
             {
                 StimulsoftUtilsOptions options = new StimulsoftUtilsOptions(false);
                 report.Show((System.Windows.Forms.IWin32Window) this.ContentControl);
                 options.RestoreValues();
             }
             else
             {
                 report.Show((System.Windows.Forms.IWin32Window) this.ContentControl);
             }
         }
     }
 }
开发者ID:u4097,项目名称:SQLScript,代码行数:32,代码来源:ApartmentReports.cs

示例8: AccountServicesJournalCurrentReportSR

 private void AccountServicesJournalCurrentReportSR(AccountReportType accountReportType)
 {
     Account currentAccount = this.CurrentAccount;
     if (currentAccount.Id != Account.Null.Id)
     {
         System.DateTime period = System.DateTime.Now.Date.AddDays((double) (1 - System.DateTime.Now.get_Day()));
         System.Data.DataSet set = Mappers.SimpleReportMapper.GetAccountCurrentJournalReportByPeriod(currentAccount.Id, period, true, true, false);
         if (((set != null) && (set.Tables.get_Count() == 4)) && (set.Tables.get_Item(0).Rows.get_Count() != 0))
         {
             set.Tables.get_Item(0).set_TableName("dataHeader");
             set.Tables.get_Item(1).set_TableName("dataResidents");
             set.Tables.get_Item(2).set_TableName("dataBenefits");
             set.Tables.get_Item(3).set_TableName("dataAccountServices");
             StiReport report = new StiReport();
             report.Load(Resources.Rep_AccountServicesJournalCurrentSR);
             report.Compile();
             report.RegData((System.Data.DataSet) set);
             report.Render(true);
             report.Show((System.Windows.Forms.IWin32Window) this.ContentControl);
         }
     }
 }
开发者ID:u4097,项目名称:SQLScript,代码行数:22,代码来源:ApartmentReports.cs

示例9: printStimulsoftReports

        /// <summary>
        /// 打印MRZ
        /// </summary>
        /// <param name="rptFiles">ftp文件</param>  
        /// <param name="dsSource">数据源</param>
        /// <param name="isPreview">是否预览</param>
        /// <returns></returns>
        public static string printStimulsoftReports(string rptFiles, DataSet dsSource, bool isPreview)
        {
            try
            {
                //处理下载多个文件的情形
                string lableFiles = rptFiles.Trim() + ",";
                string lFile = "";
                int filesCount = lableFiles.Length - lableFiles.Replace(",", String.Empty).Length;

                //对数据集重命名

                for (int i = 0; i < dsSource.Tables.Count; i++)
                {
                    dsSource.Tables[i].TableName = "t" + (i + 1).ToString();
                }

                StiReport report = new StiReport();

                for (int i = 0; i < filesCount; i++)  //连续打印
                {
                    lFile = lableFiles.Substring(0, lableFiles.IndexOf(","));
                    if (lFile.Trim() != "")
                    {
                        string LocalPath = Environment.GetEnvironmentVariable("TEMP") + "\\" + rptFiles;

                        if (System.IO.File.Exists(LocalPath) == true)
                        {

                            string rptFile = LocalPath;

                            report.Load(rptFile);

                            //对数据集重命名
                            for (int ii = 0; ii < dsSource.Tables.Count; ii++)
                            {
                                dsSource.Tables[ii].TableName = "t" + (ii + 1).ToString();
                            }

                            report.RegData(dsSource);
                            if (isPreview == false) report.PrinterSettings.ShowDialog = false;
                            report.Render(false);
                            if (isPreview == false)
                            {
                                report.Print();
                                File.Delete(LocalPath);
                            }
                            else
                            {
                                report.Show(true);
                                File.Delete(LocalPath);
                            }

                        }
                        else
                        {
                            return " RptReportServerURL + lFile, PlugInCommand";

                        }
                    }

                    lableFiles = lableFiles.Substring(lableFiles.IndexOf(",") + 1);
                }

            }

            catch (Exception er)
            {
                return er.ToString();

            }
            return "打印成功";
        }
开发者ID:ypfly,项目名称:AutoCount,代码行数:79,代码来源:PrintMRZ.cs

示例10: PrintMultiPage

    private void PrintMultiPage(string id, string type, int reportID, string reportCode)
    {
        report = new StiReport();
        report.ReportCacheMode = StiReportCacheMode.Off;
        report.RenderedPages.CanUseCacheMode = false;
        report.RenderedPages.CacheMode = false;
        report.RenderedPages.Clear();
        report.NeedsCompiling = false;
        report.IsRendered = true;
        string[] listID = id.Split('-');
        DataTable dt = SqlHelper.ExecuteDataset(DataServices.ConnectString, "SY_report_info_getByID", type, reportID, reportCode).Tables[0];
        string reportname = dt.Rows[0]["reportname"].ToString();
        URL = dt.Rows[0]["reportURL"].ToString();
        storedatasource = dt.Rows[0]["objectname"].ToString();
        string keyfieldname = dt.Rows[0]["keyfieldname"].ToString();
        string objecttype = dt.Rows[0]["objecttype"].ToString();
        string filterSQL = dt.Rows[0]["filterSQL"].ToString();
        string filterControlURL = dt.Rows[0]["filterControlURL"].ToString();
        string sqlParams = dt.Rows[0]["sqlParams"].ToString();
        sqlParams = sqlParams.Replace("'", "");
        string[] listparams = sqlParams.Split(';');
        for (int g = 0; g < listID.Length - 1; g++)
        {

            values = new List<object>();
            for (int i = 0; i < listparams.Length; i++)
            {
                string[] paramVals = listparams[i].Split(':');
                object nullVal = null;
                switch (paramVals[2])
                {
                    case "B":
                        nullVal = false;
                        break;
                    case "T":
                        nullVal = "";
                        break;
                    case "N":
                        nullVal = 0;
                        break;
                    case "D":
                        nullVal = DateTime.Now;
                        break;
                    default:
                        nullVal = "";
                        break;
                }
                switch (paramVals[0])
                {
                    case "SessionParameter":
                        if (Session[paramVals[1]] != null)
                            values.Add(Session[paramVals[1]]);
                        else
                            values.Add(nullVal);
                        break;
                    case "QueryStringParameter":
                        if (Request.Params[paramVals[1]] != null)
                            values.Add(listID[g]);
                        else
                            values.Add(nullVal);
                        break;
                    case "ControlParameter":
                        ASPxEdit c = phFilterControl.Controls[0].FindControl(paramVals[1]) as ASPxEdit;
                        if (c != null)
                            values.Add(c.Value.ToString());
                        else
                            values.Add(nullVal);
                        break;
                    case "CookieParameter":
                        if (Request.Cookies[paramVals[1]] != null)
                            values.Add(Request.Cookies[paramVals[1]].ToString());
                        else
                            values.Add(nullVal);
                        break;
                    case "Parameter":
                        values.Add(paramVals[1]);
                        break;
                    default:
                        values.Add(nullVal);
                        break;
                }

            }
            StiReport tmp = new StiReport();
            LoadReportANDGetData(tmp, URL, storedatasource, values.ToArray());

            tmp.Dictionary.Synchronize();
            tmp.Render(true);

            report.RenderedPages.Add(tmp.RenderedPages[0]);
        }

        StiWebViewer1.Report = report;
        StiWebViewer1.PrintToDirect();
    }
开发者ID:trantrung2608,项目名称:ilinkbay,代码行数:95,代码来源:ReportViewerNotHeader.aspx.cs

示例11: m_WorkerGetNotices_RunWorkerCompleted

 private void m_WorkerGetNotices_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (this.m_WorkerGetNoticeMode == WorkerGetNoticeMode.Извещения)
     {
         StiReport report = new StiReport();
         report.Load(Resources.Rep_PayNotices);
         report.Compile();
         report.RegData((System.Data.DataSet) this.m_DataSet);
         this.tsBtnShowReports.set_Image(null);
         Manager.SetStiViewerPageManagement(false);
         report.Show((System.Windows.Forms.Form) base.FindForm());
     }
     else if (this.m_WorkerGetNoticeMode == WorkerGetNoticeMode.Уведомления)
     {
         AccountReportType byName = AccountReportType.GetByName("Уведомление для Грозного, долг");
         if (byName.IsEnabled)
         {
             StiReport report2 = new StiReport();
             if (byName.Template.get_Length() > 0)
             {
                 report2.LoadFromString(byName.Template);
             }
             report2.Compile();
             report2.RegData((System.Data.DataSet) this.m_DataSet);
             this.tsBtnShowReports.set_Image(null);
             Manager.SetStiViewerPageManagement(false);
             report2.Render(true);
             report2.Show((System.Windows.Forms.Form) base.FindForm());
         }
     }
 }
开发者ID:u4097,项目名称:SQLScript,代码行数:31,代码来源:DebitorsView.cs

示例12: btPrint_Click

 private void btPrint_Click(object sender, System.EventArgs e)
 {
     NoticeNoticeTemplate template = (this.bsNoticeTemplates.get_Current() as NoticeNoticeTemplate) ?? NoticeNoticeTemplate.Null;
     if (this.bsNotices.get_Count() == 0)
     {
         Messages.ShowMessage("Для печати ничего не найдено");
     }
     else if (template == NoticeNoticeTemplate.Null)
     {
         Messages.ShowMessage("Не выбран шаблон");
     }
     else
     {
         template = ObjectWithId.FindById<NoticeNoticeTemplate>(template.Id);
         System.Data.DataTable table = NoticeNotice.GetHeader((ObjectList<NoticeNotice>) this.bsNotices.get_DataSource(), this.cbHideClosedAccounts.get_Checked(), this.cbNoticeInformation.get_Checked());
         table.set_TableName("header");
         System.Data.DataSet set = NoticeNotice.GetReport((ObjectList<NoticeNotice>) this.bsNotices.get_DataSource(), template.Sql);
         if ((set.Tables.get_Count() >= 2) && (set.Tables.get_Item(0).Rows.get_Count() != 0))
         {
             set.Tables.get_Item(0).set_TableName("pays");
             set.Tables.get_Item(1).set_TableName("counter");
             for (int i = 2; i < set.Tables.get_Count(); i = (int) (i + 1))
             {
                 int num2 = (int) (i - 1);
                 set.Tables.get_Item(i).set_TableName("data" + ((int) num2).ToString());
             }
             if (template.IdentityName == "Счет на оплату Ульяновск вариант 3")
             {
                 if (set.Tables.get_Count() > 2)
                 {
                     set.Tables.get_Item(2).set_TableName("organizations");
                 }
                 if (set.Tables.get_Count() > 3)
                 {
                     set.Tables.get_Item(3).set_TableName("rates");
                 }
             }
             StiReport report = new StiReport();
             report.LoadFromString(template.Template);
             report.ReportCacheMode = StiReportCacheMode.Off;
             report.Compile();
             foreach (System.Data.DataTable table2 in set.Tables)
             {
                 report.RegData(table2.get_TableName(), (System.Data.DataTable) table2);
             }
             report.RegData("header", (System.Data.DataTable) table);
             report.ReportCacheMode = StiReportCacheMode.Off;
             report.Compile();
             if (this.chbxIsDesignTemplate.get_Checked())
             {
                 StiOptions.Designer.DontAskSaveReport = true;
                 report.Design(true);
                 if ((report.SaveToString() != template.Template) && (System.Windows.Forms.DialogResult.Yes == Messages.QuestionYesNo(this, "Сохранить изменения в шаблоне?")))
                 {
                     template.Template = report.SaveToString();
                     template.SaveChanges();
                 }
             }
             else
             {
                 report.Render(true);
                 report.Show(true);
             }
         }
     }
 }
开发者ID:u4097,项目名称:SQLScript,代码行数:66,代码来源:PaymentNoticesMainFormOld.cs

示例13: workerExportPdf_DoWork


//.........这里部分代码省略.........
                             {
                                 set.Tables.get_Item(2).set_TableName("organizations");
                             }
                             if (set.Tables.get_Count() > 3)
                             {
                                 set.Tables.get_Item(3).set_TableName("rates");
                             }
                         }
                         using (StiReport report = new StiReport())
                         {
                             report.LoadFromString(@params.NoticeTemplate.Template);
                             report.ReportCacheMode = StiReportCacheMode.Off;
                             report.Compile();
                             foreach (System.Data.DataTable table2 in set.Tables)
                             {
                                 report.RegData(table2.get_TableName(), (System.Data.DataTable) table2);
                             }
                             report.RegData("header", (System.Data.DataTable) table);
                             string accountNumber = notice.AccountNumber;
                             string str5 = System.IO.Path.Combine(info.get_FullName(), accountNumber);
                             if (System.IO.File.Exists(str5 + ".pdf"))
                             {
                                 int num5 = 1;
                                 num5 = 1;
                                 while (System.IO.File.Exists(str5 + "(" + ((int) num5).ToString() + ").pdf"))
                                 {
                                     num5 = (int) (num5 + 1);
                                 }
                                 obj2 = str5;
                                 str5 = string.Concat((object[]) new object[] { obj2, "(", ((int) num5), ")" });
                             }
                             report.ReportCacheMode = StiReportCacheMode.Off;
                             report.Compile();
                             report.Render(false);
                             new StiPdfExportService().ExportPdf(report, str5 + ".pdf");
                         }
                     }
                 }
             }
             catch (System.Exception exception)
             {
                 string message = string.Format("[{0}] Ошибка при выгрузке в PDF: Адрес: {4}, ЛС {3}{1}{2}{1}", new object[] { System.DateTime.Now.ToShortTimeString(), System.Environment.get_NewLine(), exception.get_Message(), notice.AccountNumber, notice.AddressName });
                 this.AddMessageToLogFile(info.get_FullName(), message, "errors");
                 continue;
             }
             int num6 = (int) (((num = (int) (num + 1)) * 100) / notices.get_Count());
             worker.ReportProgress(num6, (int) num);
         }
     }
     else
     {
         BoundaryCollection<long> boundarys = null;
         System.Collections.Generic.Dictionary<long, int[]> dictionary = null;
         foreach (System.Collections.Generic.KeyValuePair<string, System.Collections.Generic.IList<NoticeNotice>> pair in @params.HouseHolderNotices)
         {
             boundarys = new BoundaryCollection<long>(@params.MaxNoticesPerDocument, @params.MinHouseCount);
             dictionary = new System.Collections.Generic.Dictionary<long, int[]>();
             foreach (NoticeNotice notice2 in pair.Value)
             {
                 num = (int) (num + 1);
                 long num7 = (notice2.AddressLevel == 40) ? notice2.ParentAddrId : notice2.AddrId;
                 if (!dictionary.ContainsKey(num7))
                 {
                     dictionary.Add(num7, new int[] { 1, notice2.AddressLevel });
                 }
                 else
开发者ID:u4097,项目名称:SQLScript,代码行数:67,代码来源:PaymentNoticesMainFormOld.cs

示例14: btnPrintRun_Click

 private void btnPrintRun_Click(object sender, System.EventArgs e)
 {
     System.Data.DataSet set;
     int num;
     System.DateTime date = System.DateTime.Now.Date;
     if (!int.TryParse(this.tbMinCountDebt.get_Text(), ref num))
     {
         num = 0;
     }
     bool withNegativeSum = this.cbWithNegativeSum.get_Checked();
     if (this.m_printEnumType < PrintEnum.PrintNoticeClaim)
     {
         set = (this.m_printEnumType == PrintEnum.Print) ? this.m_debtDocument.GetReportDebtAccounts() : ((this.m_printEnumType == PrintEnum.PrintDiff) ? this.m_debtDocument.GetReportDebtAccountsDiff(true, true, false, this.dbPayDiff.Value, num, withNegativeSum, false) : ((this.m_printEnumType == PrintEnum.PrintDiffGroupProvider) ? this.m_debtDocument.GetReportDebtAccountsDiffGroupOrg(true, true, false, this.dbPayDiff.Value, num, withNegativeSum) : ((this.m_printEnumType == PrintEnum.PrintDiffN) ? this.m_debtDocument.GetReportDebtAccountsDiff(false, true, false, this.dbPayDiff.Value, num, withNegativeSum, false) : ((this.m_printEnumType == PrintEnum.PrintDiffN_AllPayment) ? this.m_debtDocument.GetReportDebtAccountsDiff(false, true, false, this.dbPayDiff.Value, num, withNegativeSum, true) : ((this.m_printEnumType == PrintEnum.PrintDiffN_Nach) ? this.m_debtDocument.GetReportDebtAccountsDiff(false, true, false, this.dbPayDiff.Value, num, withNegativeSum, false) : ((this.m_printEnumType == PrintEnum.PrintNewPeriod) ? this.m_debtDocument.GetReportDebtAccountsDiff(true, false, false, this.dbPayDiff.Value, num, withNegativeSum, false) : ((this.m_printEnumType == PrintEnum.PrintNewPeriodPay) ? this.m_debtDocument.GetReportDebtAccountsDiff(true, true, true, this.dbPayDiff.Value, num, withNegativeSum, false) : ((this.m_printEnumType == PrintEnum.PrintService) ? this.m_debtDocument.GetReportDebtAccountServicesDiff(true, true, false, this.dbPayDiff.Value, num, withNegativeSum) : ((this.m_printEnumType == PrintEnum.PrintGroupProviderAndHouseHolder) ? this.m_debtDocument.GetReportDebtGroupProviderAndHouseHolder(this.datePeriodPrintGroupProviderAndHouseHolder.DateBeginIsNull ? System.DateTime.MinValue : this.datePeriodPrintGroupProviderAndHouseHolder.DateBegin, this.datePeriodPrintGroupProviderAndHouseHolder.DateEndIsNull ? System.DateTime.MinValue : this.datePeriodPrintGroupProviderAndHouseHolder.DateEnd) : null)))))))));
         set.Tables.get_Item(0).set_TableName("header");
         set.Tables.get_Item(1).set_TableName("data");
     }
     else
     {
         string message = string.Empty;
         if ((this.dbPayNotices.Value == System.DateTime.MinValue) && (this.m_printEnumType >= PrintEnum.PrintNotice1))
         {
             message = message + "Выберите срок погашения" + System.Environment.get_NewLine();
         }
         if (this.m_SelectedAccounts.get_Count() == 0)
         {
             message = message + "Выберите лицевые счета из выведенного результата" + System.Environment.get_NewLine();
         }
         if (message != string.Empty)
         {
             Messages.ShowWarning(message);
             return;
         }
         set = this.m_debtDocument.GetReportDebtAccountNotices(date.AddDays((double) (1 - date.get_Day())), this.dbPayNotices.Value, this.m_SelectedAccounts, this.cbAddDebtActionNotices.get_Checked(), (this.m_printEnumType == PrintEnum.PrintNoticeClaim) ? ((int) 1) : ((this.m_printEnumType == PrintEnum.PrintNoticeNext) ? ((int) 0) : ((int) ((PrintEnum.PrintDiff + this.m_printEnumType) - PrintEnum.PrintNotice1))), num);
         set.Tables.get_Item(0).set_TableName("header");
         set.Tables.get_Item(1).set_TableName("data");
         if (this.m_printEnumType >= PrintEnum.PrintNotice1)
         {
             foreach (System.Data.DataRow row in set.Tables.get_Item(1).Rows)
             {
                 row.set_Item("monthCount", (PrintEnum.PrintDiff + this.m_printEnumType) - PrintEnum.PrintNotice1);
                 if (this.m_printEnumType == PrintEnum.PrintNoticeNext)
                 {
                     foreach (System.Data.DataRow row2 in set.Tables.get_Item(2).Rows)
                     {
                         if (row.get_Item("debtAccountId").ToString() == row2.get_Item("debtAccountId").ToString())
                         {
                             row.set_Item("monthCount", row2.get_Item("num").ToString());
                         }
                     }
                 }
             }
         }
     }
     StiReport report = new StiReport();
     report.Load((this.m_printEnumType == PrintEnum.Print) ? Resources.Rep_DebtAccounts : ((this.m_printEnumType == PrintEnum.PrintDiff) ? Resources.Rep_DebtAccountsDiffAll : ((this.m_printEnumType == PrintEnum.PrintDiffGroupProvider) ? Resources.Rep_DebtAccountsDiffGroupProvider : ((this.m_printEnumType == PrintEnum.PrintDiffN) ? Resources.Rep_DebtAccountsDiff : ((this.m_printEnumType == PrintEnum.PrintDiffN_AllPayment) ? Resources.Rep_DebtAccountsDiffNach : ((this.m_printEnumType == PrintEnum.PrintDiffN_Nach) ? Resources.Rep_DebtAccountsDiffNach : ((this.m_printEnumType == PrintEnum.PrintNewPeriod) ? Resources.Rep_DebtAccountsDiffNewPeriod : ((this.m_printEnumType == PrintEnum.PrintNewPeriodPay) ? Resources.Rep_DebtAccountsDiffAll : ((this.m_printEnumType == PrintEnum.PrintService) ? Resources.Rep_DebtAccountsDiffService : ((this.m_printEnumType == PrintEnum.PrintGroupProviderAndHouseHolder) ? Resources.Rep_DebtAccountsProviderAndHouseHolder : ((this.m_printEnumType == PrintEnum.PrintNoticeClaim) ? Resources.Rep_PayNoticesClaim : ((this.m_printEnumType >= PrintEnum.PrintNotice1) ? Resources.Rep_PayNoticesDebt : null))))))))))));
     report.Compile();
     report.RegData((System.Data.DataSet) set);
     report.Render(true);
     StiPreviewForm form = new StiPreviewForm(report);
     form.Show();
     form.add_FormClosing(new System.Windows.Forms.FormClosingEventHandler(this.formFormClosing));
 }
开发者ID:u4097,项目名称:SQLScript,代码行数:62,代码来源:DebtAccountPrintForm.cs

示例15: Generate

 public static void Generate(ref RepReport report)
 {
     if ((((report.PlannedDate == Constants.NullDate) || (((System.DateTime.Now.get_Hour() <= 6) || (System.DateTime.Now.get_Hour() >= 20)) && (countWorkedHeavyReports <= 3))) || !RepHeavyReport.AllHeavyReports().Contains(report.ReportTemplateId)) && ((report != null) && (report != RepReport.Null)))
     {
         if ((report.Status != 0) || (report.ReportTemplateId == 0L))
         {
             throw new System.ApplicationException("Отчет непригоден для выполнения");
         }
         RepReportTemplate withTemplate = RepReportTemplate.GetWithTemplate(report.ReportTemplateId);
         if ((withTemplate == null) || (withTemplate.Sql == string.Empty))
         {
             throw new System.ApplicationException("Отчет непригоден для выполнения");
         }
         report.Status = 1;
         report.StartTime = System.DateTime.Now;
         report.SaveChanges();
         countWorkedHeavyReports = (int) (countWorkedHeavyReports + 1);
         try
         {
             System.Data.DataSet set = Mappers.RepReportMapper.GenerateReportDataSet(withTemplate.Sql, report.Id);
             report.FinishTime = System.DateTime.Now;
             System.IO.MemoryStream stream = new System.IO.MemoryStream();
             System.IO.MemoryStream stream2 = new System.IO.MemoryStream();
             lock (LockRepObject)
             {
                 try
                 {
                     if (withTemplate.IsSimpleTable || withTemplate.IsTxt)
                     {
                         report.ds = set;
                         if (report.PlannedDate != Constants.NullDate)
                         {
                             new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter().Serialize(stream, set);
                         }
                     }
                     else
                     {
                         StiReport report2 = new StiReport();
                         report2.LoadFromString(withTemplate.Template);
                         report2.ReportCacheMode = StiReportCacheMode.Off;
                         report2.Compile();
                         report2.RegData((System.Data.DataSet) set);
                         report2.Render(false);
                         stream = new System.IO.MemoryStream(report2.SaveDocumentToByteArray());
                     }
                     if (stream.get_Length() != 0L)
                     {
                         stream2 = new System.IO.MemoryStream();
                         GZipStream stream3 = new GZipStream(stream2, CompressionMode.Compress, true);
                         stream3.Write(stream.ToArray(), 0, (int) ((int) stream.get_Length()));
                         stream3.Close();
                         report.PackedResult = stream2.ToArray();
                     }
                 }
                 catch (System.Exception exception)
                 {
                     System.Windows.Forms.MessageBox.Show(exception.get_Message());
                 }
             }
             report.Status = 2;
             report.SaveChanges();
             report.PackedResult = stream2.ToArray();
         }
         catch (System.Exception)
         {
             report.Status = 0;
             report.SaveChanges();
             throw;
         }
         countWorkedHeavyReports = (int) (countWorkedHeavyReports - 1);
         currentWorkedThread = null;
     }
 }
开发者ID:u4097,项目名称:SQLScript,代码行数:73,代码来源:ReportGenerator.cs


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