这里 aspx页面后边的.cs 里边找代码
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
return;
}
GrapeCity.ActiveReports.PageReport report1 = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(Server.MapPath("../") + "Reports/1.rdlx"));
report1.Document.LocateDataSource += new GrapeCity.ActiveReports.LocateDataSourceEventHandler(Document_LocateDataSource);
//WebViewer1.PdfExportOptions.FitWindow = false;
//WebViewer1.PdfExportOptions.DisplayMode = GrapeCity.ActiveReports.Export.Pdf.Section.DisplayMode.Outlines;
this.WebViewer1.FlashViewerOptions.ResourceLocale = "zh_CN";
this.WebViewer1.ViewerType = GrapeCity.ActiveReports.Web.ViewerType.FlashViewer;
WebViewer1.Report = report1;
}
void Document_LocateDataSource(object sender, GrapeCity.ActiveReports.LocateDataSourceEventArgs args)
{
if (args.DataSourceName == "DataSource1")
{
if (args.DataSetName == "DataSet1")
{
args.Data = GetData();
}
}
}
private DataTable GetData()
{
DataTable dt = new DataTable();
dt.Columns.Add("Col1");
dt.Columns.Add("Col2");
dt.Columns.Add("Col3");
dt.Rows.Add(1, 1, 1);
dt.Rows.Add(2, 1, 1);
dt.Rows.Add(3, 1, 1);
dt.Rows.Add(4, 1, 1);
dt.Rows.Add(5, 1, 1);
dt.Rows.Add(6, 1, 1);
return dt;
} |
|