Sie sind auf Seite 1von 11

Objectos de bases de datos y conexin

Dim crTables As CrystalDecisions.CrystalReports.Engine.Tables


Dim crTable As CrystalDecisions.CrystalReports.Engine.Table
Dim crConnInfo As New CrystalDecisions.Shared.ConnectionInfo

Dim crLogOnInfo As CrystalDecisions.Shared.TableLogOnInfo

crTables = Reporte.Database.Tables

For Each crTable In crTables

crConnInfo.DatabaseName = rptnombd
crConnInfo.ServerName = rptservidor
crConnInfo.UserID = rptlogin
crConnInfo.Password = rptpassword
crLogOnInfo = crTable.LogOnInfo
crLogOnInfo.ConnectionInfo = crConnInfo
crTable.ApplyLogOnInfo(crLogOnInfo)
crTable.Location = rptnombd & ".dbo." &
crTable.Location.Substring(crTable.Location.LastIn dexOf(".") + 1)
crTable.TestConnectivity()

Next

ConnectionInfo connectionInfo = new ConnectionInfo();


connectionInfo.ServerName = dbServ; // serv;
connectionInfo.DatabaseName = dbComp; //Base de Datos
connectionInfo.UserID = dbUser;//userbd;
connectionInfo.Password = dbPsw;//pwbd;
connectionInfo.Type = ConnectionInfoType.SQL;

Objetos del informe

ReportDocument myReport = new ReportDocument();


string reportPath = Server.MapPath("crystalreport1.rpt");
myReport.Load(reportPath);

//set datasource or database logon information


//...
CrystalReportViewer1.ReportSource = myReport;

//control the report object


//one textbox named "Text1",set its Left/Top ,and Its Text
//this is a common object
myReport.ReportDefinition.ReportObjects["Text1"].Left=567*2; //2cm

//control textboxobject
TextObject x;
x = (TextObject)myReport.ReportDefinition.ReportObjects["Text1"];
x.Text = "Customize Text";

//control fieldObject
//fieldObjectName<>filedname, right click the field,get the fieldnane(object name)
FieldObject fo;
fo = (FieldObject)myReport.ReportDefinition.ReportObjects["fieldObjectName"];
fo.Height = 567 * 3;
fo.Width = 567 * 4;
fo.Left = 567 * 1;

