本文整理汇总了C#中StiReport.Show方法的典型用法代码示例。如果您正苦于以下问题:C# StiReport.Show方法的具体用法?C# StiReport.Show怎么用?C# StiReport.Show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StiReport
的用法示例。
在下文中一共展示了StiReport.Show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateNewReport
public static void GenerateNewReport(DataTable tbl, string path, string caption)
{
StiReport report = new StiReport();
//Add tbl to datastore
report.RegData("tbl", tbl);
//Fill dictionary
report.Dictionary.Synchronize();
report.Dictionary.DataSources[0].Name = "tbl";
report.Dictionary.DataSources[0].Alias = "tbl";
//StiPage page = report.Pages[0];
foreach (StiPage page in report.Pages)
{
//Create header
if (report.Pages.IndexOf(page) == 0)
{
StiText header = new StiText(new RectangleD(0, 0, page.Width, page.Height / 20), caption);
StiText period = new StiText(new RectangleD(0, page.Height / 20, page.Width, page.Height / 20), tbl.TableName);
header.HorAlignment = StiTextHorAlignment.Center;
header.Font = new Font("Arial", 22.5f);
period.HorAlignment = StiTextHorAlignment.Center;
header.Font = new Font("Arial", 12f);
page.Components.Add(header);
page.Components.Add(period);
header.Render();
period.Render();
}
//Create HeaderBand
StiHeaderBand headerBand = new StiHeaderBand();
headerBand.Height = 0.5;
headerBand.Name = "HeaderBand";
page.Components.Add(headerBand);
//Create Databand
StiDataBand dataBand = new StiDataBand();
dataBand.DataSourceName = "tbl";
dataBand.Height = 0.5;
dataBand.Name = "DataBand";
page.Components.Add(dataBand);
//Create texts
double pos = 0;
double columnWidth = StiAlignValue.AlignToMinGrid(page.Width / tbl.Columns.Count, 0.1, true);
int nameIndex = 1;
foreach (DataColumn dataColumn in tbl.Columns)
{
//Create text on header
StiText headerText = new StiText(new RectangleD(pos, page.Height / 10, columnWidth, 0.5));
headerText.Text.Value = dataColumn.Caption;
headerText.HorAlignment = StiTextHorAlignment.Center;
headerText.Name = "HeaderText" + nameIndex.ToString();
headerText.Brush = new StiSolidBrush(Color.LightGray);
headerText.Border.Side = StiBorderSides.All;
headerBand.Components.Add(headerText);
//Create text on Data Band
StiText dataText = new StiText(new RectangleD(pos, 0, columnWidth, 0.5));
dataText.Text.Value = "{tbl." + Stimulsoft.Report.CodeDom.StiCodeDomSerializator.ReplaceSymbols(dataColumn.ColumnName) + "}";
dataText.Name = "DataText" + nameIndex.ToString();
dataText.Border.Side = StiBorderSides.All;
//Add highlight
StiCondition condition = new StiCondition();
condition.BackColor = Color.DarkGray;
condition.TextColor = Color.Black;
condition.Expression = "(Line & 1) == 1";
condition.Item = StiFilterItem.Expression;
dataText.Conditions.Add(condition);
dataBand.Components.Add(dataText);
pos = pos + columnWidth;
nameIndex++;
}
//Create FooterBand
StiFooterBand footerBand = new StiFooterBand();
footerBand.Height = 0.5;
footerBand.Name = "FooterBand";
page.Components.Add(footerBand);
//Create text on footer
StiText footerText = new StiText(new RectangleD(0, 0, page.Width, 0.5));
footerText.Text.Value = "Всего записей - {Count()}";
footerText.HorAlignment = StiTextHorAlignment.Right;
footerText.Name = "FooterText";
footerText.Brush = new StiSolidBrush(Color.Gray);
footerBand.Components.Add(footerText);
report.Show();
}
//.........这里部分代码省略.........
示例2: ShowCoordinationVolumesDefectsReport
public static void ShowCoordinationVolumesDefectsReport(System.Windows.Forms.IWin32Window owner, long inspectionId)
{
System.Data.DataSet ujfCoordinationVolumesDefectsReport = Mappers.SimpleReportMapper.GetUjfCoordinationVolumesDefectsReport(inspectionId);
ujfCoordinationVolumesDefectsReport.Tables.get_Item(0).set_TableName("CoordinationDefects");
StiReport report = new StiReport();
report.Load(Resources.UJFListCoordinationVolumesDefects);
report.Compile();
report.RegData((System.Data.DataSet) ujfCoordinationVolumesDefectsReport);
report.Show((System.Windows.Forms.IWin32Window) owner);
}
示例3: ShowInspectionActPystografMinReport
public static void ShowInspectionActPystografMinReport(System.Windows.Forms.IWin32Window owner, long inspectionId)
{
System.Data.DataSet ujfApartmentHouseInspectionActPystografMinReport = Mappers.SimpleReportMapper.GetUjfApartmentHouseInspectionActPystografMinReport(inspectionId);
ujfApartmentHouseInspectionActPystografMinReport.Tables.get_Item(0).set_TableName("InspectionInfo");
StiReport report = new StiReport();
report.Load(Resources.UjfApartmentHouseInspectionAct_PystografMin);
report.Compile();
report.RegData((System.Data.DataSet) ujfApartmentHouseInspectionActPystografMinReport);
report.Show((System.Windows.Forms.IWin32Window) owner);
}
示例4: ShowDialog
public static void ShowDialog(System.Windows.Forms.IWin32Window owner, System.DateTime date, ObjectList<LocalAddress> addresses)
{
System.Data.DataSet accountServiceByAddressesReport = GroupOperation.GetAccountServiceByAddressesReport(date, addresses);
accountServiceByAddressesReport.Tables.get_Item(0).set_TableName("dataAccountServices");
accountServiceByAddressesReport.Tables.get_Item(1).set_TableName("date");
StiReport report = new StiReport();
report.Load(Resources.Rep_AccountServicesByAddresses);
report.Compile();
report.RegData((System.Data.DataSet) accountServiceByAddressesReport);
report.Show((System.Windows.Forms.IWin32Window) owner);
}
示例5: ShowDefectsDelayWorkReport
public static void ShowDefectsDelayWorkReport(System.Windows.Forms.IWin32Window owner, long inspectionId)
{
System.Data.DataSet ujfApartmentHouseDefectsDelayWorkReport = Mappers.SimpleReportMapper.GetUjfApartmentHouseDefectsDelayWorkReport(inspectionId);
ujfApartmentHouseDefectsDelayWorkReport.Tables.get_Item(0).set_TableName("DefectsInfo");
ujfApartmentHouseDefectsDelayWorkReport.Tables.get_Item(1).set_TableName("HouseInfo");
StiReport report = new StiReport();
report.Load(Resources.UjfApartmentHouseInspectionDefectsDelayWorksByInspection);
report.Compile();
report.RegData((System.Data.DataSet) ujfApartmentHouseDefectsDelayWorkReport);
report.Show((System.Windows.Forms.IWin32Window) owner);
}
示例6: ShowExpiredAndCurrentDefectsReport
public static void ShowExpiredAndCurrentDefectsReport(System.Windows.Forms.IWin32Window owner, long inspectionId, System.DateTime period)
{
System.Data.DataSet ujfListExpiredAndCurrentDefectsReport = Mappers.SimpleReportMapper.GetUjfListExpiredAndCurrentDefectsReport(inspectionId, period);
ujfListExpiredAndCurrentDefectsReport.Tables.get_Item(0).set_TableName("CurentDefects");
ujfListExpiredAndCurrentDefectsReport.Tables.get_Item(1).set_TableName("ExpiredDefects");
ujfListExpiredAndCurrentDefectsReport.Tables.get_Item(2).set_TableName("Period");
StiReport report = new StiReport();
report.Load(Resources.ListExpiredAndCurrentDefects);
report.Compile();
report.RegData((System.Data.DataSet) ujfListExpiredAndCurrentDefectsReport);
report.Show((System.Windows.Forms.IWin32Window) owner);
}
示例7: ShowDialog
public static void ShowDialog(System.Windows.Forms.IWin32Window owner, PayRequest request)
{
System.Data.DataTable dataTableByRequestIdFormSpScheme;
System.Data.DataTable dataTableById;
System.Data.DataTable dataTableByRequestId = PayRequestBenefit.GetDataTableByRequestId(request);
if ((dataTableByRequestId == null) || (dataTableByRequestId.Rows.get_Count() == 0))
{
System.Data.DataRow row = dataTableByRequestId.Rows.Add((object[]) new object[0]);
row.set_Item("benefitName", "Льготы отсутствуют");
row.set_Item("PersonsCount", 0);
}
if (request.Id > 0L)
{
dataTableByRequestIdFormSpScheme = PayRequestService.GetDataTableByRequestId(request);
}
else
{
dataTableByRequestIdFormSpScheme = PayRequestService.GetDataTableByRequestIdFormSpScheme(request);
}
StiReport report = new StiReport();
string valueByName = Setting.GetValueByName("Глобальные установки", "Шаблон квитанции");
string info = "";
if (valueByName == "ReceiptReportSakhalin")
{
report.Load(Resources.ReceiptReportSakhalin);
long accountId = 0L;
if (long.TryParse(request.AccountId, ref accountId) && (accountId > 0L))
{
info = Organization.FindHouseHolderByAccountId(accountId).Info;
}
}
else
{
bool flag = (bool) ((Setting.GetValueByName("Параметры квитанций", "Печатать в кассе колонку ЕДК") ?? "").ToUpper() == "ДА");
report.Load(flag ? Resources.ReceiptReportWithEDK : Resources.ReceiptReport);
info = (Organization.CentralOffice == Organization.Null) ? ((string) "Отсутсвует ОРГАНИЗАЦИЯ в глобальных установках") : Organization.CentralOffice.Info;
}
report.Compile();
report.Dictionary.Variables.Add("orgInfo", info);
report.Dictionary.Variables.Add("diffEDKMonth", ("Да" == (Setting.GetValueByName("Параметры расчетов", "Использовать ЕДК за предыдущий период") ?? string.Empty)) ? -1 : 0);
if (request.Id > 0L)
{
dataTableById = PayRequest.GetDataTableById(request);
}
else
{
dataTableById = PayRequest.GetDataTableByIdFormSpScheme(request);
}
report.RegData("dataRequests", (System.Data.DataTable) dataTableById);
report.RegData("dataRequestBenefits", (System.Data.DataTable) dataTableByRequestId);
report.RegData("dataRequestServices", (System.Data.DataTable) dataTableByRequestIdFormSpScheme);
report.Show((System.Windows.Forms.IWin32Window) owner);
}
示例8: ShowDialog
public static void ShowDialog(System.Windows.Forms.IWin32Window owner, ObjectList<PayRequest> requests, string caption, bool byCashier)
{
StiReport report = new StiReport {
AutoLocalizeReportOnRun = true
};
report.Load(byCashier ? Resources.ReceiptTerminalReportByCashier : Resources.ReceiptTerminalReport);
report.Compile();
System.Data.DataTable table = Mappers.PayRequestMapper.ObjectListToDateTable(requests);
report.RegData("dataRequests", (System.Data.DataTable) table);
System.Data.DataTable table2 = new System.Data.DataTable("captionTable");
table2.Columns.Add("caption");
table2.Rows.Add((object[]) new object[] { caption });
report.RegData(table2.get_TableName(), (System.Data.DataTable) table2);
report.Show((System.Windows.Forms.IWin32Window) owner);
}
示例9: CalcHouseCounterServicesReportFor354
public static void CalcHouseCounterServicesReportFor354(System.Windows.Forms.IWin32Window owner, long calcId, System.DateTime period, long serviceId)
{
ObjectList<RepReportTemplate> list = RepReportTemplate.FindByName("09.01.01 Детализация по коллективным приборам учета");
if (list.get_Count() > 0)
{
RepReportTemplate template = list.get_Item(0);
System.Data.SqlClient.SqlParameter[] parameters = new System.Data.SqlClient.SqlParameter[3];
parameters[0] = new System.Data.SqlClient.SqlParameter("@calcId", System.Data.SqlDbType.BigInt);
parameters[0].set_Value((long) calcId);
parameters[1] = new System.Data.SqlClient.SqlParameter("@period", System.Data.SqlDbType.DateTime);
parameters[1].set_Value(period);
parameters[2] = new System.Data.SqlClient.SqlParameter("@serviceId", System.Data.SqlDbType.BigInt);
if (serviceId > 0L)
{
parameters[2].set_Value((long) serviceId);
}
else
{
parameters[2].set_Value(System.DBNull.Value);
}
System.Data.DataSet set = DALSql.ExecuteDataSet("exec " + template.Sql + " @calcId, @period, @serviceId", parameters);
StiReport report = new StiReport();
report.LoadFromString(template.Template);
report.Compile();
report.RegData((System.Data.DataSet) set);
if (User.IsMemberOf(RightsEnum.ОтчетыРедактированиеШаблона))
{
report.Design(true, (System.Windows.Forms.IWin32Window) owner);
if (System.Windows.Forms.DialogResult.Yes == Messages.QuestionYesNo(owner, "Сохранить изменения в шаблоне?"))
{
template.Template = report.SaveToString();
template.SaveChanges();
}
}
else
{
report.Show((System.Windows.Forms.IWin32Window) owner);
}
}
}
示例10: ShowReport
internal static void ShowReport(StiReport report, bool wpf, bool design, DataSet dtSet,
string vrReportAutor, string vrReportDescricao, string vrEmpresa, string vrCnc,
string vrTitulo, string vrUsuario, string vrFiltros, string vrImage)
{
report.ReportAuthor = vrReportAutor;
report.ReportDescription = vrReportDescricao;
if (vrImage == null || vrImage == "")
report.Dictionary.Variables["vrEmpresa"].ValueObject = vrEmpresa;
else
{
if (System.IO.File.Exists(vrImage))
{
report.Dictionary.Variables["vrEmpresa"].ValueObject = sEspacos + vrEmpresa;
StiImage stiImage = report.GetComponents()["imgLogo"] as StiImage;
Image myImage = Image.FromFile(vrImage);
stiImage.Image = myImage;
}
}
report.Dictionary.Variables["vrCnc"].ValueObject = vrCnc;
report.Dictionary.Variables["vrTitulo"].ValueObject = vrTitulo;
report.Dictionary.Variables["vrUsuario"].ValueObject = vrUsuario;
report.Dictionary.Variables["vrFiltros"].ValueObject = vrFiltros;
report.RegData(dtSet);
report.Compile();
if (design)
{
if (wpf)
report.DesignWithWpf();
else
report.Design();
}
else
{
if (wpf)
report.ShowWithWpf();
else
report.Show();
}
}
示例11: tsbRunReport_Click
private void tsbRunReport_Click(object sender, System.EventArgs e)
{
if (this.m_SearchWorker.get_IsBusy())
{
if (System.Windows.Forms.MessageBox.Show("Вы хотите отменить выполнение очёта?", "Подтверждение отмены", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Exclamation) != System.Windows.Forms.DialogResult.No)
{
this.m_SearchWorker.CancelAsync();
try
{
ReportGenerator.Chancel();
}
catch (System.Exception)
{
}
this.tsbRunReport.set_Text("Выполнить");
this.m_report.Status = 3;
this.m_report.Error = "Выполнение этого отчёта было отменено пользователем";
this.tslbRunReportImageLoading.set_Visible(false);
}
}
else
{
try
{
if (this.cbWithRenderParametres.get_Checked())
{
RepReport report = this.InsertReportIntoGeneratorQueue();
if ((report != null) && (report != RepReport.Null))
{
if ((report.Status != 0) || (report.ReportTemplateId == 0L))
{
throw new System.ApplicationException("Отчет непригоден для выполнения (id=" + ((long) report.Id) + ")");
}
RepReportTemplate withTemplate = RepReportTemplate.GetWithTemplate(report.ReportTemplateId);
if ((withTemplate == null) || (withTemplate.Sql == string.Empty))
{
throw new System.ApplicationException("Отчет непригоден для выполнения (id=" + ((long) report.Id) + ")");
}
try
{
report.Status = 1;
report.SaveChanges();
System.Data.DataSet set = Mappers.RepReportMapper.GenerateReportDataSet(withTemplate.Sql, report.Id);
StiReport report2 = new StiReport();
report2.LoadFromString(withTemplate.Template);
report2.RegData((System.Data.DataSet) set);
StiOptions.Designer.DontAskSaveReport = true;
report2.Show((System.Windows.Forms.Form) this);
}
catch (System.Exception exception)
{
AIS.SN.UI.Messages.ShowException(this, exception);
}
this.UpdateBingingReports();
}
}
else
{
this.tslbRunReportImageLoading.set_Visible(true);
this.tsbRunReport.set_Text("Отменить");
this.m_report = this.InsertReportIntoGeneratorQueue();
if (this.m_report == null)
{
this.tslbRunReportImageLoading.set_Visible(false);
}
else
{
this.m_SearchWorker.RunWorkerAsync();
}
}
}
catch (System.Exception)
{
this.tsbRunReport.set_Text("Выполнить");
this.tslbRunReportImageLoading.set_Visible(false);
}
}
}
示例12: ShowReport
private void ShowReport(bool isPrint, RepReport report)
{
System.IO.MemoryStream stream = null;
System.Data.DataSet ds;
string str;
string str2;
RepReportTemplate template;
System.IO.FileInfo info;
string str3;
DbFileFormat format;
if (report.PackedResult != null)
{
stream = new System.IO.MemoryStream(report.PackedResult);
}
GZipStream stream2 = null;
if (stream != null)
{
stream2 = new GZipStream(stream, CompressionMode.Decompress);
}
if (report.IsSimpleTable || report.IsTxt)
{
if (isPrint)
{
System.Windows.Forms.MessageBox.Show("Невозможно распечатать данный тип отчета:" + System.Environment.get_NewLine() + report.ReportTemplateName);
return;
}
ds = null;
if (report.PlannedDate != AIS.SN.Model.Constants.NullDate)
{
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
ds = (System.Data.DataSet) formatter.Deserialize(stream2);
}
else
{
ds = report.ds;
}
if (stream2 != null)
{
stream2.Close();
}
if (((ds.Tables.get_Count() < 2) || (ds.Tables.get_Item(0).Rows.get_Count() == 0)) || (ds.Tables.get_Item(1).Rows.get_Count() == 0))
{
System.Windows.Forms.MessageBox.Show("Отчет пуст:" + System.Environment.get_NewLine() + report.ReportTemplateName);
return;
}
str = ds.Tables.get_Item(0).Rows.get_Item(0).get_Item("filename").ToString();
try
{
str2 = str.Substring(0, str.LastIndexOf(@"\"));
str = str.Substring((int) (str.LastIndexOf(@"\") + 1));
}
catch (System.Exception)
{
str2 = @"C:\";
str = "file.dbf";
}
if (System.IO.Directory.Exists(str2))
{
this.sfdDBF.set_InitialDirectory(str2);
}
this.sfdDBF.set_FileName(str);
this.sfdDBF.set_DefaultExt(report.IsTxt ? ((string) "txt") : ((string) "dbf"));
template = RepReportTemplate.FindById(report.ReportTemplateId);
if (this.sfdDBF.ShowDialog(this) != System.Windows.Forms.DialogResult.OK)
{
return;
}
str = this.sfdDBF.get_FileName();
if (System.IO.File.Exists(str) && !template.IsAppending)
{
System.IO.File.Delete(str);
}
info = new System.IO.FileInfo(str);
System.Guid guid = System.Guid.NewGuid();
ds.Tables.get_Item(1).set_TableName('A' + guid.ToString().Substring(0, 7).ToUpper());
str2 = info.get_DirectoryName() + ((info.get_DirectoryName() == "") ? ((string) "") : ((string) @"\"));
if (!report.IsSimpleTable)
{
goto Label_04FF;
}
str3 = str;
if (template.IsAppending && info.get_Exists())
{
info.MoveTo(str2 + ds.Tables.get_Item(1).get_TableName() + ".DBF");
}
format = DbFileFormat.dBase3;
string str5 = ds.Tables.get_Item(0).Rows.get_Item(0).get_Item("fileformat").ToString();
if (str5 != null)
{
if (str5 == "dBase3")
{
format = DbFileFormat.dBase3;
}
else if (str5 == "dBase4")
{
format = DbFileFormat.dBase4;
}
else if (str5 == "dBase5")
{
format = DbFileFormat.dBase5;
//.........这里部分代码省略.........
示例13: tsBtnIndicationSertificate_Click
private void tsBtnIndicationSertificate_Click(object sender, System.EventArgs e)
{
System.Data.DataSet counterIndincationReport = Mappers.SimpleReportMapper.GetCounterIndincationReport(this.GetCurrentCounter().Id);
counterIndincationReport.Tables.get_Item(0).set_TableName("header");
counterIndincationReport.Tables.get_Item(1).set_TableName("constants");
counterIndincationReport.Tables.get_Item(2).set_TableName("data");
counterIndincationReport.Tables.get_Item(3).set_TableName("serviceTypes");
StiReport report = new StiReport();
report.Load(Resources.Rep_CounterIndication);
report.Compile();
report.RegData((System.Data.DataSet) counterIndincationReport);
report.Show((System.Windows.Forms.IWin32Window) this);
}
示例14: 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());
}
}
}
示例15: StiReport
private void книгаУчетаДоходовИРасходовToolStripMenuItem_Click(object sender, EventArgs e)
{
StiConfig.LoadLocalization("ru.xml");
var report = new StiReport();
StiOptions.Dictionary.BusinessObjects.MaxLevel = 0;
report.Load(Path.Combine(Application.StartupPath, "Reports\\kniga.mrt"));
var opers = new AllOperationRepository().GetAllOperation(BeginDate, EndDate).ToList();
report.RegData("Operations", opers);
var allopers = new AllOperationRepository().GetAllOperation(new DateTime(Year, 1, 1, 0, 0, 0), EndDate).ToList();
int count = new AllOperationRepository().GetAllOperation(new DateTime(Year, 1, 1, 0, 0, 0), BeginDate.AddSeconds(-1)).Count();
report.Dictionary.Variables.Add("BeginDate", BeginDate);
report.Dictionary.Variables.Add("EndDate", EndDate);
report.Dictionary.Variables.Add("StrPeriod", _strperiod);
report.Dictionary.Variables.Add("StrDate", _strdate);
report.Dictionary.Variables.Add("CountPosition", count);
report.Dictionary.Variables.Add("SummaTotalPrihod", allopers.Sum(c=>c.SummaDebet));
report.Dictionary.Variables.Add("SummoTotalRashod", allopers.Sum(c=>c.SummaKredit));
if (ApplicationDeployment.IsNetworkDeployed)
{
report.Show(true);
}
else
{
report.Design();
}
}