Implement Dynamic ASP. NET Crystal Reports in disguise

Source: Internet
Author: User

Beginners often think that ASP. NET Crystal Reports give them a data source like a datagrid, and then it will be displayed. Actually not. However, this kind of dynamic ASP. NET Crystal report cannot be implemented, but it only needs to be implemented in disguise. If it is absolutely necessary, ask the crystal developer.

The following describes how to implement dynamic ASP. NET Crystal Reports. The principle is as follows. You need to call these statements on your own.

Main steps for implementing dynamic ASP. NET Crystal Reports:

1. Insert FormulaFields and text object in the ASP. NET Crystal Report.

2. In the program
ASP. NET Crystal Report class name CrystalReport1 in the Dim dry As New CrystalReport1 Project
'Text 1
Dry. ReportDefinition. ReportObjects. Item ("text1"). Left = 12' typographical
Dry. ReportDefinition. ReportObjects. Item ("text1"). ObjectFormat. EnableCanGrow = True
Dim GetTextObject1 As CrystalDecisions. CrystalReports. Engine. TextObject
GetTextObject1 = dry. ReportDefinition. ReportObjects. Item ("text1 ")
GetTextObject1.Text = "love you..." 'pay value
'Field 1
Dry. ReportDefinition. ReportObjects. Item ("t1"). Left = 12' typographical
Dry. DataDefinition. FormulaFields ("t1"). Text = "{codes. type_id}" 'value, table name. Field

3. Basic completion

References for implementing dynamic ASP. NET Crystal Reports:

1. Retrieve the DataDefinition object through the DataDefinition attribute of the ReportDocument object.
ReportDocument Member
Public instance attributes
DataDefinition. Obtain the DataDefinition object.

2. DataDefinition class
DataDefinition member CrystalDecisions. CrystalReports. Engine namespace
Requirements
Namespace: CrystalDecisions. CrystalReports. Engine
Platform: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP
Assembly: CrystalDecisions. Crystalreports. Engine in CrystalDecisions. Crystalreports. Engine. dll)
Contains all information related to data operations. Data operations are performed based on the data sources in the report ).
For a list of all members of this type, see DataDefinition member.
Object
DataDefinition
Remarks
You can use this class to define the method of selecting records for reports and groups, as well as to retrieve group sets and various field definition sets.
You can use the DataDefinition attribute of the ReportDocument object to retrieve the DataDefinition object.

3. Use the FormulaFieldDefinitions attribute of the DataDefinition object to retrieve the FormulaFields object.
DataDefinition Member
DataDefinition class CrystalDecisions. CrystalReports. Engine namespace
Public instance attributes
FormulaFields FormulaFieldDefinitions. Obtain the FormulaFieldDefinitions set.

4. FormulaFieldDefinitions class
FormulaFieldDefinitions member CrystalDecisions. CrystalReports. Engine namespace
Requirements
Namespace: CrystalDecisions. CrystalReports. Engine
Platform: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP
Assembly: CrystalDecisions. Crystalreports. Engine in CrystalDecisions. Crystalreports. Engine. dll)
The FormulaFieldDefinition object that contains each formula field in the report.
For a list of all members of this type, see FormulaFieldDefinitions members.
Object
SCRCollection
FormulaFieldFieldDefinitions
Remarks
You can use the FormulaFields attribute of the DataDefinition object to retrieve the FormulaFieldDefinitions set.

5. Obtain the FormulaFieldDefinition object and set the formula.
For example: FormulaFieldDefinition. Text = "{customer. Customer ID }"
FormulaFieldDefinition Member
FormulaFieldDefinition class CrystalDecisions. CrystalReports. Engine namespace
Public instance attributes
FormulaName is inherited from FieldDefinition) string. Obtain the unique formula name of the field definition in the Crystal Report formula syntax.
Kind inherited from FieldDefinition) FieldKind. Obtain the field type.
Name string. Obtain the name of the formula field displayed in "field resource manager.
NumberOfBytes inherited from FieldDefinition) Int32. Obtains the number of bytes required to store field data in the memory.
Text string. Obtain or set the text of the formula.
UseCount is inherited from FieldDefinition) Int32. Obtains the number of times a field is used in a report.
ValueType inherited from FieldDefinition) FieldValueType. Type of the field value.
Public instance method
Check the formula. If a syntax error exists, the error string and false are returned.

  1. Example: ASP. NET Crystal Report tutorial
  2. Introduction to ASP. NET Report controls
  3. Overview ASP. NET Crystal Reports
  4. Application of Crystal Reports in VS. Net
  5. Installation and deployment of Crystal Reports in VS. NET 2002
  6. Data source controls in ASP. NET

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.