Download ActiveReports 7 User Guide
Transcript
ActiveReports 7 User Guide
310
'ActiveReports raises this event when it cannot locate a report's data source in
the usual ways.
Private Sub runtime_LocateDataSource(ByVal sender As Object, ByVal args As
GrapeCity.ActiveReports.LocateDataSourceEventArgs) Handles
Runtime.LocateDataSource
Dim dl = New DataLayer
args.Data = dl.DataSetData.Tables("Products")
End Sub
To
write
the
code
in
C#
C#
code.
Paste
INSIDE
the
Form_Load
event.
LoadReport();
C#
code.
Paste
INSIDE
the
class
declaration
of
the
form.
private void LoadReport()
{
System.IO.FileInfo rptPath = new
System.IO.FileInfo("..\\..\\YourReportName.rdlx");
//Create a report definition that loads an existing report.
GrapeCity.ActiveReports.PageReport definition = new
GrapeCity.ActiveReports.PageReport(rptPath);
//Load the report definition into a new page document.
GrapeCity.ActiveReports.Document.PageDocument runtime = new
GrapeCity.ActiveReports.Document.PageDocument(definition);
//Attach the runtime to an event. This line of code creates the event shell
below.
runtime.LocateDataSource += new
GrapeCity.ActiveReports.LocateDataSourceEventHandler(runtime_LocateDataSource);
viewer1.LoadDocument(runtime);
}
//ActiveReports raises this event when it cannot locate a report's data source in
the usual ways.
private void runtime_LocateDataSource(object sender,
GrapeCity.ActiveReports.LocateDataSourceEventArgs args)
{
DataLayer dl = new DataLayer();
args.Data = dl.DataSetData.Tables["Products"];
}
Object
Provider
Use
the
API
to
bind
a
report
data
source
to
a
collection
of
objects.
To
bind
the
Object
provider
to
a
report,
set
up
a
report
definition
and
a
page
document,
and
attach
the
page
document
to
a
LocateDataSourceEventHandler.
Create
a
public
class
which
sets
up
a
property
name
to
which
the
data
field
can
bind.
The
Object
provider
data
source
must
have
a
dataset
with
the
Query
left
blank
and
fields
that
correspond
to
the
fields
of
your
Object
provider
data
source.
Add
these
fields
manually
in
the
DataSet
Dialog
under
Fields.
When
using
the
Object
provider,
always
leave
the
report's
ConnectionString
blank
because
it
uses
the
LocateDataSource
event
to
bind
to
an
Object.
Set
the
Query
to
one
of
these
values:
To
use
the
Object
Provider
©2013 ComponentOne, a division of GrapeCity. All Rights Reserved.
Related documents
HP Reliable Transaction Router User's Manual
Medion Car Audio Instruction manual
Compaq Reliable Transaction Router User's Manual
ActiveReports 6 User Guide
User's Guide of the Unique Registration Facility (URF) and
CMSi Admin Manual - Conservation Management System
Quick Reference Guide
Contract Management Tracking Software
CuteReport User Manual - The UK Mirror Service
DWO-Manager
取扱説明書
取扱説明書
C472411921.
取扱説明書
Compound Discoverer 1.0 User Guide Version A