Use of crystal reports in ASP.NET

xiaoxiao2021-03-06  112

Use of crystal reports in ASP.NET

Before we conducted research on the Crystal Reports in VS.NET, I and my friend had a very curiosity of how to join this complex stuff to our web app. After a week, after reading a large number of "Howto" documents, we successfully added some simple report to our ASP.NET program and got some small decisions. This article teaches you how to use crystal reports in .NET web applications, you can also let you take less detours during your study. In order to get the best results, readers should best have some basic ASP.NET access to database knowledge and experience using VS.NET. Introduction Crystal Reports can be obtained from a number of methods, one is to create using VS.NET, which provides a very rich model to allow us to operate attributes and methods at runtime. If you are using VS.NET development .NET program, you don't need to install other software, because he is already in vs.net. Advantages: vs.NET Crystal Report has some of the main advantages: Fast report development can export into complex interactive charts to use other controls to use the report to be able to export reports to .pdf, .doc, XLS, HTML, RTF and other formatting structures: Some components constitute a two-layer structure of the crystal report, the web application thereof is: Client: Client only requires a visitor that can access the ASPX page report can be servers: Crystal Report The Crystal Report Engine (Crengine.dll)) passes some tasks, such as merging data in the report file, the conversion report is other formats. It is also because of the role of the report engine, the Crystal Report in ASP.NET can be converted into a normal HTML format crystal report designer (CRDESIGNER.DLL)) Crystal report is created in the designer, in design In the device, you can design a title, insert data, formula, chart, sub-report, etc. The first step in the execution report in the .RPT report is to create this report at the Crystal Report Designer interface, and Microsoft has provided some ready-made .rpt examples in the default installation. The method of obtaining the database depends on the choice of your method, you can choose to let the crystal report you choose to select data without any code or you can also select manual assembly DataSet, and then transfer it to the report file. Crystal Report View Control (CRWEBFORMVIEWER.DLL)) Crystal Report View control is a WebForm control that can be regarded as a container that stores reports in the .aspx page. Note: In some complex operations, the report server and the web server may not be on the same physical host, the web server transmits the HTTP request to the report server. Crystal reports can also be performed when WebService is performed. Execution Mode Crystal Report Data can be implemented using the following method: PULL mode: When the requested, the crystal report directly connects the database according to the specified drive and assembles this data. PUSH mode: The development table has to write code connection data and assemble the DataSet, while transferring it to the report. In this case, by using connection sharing and limiting the size of the record set, the report performance can be maximized. Report Type: Crystal Report Designer can directly contain reports to engineering and can use independent report objects.

Strongly-type report: When you join the report file to the project, it turns an "strongly-type" report. In these cases, you will have the power to create the object of the report, which will reduce some code and provide some performance. UN-TYPED report: The report here is not directly included in the project, so called 'UN-TYPED' report. In this case, you have to establish an instance using the "ReportDocuemt" object of the crystal statement, and "manual" manual apipe. Other Precautions Although Crystal Report Viewers have some cool features, such as scaling, page navigation, etc. But he does not provide print function, you have to call the printed function of the visitors. Crystal Report in VS.NET If not registered, then it can only use 30 times, 30 times, "save" can not be used again. To avoid this, you are not in http://www.crystaldecisions.com/ here. (It seems that it is not a case, it seems that it can be used for a long time, but it is not possible to support) The default installed crystal report can only support 5 users, in order to support more users, you have to http: // www .crlyStalDecisions.com / purchase license. Let us feel ---- Using a ready-made crystal report file in ASP.NET, let us first feel the feeling of using crystal reports in WebForm. 1) Drag the Crystal Report Viewer from the WebForm toolbar to the .aspx page. 2) Press the Properties window of the Crystal Report Viewer Control 3) Click the [...] button to view the "Data Binding" property and pop up the DataBinding window. 4) Select "Report Source" 5 in the "Bindable Properties" area to select the "Custom Binding Expression" radio button, specify the file name and path of the .rpt file in the window on the bottom of the right, for example: " C: // Program Files // Microsoft Visual Studio.Net//crystal Reports // Samples // Reports // General Business // World Sales Report.rpt ", then" OK "Note: File" World Sales Report.rpt " The file is created when VS.NET is installed. If you specify another directory during the installation process, you'd better confirm the correctness of the path.

转载请注明原文地址:https://www.9cbs.com/read-101491.html

New Post(0)