本文整理汇总了C#中StiReport.SaveToString方法的典型用法代码示例。如果您正苦于以下问题:C# StiReport.SaveToString方法的具体用法?C# StiReport.SaveToString怎么用?C# StiReport.SaveToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StiReport
的用法示例。
在下文中一共展示了StiReport.SaveToString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
}
}
示例2: tsbDesigner_Click
private void tsbDesigner_Click(object sender, System.EventArgs e)
{
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.Design(true, (System.Windows.Forms.IWin32Window) this);
if (System.Windows.Forms.DialogResult.Yes == AIS.SN.UI.Messages.QuestionYesNo(this, "Сохранить изменения в шаблоне?"))
{
withTemplate.Template = report2.SaveToString();
withTemplate.SaveChanges();
}
}
catch (System.Exception exception)
{
AIS.SN.UI.Messages.ShowException(this, exception);
}
this.UpdateBingingReports();
}
}
示例3: btnSave_Click
private void btnSave_Click(object sender, System.EventArgs e)
{
RepReportGroup group = ((RepReportGroup) this.bsReportGroup.get_Current()) ?? RepReportGroup.Null;
if (group == RepReportGroup.Null)
{
new BalloonWindow("Не выбрана группа!").Show(this.btnSave);
}
else if (this.tbProcedureName.get_Text() == "")
{
new BalloonWindow("Не задано название процедуры!").Show(this.btnSave);
}
else if (this.tbReportName.get_Text() == "")
{
new BalloonWindow("Не задано название отчета!").Show(this.btnSave);
}
else if ((((this.selectFileName.SelectedFileName == string.Empty) && this.m_repReportTemplate.IsNew) && (!this.chbxIsSimpleTable.get_Checked() && !this.chbxIsTxt.get_Checked())) && !this.chbxDefault.get_Checked())
{
new BalloonWindow("Не задан шаблон!").Show(this.btnSave);
}
else
{
bool flag = false;
if ((((this.selectFileName.SelectedFileName == string.Empty) && !this.m_repReportTemplate.IsNew) && (!this.chbxIsSimpleTable.get_Checked() && !this.chbxIsTxt.get_Checked())) && (!this.chbxDefault.get_Checked() && !this.cbApartmentArea.get_Checked()))
{
if (Messages.QuestionYesNo(this, "Шаблон не изменен! Продолжить?") != System.Windows.Forms.DialogResult.Yes)
{
return;
}
flag = true;
}
else if ((this.selectFileName.SelectedFileName != string.Empty) && !this.chbxDefault.get_Checked())
{
StiReport report = new StiReport();
report.Load(this.selectFileName.SelectedFileName);
this.m_repReportTemplate.Template = report.SaveToString();
}
if (this.chbxDefault.get_Checked())
{
StiReport report2 = new StiReport();
this.rbBook.set_Enabled(true);
this.rbAlbum.set_Enabled(true);
if (this.rbBook.get_Checked())
{
report2.Load(Resources.EmptyPortraitReportTemplate);
this.m_repReportTemplate.Template = report2.SaveToString();
}
if (this.rbAlbum.get_Checked())
{
report2.Load(Resources.EmptyLandscapeReportTemplate);
this.m_repReportTemplate.Template = report2.SaveToString();
}
}
this.m_repReportTemplate.Sql = this.tbProcedureName.get_Text();
this.m_repReportTemplate.ReportGroupId = group.Id;
this.m_repReportTemplate.Name = this.tbReportName.get_Text();
this.m_repReportTemplate.IsSimpleTable = this.chbxIsSimpleTable.get_Checked();
this.m_repReportTemplate.IsTxt = this.chbxIsTxt.get_Checked();
this.m_repReportTemplate.IsExcel = this.chbxIsExcel.get_Checked();
this.m_repReportTemplate.WithRenderParameters = this.chbxWithRenderParametres.get_Checked();
this.chbxIsSimpleTable.set_Enabled(false);
this.m_repReportTemplate.OrgsHouseHolders = this.chbxHouseHolders.get_Checked();
this.m_repReportTemplate.OrgsServiceHouseHolders = this.chbxServiceHouseHolders.get_Checked();
this.m_repReportTemplate.OrgsServiceProviders = this.chbxServiceProviders.get_Checked();
this.m_repReportTemplate.OrgsResourceProviders = this.chbxResourceProviders.get_Checked();
this.m_repReportTemplate.OrgsCashlessTransferrers = this.chbxOrgsCashlessTransferrers.get_Checked();
this.m_repReportTemplate.ServiceTypes = this.chbxServiceTypes.get_Checked();
this.m_repReportTemplate.Services = this.chbxServices.get_Checked();
this.m_repReportTemplate.ApartmentTypes = this.chbxApartmentTypes.get_Checked();
this.m_repReportTemplate.HouseTypes = this.chbxHouseTypes.get_Checked();
this.m_repReportTemplate.ConvenienceTypes = this.chbxConvenienceTypes.get_Checked();
this.m_repReportTemplate.Addresses = this.chbxAddresses.get_Checked();
this.m_repReportTemplate.Benefits = this.chbxBenefits.get_Checked();
this.m_repReportTemplate.Debt = this.chbxDebt.get_Checked();
this.m_repReportTemplate.ExistsBenefitDiff = this.chbxBenefitDiff.get_Checked();
this.m_repReportTemplate.CanonicalServices = this.chbxCanonicalServices.get_Checked();
this.m_repReportTemplate.CalcOperationGroups = this.chbxCalcOperationGroups.get_Checked();
this.m_repReportTemplate.MinSumm = this.chbxMinSumm.get_Checked();
this.m_repReportTemplate.DatePeriod = this.chbxDatePeriod.get_Checked();
this.m_repReportTemplate.PaymentAgentTypes = this.chbxPaymentAgentTypes.get_Checked();
this.m_repReportTemplate.Terminals = this.chbxTerminals.get_Checked();
this.m_repReportTemplate.TypeRecalcReasons = this.chbxRecalcReasons.get_Checked();
this.m_repReportTemplate.IsAppending = this.chbxIsAppending.get_Checked();
this.m_repReportTemplate.IsEnable = this.chbxIsEnable.get_Checked();
this.m_repReportTemplate.IsAvailableInProvider = this.cbAvailableInProvider.get_Checked();
this.m_repReportTemplate.WithoutBankrupt = this.chbxWithoutBankrupt.get_Checked();
this.m_repReportTemplate.WithoutClosesApartments = this.chbxWithoutCloseApartment.get_Checked();
this.m_repReportTemplate.OrgsBank = this.chbxBenefitBank.get_Checked();
this.m_repReportTemplate.AccountProperty = this.cbAccountProperty.get_Checked();
this.m_repReportTemplate.OrgsPaymentAgents = this.cbPaymentAgent.get_Checked();
this.m_repReportTemplate.OrgsApartmentArea = this.cbApartmentArea.get_Checked();
this.m_repReportTemplate.CityBorough = this.cbCityBorough.get_Checked();
this.m_repReportTemplate.Period = this.cbPeriod.get_Checked();
if (this.cbFasetFilter.get_Checked())
{
this.m_repReportTemplate.FasetFilterId = (int) ((int) this.cmbFilterFaset.get_SelectedValue());
}
else
{
this.m_repReportTemplate.FasetFilterId = Faset.Null.Id;
}
//.........这里部分代码省略.........
示例4: 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);
}
}
}
}
示例5: tsbDesigner_Click
private void tsbDesigner_Click(object sender, System.EventArgs e)
{
System.Data.DataSet set = this.m_debtDocument.GenerateReportDebtSetNotices(this.m_DebtListNotices.procedureName, this.dbPayNotices.Value, this.cbAddDebtActionNotices.get_Checked(), (int) this.MinCountDebt.Value, (int) this.ColDayPerformance.Value, this.m_DebtListNotices.Id, this.m_SelectedAccounts);
set.Tables.get_Item(0).set_TableName("data");
StiReport report = new StiReport();
DebtListNotices notices = ObjectWithId.FindById<DebtListNotices>(this.m_DebtListNotices.Id);
report.LoadFromString(notices.template);
report.RegData((System.Data.DataSet) set);
StiOptions.Designer.DontAskSaveReport = true;
report.Design(true, (System.Windows.Forms.IWin32Window) this);
if (System.Windows.Forms.DialogResult.Yes == Messages.QuestionYesNo(this, "Сохранить изменения в шаблоне?"))
{
notices.template = report.SaveToString();
notices.SaveChanges();
}
}
示例6: tsbDesigner_Click
private void tsbDesigner_Click(object sender, System.EventArgs e)
{
StiReport report = new StiReport();
AccountReportType byName = AccountReportType.GetByName("Личный кабинет. Регистрация");
report.LoadFromString(byName.Template);
StiOptions.Designer.DontAskSaveReport = true;
report.Design(true, (System.Windows.Forms.IWin32Window) this);
if (System.Windows.Forms.DialogResult.Yes == Messages.QuestionYesNo(this, "Сохранить изменения в шаблоне?"))
{
byName.Template = report.SaveToString();
byName.SaveChanges();
}
}