Area Class
Represents an area in a report. An area is a group of like sections in the report that all
share the same characteristics.
For a list of members of this type, see Area Members.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
Area
[Visual Basic]
Public Class Area
Implements IDisposable
[C#]
public class Area, IDisposable
Remarks
Retrieve the Area object by index or by name through the Item Property of the Areas
collection.
Requirements
Namespace CrystalDecisions.CrystalReports.Engine

AreaFormat
Gets the AreaFormat object.
Kind
Gets the kind of area or section.
Name
Gets the area name.
Sections
Gets a collection of all the sections in the area.

BlobFieldObject Class
Represents a blob field object on the report. This class allows you to retrieve the objects
representing the specific kind of field object and also allows you to set generic format
options inherited from the ReportObject class.
For a list of members of this type, see BlobFieldObject Members.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
CrystalDecisions.CrystalReports.Engine.ReportObject
BlobFieldObject
[Visual Basic]
Public Class BlobFieldObject
Inherits ReportObject
Implements IDisposable

Public Properties
Border Gets the Border object.
DataSource Gets the FieldDefinition object.
Height Gets or sets the object's height, in twips.
Kind Gets kind of report object.
Left Gets or sets the object's upper left position,
in twips.
Name Gets the object's name.
ObjectFormat Gets the ObjectFormat object.
Top Gets or sets the object's upper top position,
in twips.
Width Gets or sets the object's width, in twips.

BooleanFieldFormat Class
Allows you to get and set the Boolean output type for Boolean fields.
For a list of members of this type, see BooleanFieldFormat Members.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
CrystalDecisions.CrystalReports.Engine.ReportObjectProperty
BooleanFieldFormat
[Visual Basic]
Public Class BooleanFieldFormat
Implements Idisposable
Public Properties
OutputType Gets or sets the Boolean output type.

BoxObject Class
Represents a box that has been drawn on the report.
For a list of members of this type, see BoxObject Members.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
CrystalDecisions.CrystalReports.Engine.ReportObject
CrystalDecisions.CrystalReports.Engine.DrawingObject
BoxObject
[Visual Basic]
Public Class BoxObject
Inherits DrawingObject
Implements IDisposable
Public Properties
Border Gets the Border object.
Bottom Gets or sets the object's bottom coordinate,
in twips.
EnableExtendToBottomOfSection Gets or sets the extend to bottom of section
option.
EndSectionName Gets the name of the section at the bottom
of the object.
FillColor Gets or sets the fill color of the object.
Kind Gets kind of report object.
Left Gets or sets the object's upper left position,
in twips.
LineColor Gets or sets the line color of the object.
LineStyle Gets or sets the line style for the object.
LineThickness Gets or sets the thickness of the line in
twips.
Name Gets the object's name.
ObjectFormat Gets the ObjectFormat object.
Right Gets or sets the object's right coordinate, in
twips.
Top Gets or sets the object's upper top position,
in twips.

Database Class
Provides properties to get information about the database accessed by a report.
For a list of members of this type, see Database Members.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
Database
[Visual Basic]
Public Class Database
Implements IDisposable
Public Properties
Links Gets the TableLinks collection.
Tables Gets the Tables collection.
DatabaseFieldDefinition Class
Represents a database field used in the report and provides properties for getting
information on database fields in the report.
For a list of members of this type, see DatabaseFieldDefinition Members.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
CrystalDecisions.CrystalReports.Engine.FieldDefinition
DatabaseFieldDefinition
[Visual Basic]
Public Class DatabaseFieldDefinition
Inherits FieldDefinition
Implements IDisposable

Public Properties
FormulaName Gets the field definition unique formula
name in Crystal Reports formula syntax.
Kind Gets the kind of field.
Name Specifies the name of the field in the
database (for example, Product ID).
NumberOfBytes Gets the number of bytes required to store
the field data in memory.
TableName Gets the name of the parent table.
UseCount Obsolete. Gets the number of times a field
is used in a report.
ValueType Gets the type of field value.

DatabaseFieldDefinitions Class
Contains the DatabaseFieldDefinition objects for every database field in the report.
For a list of members of this type, see DatabaseFieldDefinitions Members.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
CrystalDecisions.CrystalReports.Engine.SCRCollection
CrystalDecisions.CrystalReports.Engine.FieldDefinitions
DatabaseFieldDefinitions
[Visual Basic]
Public Class DatabaseFieldDefinitions
Inherits SCRCollection
Implements IDisposable, ICollection, IEnumerable, IEnumerator
Public Properties
Count Gets the number of DatabaseFieldDefinition
objects in the collection.
Item Overloaded.
Gets the object with the specified name. In
C#, this property is the indexer for the
DatabaseFieldDefinitions class.
DataDefinition Class
Contains all the information relating to data manipulation based on the data source in a
report.
For a list of members of this type, see DataDefinition Members.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
DataDefinition
[Visual Basic]
Public Class DataDefinition
Implements IDisposable
Public Properties
FormulaFields Gets the FormulaFieldDefinitions
collection.
GroupNameFields Gets the GroupNameFieldDefinitions
collection.
Groups Gets the Groups collection.
GroupSelectionFormula Gets or sets the group selection formula.
ParameterFields Gets the ParameterFieldDefinitions
collection.
RecordSelectionFormula Gets or sets the record selection formula.
RunningTotalFields Gets the RunningTotalFieldDefinitions
collection.
SortFields Gets the SortFields collection.
SQLExpressionFields Gets the SQLExpressionFieldDefinitions
collection.
SummaryFields Gets the SummaryFieldDefinitions
collection.

DateFieldFormat Class
Allows you to get and set date format options for a date field in a report.
For a list of members of this type, see DateFieldFormat Members.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
CrystalDecisions.CrystalReports.Engine.ReportObjectProperty
DateFieldFormat
[Visual Basic]
Public Class DateFieldFormat
Implements Idisposable

FieldDefinition Class
Base class providing generic properties for various kinds of field definition objects.
For a list of members of this type, see FieldDefinition Members.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
FieldDefinition
[Visual Basic]
Public Class FieldDefinition
Implements IDisposable
Public Properties
FormulaName Gets the field definition unique formula
name in Crystal Report formula syntax.
Kind Gets the kind of field.
Name Gets the object's name.
NumberOfBytes Gets the number of bytes required to store
the field data in memory.
UseCount Obsolete. Gets the number of times a field
is used in a report.
ValueType Gets the type of field value.

FieldHeadingObject Class
Represents a field-heading object found in a report. This object provides properties and
methods for retrieving information and setting options for a field-heading object in a
report.
For a list of members of this type, see FieldHeadingObject Members.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
CrystalDecisions.CrystalReports.Engine.ReportObject
CrystalDecisions.CrystalReports.Engine.TextObject
FieldHeadingObject
[Visual Basic]
Public Class FieldHeadingObject
Inherits TextObject
Implements IDisposable
Public Properties
Border Gets the Border object.
Color Gets or sets the color of the object.
FieldObjectName Gets the name of the field object that this
heading represents.
Font Gets the Font object. Use the ApplyFont
method to apply the changes.
Height Gets or sets the object's height, in twips.
Kind Gets kind of report object.
Left Gets or sets the object's upper left position,
in twips.
Name Gets the object's name.
ObjectFormat Gets the ObjectFormat object.
Text Gets or sets the text within the text object.
Top Gets or sets the object's upper top position,
in twips.
Width Gets or sets the object's width, in twips.
FieldObject Class
Represents a Field object on a report. This class allows you to retrieve the objects
representing the specific kind and type of field object and also allows you to set generic
format options inherited from the ReportObject class.
For a list of members of this type, see FieldObject Members.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
CrystalDecisions.CrystalReports.Engine.ReportObject
FieldObject
[Visual Basic]
Public Class FieldObject
Inherits ReportObject
Implements Idisposable

Public Properties
Border Gets the Border object.
Color Gets or sets the color of the object.
DataSource Gets the FieldDefinition object. Use the
FieldDefinition object to get and set format
information specific to the kind of field.
FieldFormat Gets the FieldFormat object.
Font Gets the Font object.
Height Gets or sets the object's height, in twips.
Kind Gets kind of report object.
Left Gets or sets the object's upper left position,
in twips.
Name Gets the object's name.
ObjectFormat Gets the ObjectFormat object.
Top Gets or sets the object's upper top position,
in twips.
Width Gets or sets the object's width, in twips.

FormulaFieldDefinition Class
Provides properties and methods for retrieving information and setting options for any
named formula field in a report.
For a list of members of this type, see FormulaFieldDefinition Members.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
CrystalDecisions.CrystalReports.Engine.FieldDefinition
FormulaFieldDefinition
[Visual Basic]
Public Class FormulaFieldDefinition
Inherits FieldDefinition
Implements IDisposable
Group Class
Provides properties for retrieving the specific field definition object the group is based
on as well as the GroupOptions object used to set the group's condition.
For a list of members of this type, see Group Members.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
Group
[Visual Basic]
Public Class Group
Implements IDisposable
Public Properties
ConditionField Gets the FieldDefinition object.
GroupOptions Gets the GroupOptions object.

GroupNameFieldDefinition Class
Provides properties for retrieving information on a group name field found in a report.
For a list of members of this type, see GroupNameFieldDefinition Members.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
CrystalDecisions.CrystalReports.Engine.FieldDefinition
GroupNameFieldDefinition
[Visual Basic]
Public Class GroupNameFieldDefinition
Inherits FieldDefinition
Implements IDisposable

Public Properties
FormulaName Gets the field definition unique formula
name in Crystal Report formula syntax.
Group Gets the Group object.
GroupNameFieldName Gets the group name field name.
Kind Gets the kind of field.
Name Gets the field definition unique formula
name in Crystal Report formula syntax.
NumberOfBytes Gets the number of bytes required to store
the field data in memory.
UseCount Obsolete. Gets the number of times a field
is used in a report.
ValueType Gets the type of field value.

Groups Class
Contains the Group objects for every group in the report.
For a list of members of this type, see Groups Members.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
CrystalDecisions.CrystalReports.Engine.SCRCollection
Groups
[Visual Basic]
Public Class Groups
Inherits SCRCollection
Implements IDisposable, ICollection, IEnumerable, IEnumerator
Public Properties
Count Gets the number of Group objects in the
collection.
Item Gets the object at the specified index. In C#,
this property is the indexer for the Group
class.

PictureObject Class
Represents a picture object on the report.
For a list of members of this type, see PictureObject Members.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
CrystalDecisions.CrystalReports.Engine.ReportObject
PictureObject
[Visual Basic]
Public Class PictureObject
Inherits GraphicObject
Implements IDisposable

Public Properties
Border Gets the Border object.
Height Gets or sets the object's height, in twips.
Kind Gets kind of report object.
Left Gets or sets the object's upper left position,
in twips.
Name Gets the object's name.
ObjectFormat Gets the ObjectFormat object.
Top Gets or sets the object's upper top position,
in twips.
Width Gets or sets the object's width, in twips.

Section Class
Report areas contain at least one section. This class includes properties for accessing
information regarding a section of a report.
For a list of members of this type, see Section Members.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
Section
Public Properties
Height Gets or sets the object's height, in twips.
Kind Gets the kind of area or section.
Name Gets the section name.
ReportObjects Gets the ReportObjects collection.
SectionFormat Gets the SectionFormat object.

SortField Class
Represents a record or group sort field. This class provides properties to get and set
information on sort fields in the report.
For a list of members of this type, see SortField Members.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
SortField
SortField Members
SortField overview
Public Properties
Field Gets or sets the sort field's FieldDefinition
object.
SortDirection Gets or sets the sort direction.
SortType Gets the sort field type.

Tables Class
Contains the Table objects for every table in the report.
For a list of members of this type, see Tables Members.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
CrystalDecisions.CrystalReports.Engine.SCRCollection
Tables

Das könnte Ihnen auch gefallen