本帖最后由 Crystal.Li 于 2021-11-23 17:21 编辑
多个DataSet 如何在这里赋值?
void Document_LocateDataSource(object sender, GrapeCity.ActiveReports.LocateDataSourceEventArgs args)
{
args.Data = ((DataSet)rs);
}
private void tsbtnQry_Click(object sender, EventArgs e)
{
GrapeCity.ActiveReports.PageReport report = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(System.Environment.CurrentDirectory + ReportPath));
GrapeCity.ActiveReports.Document.PageDocument document = new GrapeCity.ActiveReports.Document.PageDocument(report);
document.LocateDataSource += new GrapeCity.ActiveReports.LocateDataSourceEventHandler(Document_LocateDataSource);
for (int i = 0; i < Parameters.Count; i++)
{
if(document.Parameters[((structReportsParameters)Parameters).ParametersID] != null)
{
document.Parameters[((structReportsParameters)Parameters).ParametersID].CurrentValue = ((structReportsParameters)Parameters).ParametersValue;
}
}
viewer2.LoadDocument(document);
}
|
|