Learn about how to write crystal reports for sql, we have the largest and most updated how to write crystal reports for sql information on alibabacloud.com
The last time I made the method of using oledb to connect to the database directly in the rpt file, but it was not very flexible. This time I used SQL statements to directly generate dataset as the report data source (that is, the push mode ), in this way, you can accept the parameter. Of course, I have not studied the function of setting parameters in reports in detail.
I. Table association is not used
. First, as mentioned in the article, you can create a virtual directory in IIS and direct it to the client directory in the project.Note that if the description in the SQL Server field uses Chinese characters, a box is displayed in the PDF file after the export of the Crystal Report. The solution is, find the schema in this program. RPT report template file, select its description Report field, and change
crystal report are the same as those of previous versions)Put a CRYSTALREPORTVIEWER on the form and write it under the LOAD event of FORM1. I dynamically LOAD the Crystal Report under the DEBUG folder; you can also specify the report name directly on CRYSTALREPORTVIEWER in the project;Private void Form1_Load (object sender, EventArgs e){SqlConnection con = new S
in the above push mode.
5. Finally, let's write the pageCrystalReport_Push.aspxBackground code.
First, introduce the following namespace:
Using CrystalDecisions. crystalReports. engine; using System. collections. generic; using System. data; using System. data. sqlClient; using System. linq; using System. web; using System. web. UI; using System. web. UI. webControls; namespace ch02 {public partial class CrystalReport_Push: System. web. UI. page
. rpt file gets the database depends on the choice of your method, and you can choose to have the Crystal report choose your data without using any code, or you can manually assemble the dataset and then transfer it to the report File.Crystal Report Viewer Controls (crystal Reports Viewer Web Form control (CRWebFormViewer.dll))
:
Crystalreport1.discardsaveddata = True ' automatically refreshes data from the database
Crystalreport1.reportfilename = App.Path "\mdb.rpt"
Crystalreport1.windowstate = crptmaximized
Crystalreport1.action = 1
If it is a SQL Server 2000 database, activate the code:
Crystalreport1.connect = "ODBC;DNS=SQL_DB1; Uid= " Text4.text "; Pwd= " Text5.text
";D sq=db1" ' ODBC connection to SQL Server server
Crysta
Finereport report software for the complex format of the report data and the presentation of the Web report, through multi-source sharding, irregular grouping, two-way extension to easily drag and drop to do complex format of the report, making reports from the complex SQL and expression, do not need programming, greatly improve the efficiency of the report production.The Finereport report has obvious advan
database and display it on the report. the benefit of the Pull mode is that you can read report data and create reports without writing a line of code.Compared with the pull mode, the Push mode is a relatively advanced mode. The data obtained by the Push mode needs to be obtained using ADO. NET to obtain the data, and then display it on the report. the Push mode can achieve custom data acquisition, which maximizes feature customization. However, you
I have been busy with the development of the production plan management system recently, so I rarely leave a message here. Please forgive me! Fortunately, the project has entered the final stage of the test. As the project uses the Crystal Report for report processing, many friends have left a message about the problems they encountered during the development of the crystal report, so this time I wrote some
operations on the "Report experts" tab, and click "finish" to access the Crystal Report designer and your reports. 4. Do I need to dynamically set the data source? Crystal Reports connects to the database through the database driver. Each driver is programmed to process a specific database type or database access te
= server. Createobject ("ADODB. Connection ")
'Create an ADO connection called "oconn" here. We will use this ADO connection object to connect to the DSN
'To use ADO connection, you must first open it:
Oconn. Open ("Xtreme Sample Database ")
'Open the ODBC Data source. This data source points to the ACCESS database Xtreme. MDB.
'Now we must create a recordset object:
Set SESSION ("ors") = server. Createobject ("ADODB. recordset ")
'The above we created a session ("ors"). This sess
Ref: http://aspalliance.com/1593_Six_Quick_Crystal_Reports_Design_Tips.allIntroduction
I have found myself working on projects where reports have been last minute additions that demanded a great deal of time and a certain touch of detail. when times, reports are cobbled together, with good design and performance falling to the wayside. reports are the
choose to let the Crystal Report select data without using any code or manually assemble the dataset, and then transfer it to the report file.
Crystal Report viewer web form control (crwebformviewer. dll ))
The crystal report display control is a webform control that can be viewed as a container for storing reports o
database depends on your method selection. You can choose to allow the Crystal Report to select data by yourself without using anyCodeAlternatively, you can manually assemble the dataset and then transmit it to the report file.
Crystal Report viewer web form control (crwebformviewer. dll ))
The crystal report display control is a webform control that can be
Crystal Report to select data by yourself without using any Code Alternatively, you can manually assemble the dataset and then transmit it to the report file.Crystal Report viewer web form control (crwebformviewer. dll ))The crystal report display control is a webform control that can be viewed as a container for storing reports on the. ASPX page. Note: In some
. Windows. Forms. dll ......Managed_chs.msm is the Chinese version of this moduleLanguage support.
Database_access.msm this module contains the database driver, the connection with different databases, and the documents and chart components that export reports in the RTF and HTML formats.
Database_access_chs.msm is supported in the Chinese language of this module.
Regwiz. MSM registration information module is very important. You must enter the regist
the database depends on your method selection. You can choose to allow the Crystal Report to select data by yourself without using anyCodeAlternatively, you can manually assemble the dataset and then transmit it to the report file.
Crystal Report viewer web form control (crwebformviewer. dll ))
The crystal report display control is a webform control that can
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.