Convert to realize dynamic CRYSTAL REPORT

Source: Internet
Author: User

Beginners often think that a crystal report is like a datagrid, giving it a data source, and then it will be displayed.
However, this kind of dynamic crystal report cannot be implemented, but it just needs to be implemented in turn. If it is absolutely necessary, ask the crystal developer.
The following describes how to implement it. The principle is as follows. You need to call it by yourself.
The main steps are as follows:
1. Insert FormulaFields and text object into the crystal report.
2. In the program
In the Dim dry As New CrystalReport1 project, the Crystal Report class name is CrystalReport1.
'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
Bytes ------------------------------------------------------------------------------------------
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
Namespace: CrystalDecisions. CrystalReports. Engine
Platform: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP

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: 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.