gpt4 book ai didi

visual-studio-2010 - SQL Reporting Services 报告仅在第二次单击时加载

转载 作者:行者123 更新时间:2023-12-04 23:24:20 24 4
gpt4 key购买 nike

我有一个本地 .rdlc 报告被操纵以在单击按钮时显示,但由于某种原因,该报告仅显示在第二个按钮单击事件中。我不知道为什么第一次单击按钮时报告没有显示......这是我在按钮的单击事件上调用的函数。

private void ShowReport(string accountingCompanyId, string companyId, string approvalUnitId, DateTime startDate, DateTime finishDate, string supplierId,
string documentNumber, string documentType, string documentState, string costCenterId, string chargingKeyId,
string dim1Value, string dim1Description, string dim1Id, string dim2Value, string dim2Description, string dim2Id,
string dim3Value, string dim3Description, string dim3Id, bool showDetails) {

//this.ReportViewer1.Reset();

//Set report mode for local processing.
this.ReportViewer1.ProcessingMode = ProcessingMode.Local;

ISettingsReader settingsReader = SettingsReaderFactory.Instance.CreateSettingsReader();
this.ReportViewer1.LocalReport.ReportPath = settingsReader.GetSetting("ReportViewer", "FinancialReportPath" + (showDetails ? "" : "Small"), true, null);

ReportsBL reports = new ReportsBL();

// Clear out any previous datasources.
this.ReportViewer1.LocalReport.DataSources.Clear();

// Load the company dataSource.
DataTable company = reports.GetCompanyDataSet(accountingCompanyId).Tables[0];
ReportDataSource dataSourceCompany = new ReportDataSource(company.TableName, company);
this.ReportViewer1.LocalReport.DataSources.Add(dataSourceCompany);

// Load the dataSource.
DataTable report = reports.GetReportFinanceiroSmallDataSet(companyId, startDate, finishDate, chargingKeyId, costCenterId, documentNumber, documentType, dim1Value, dim2Value, dim3Value, dim1Id, dim2Id, dim3Id, supplierId, approvalUnitId, documentState, accountingCompanyId).Tables[0];
ReportDataSource dataSourceReport = new ReportDataSource(report.TableName, report);
this.ReportViewer1.LocalReport.DataSources.Add(dataSourceReport);

this.ReportViewer1.LocalReport.Refresh();

this.pnlReport.Visible = true;
}

奇怪的是,如果我取消注释 this.ReportViewer.Reset();那么无论我生成的点击次数如何,报告都不会显示......有人知道这是否正常吗?如何解决这个问题?
提前致谢,

最佳答案

我想问题可能是在呈现页面后触发了 click 事件。尝试调用 Page_Load 中的方法事件。

protected void Page_Load(object sender, EventArgs e)
{
if (IsCallback)
{
ShowReport(
// params
);
}
}

如果这样做有效,您就知道它与执行顺序有关。

关于visual-studio-2010 - SQL Reporting Services 报告仅在第二次单击时加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15747854/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com