Opening
The previous article describes how to manage reports based on the report management component of the platform. We have not explained how to call reports in projects. Next let's take a look at how we use
Designed reports: directly use the report service supported by the platform native, and independently designed and implemented the report service, we use the report designer to complete reports separately.
Table development. It can also be developed based on other platforms. In this chapter, we will discuss these issues in detail.
Outline
1. Use the native report service.
2. Use the report service from the platform.
Use native report service
First, Let's explain what is native report service. Native means to use the report management service supported by the underlying platform, it can also be understood as saving the report definition information in the underlying table "eas. REPORTS table
.
Next, let's look at the design report process described in the previous article. Let's take a look at how we use native report services to print reports.
1. Add a printing event on the drug warehouse receiving page:
2. Add the following code to the print event.
3. Let's take a look at how to print a report:
After the code is configured, let's run it to see the effect.
The above is also a brief introduction. Of course, you can also group the report. For example, you can modify the report to group the report by drug type:
As you can see, it is still very simple. It is very quick to use and develop. The report itself provides the export function and supports exporting in multiple file formats. Let's take a look at how we
We do not use reports supported at the bottom of the AgileEAS. NET platform for development. How do we use the report function separately.
Out-of-platform use reports
How can we use reports instead of the AgileEAS. NET platform? I think we can use the following methods to call the report function. Here we will talk about it one by one, but we are using the report.
Table controls still have some unsatisfactory restrictions. For example, when we create an object report, our object must be AgileEAS. NET platform "specific" objects can be recognized by the report designer.
How can this problem be understood? Let's take a look at this special case:
1. Find the report designer application under the "bin" or "ref" directory:
2. Click "new" to select an object report:
3. After creating a new "Object Report", select the Data source:
4. Select the Assembly where the report data source object is located. For example, if you want to develop a drug warehouse, you can select the Assembly where the drug warehouse object is located:
5. After you click "open", the report control automatically reads all entity classes under the Assembly, provided that the entity class must be AgileEAS. NET platform defined entity class, how to understand it here? We can see that it must be a standard
Note the following:
The table name in the table feature can be blank, if it is a custom object.
6. The report designer can recognize this object.
7. Here we use Dm_rin as our design goal, that is, to store drugs into the database:
8. For detailed subsequent adjustments to the report, see the following report design documents:
How to Use agileeas designer
9. After the report is developed, we do not use AgileEAS. to support the report component provided by the. NET platform, you must maintain the report definition file by yourself. Unlike the report definition file provided by the platform
So how can we maintain the report definition file? Here we provide the solution as follows: create a "RDL" folder in the solution and put all the report definition folders in this folder.
We know that the actual storage of report definition files is stored in XML format, and the storage format in the database is clear, so we know that we only need. read the corresponding report in the rdl File
After the information is complete, it should be very easy. We only need to write a helper class, specifically responsible for reading the specified file name of the specified path.
Let's take a look at why we can directly read the data?
Read the database according to the report name to load the definition information of the report to the report object.
Let's take a break:
Click the text visualization tool to view the specific content:
The platform provides the following methods to read the definition of a report:
Next, let's take a look at the helper class that I wrote to read the definition information in the rdl file.
1. Read the RDL folder path of the current project.
2. Read the report definition with the specified name in the RDL Folder:
3. If a specified report definition file exists, read the specific report definition information of the definition file. If multiple report definition files with the same name exist, only the information of the first qualified file is read.
4. Now we have read the RDL file. Let's test it to see if it is feasible:
Use the underlying components provided by the platform to access the report and print the report. We read the Helper class through custom report definitions to print the report.
5. Let's run the above program:
In this way, we have completed the definition and use of reports, which is very simple and convenient. I believe that you can perform secondary development or report development as soon as you learn, of course, if the specified table ing does not exist in our system
We need to customize an object at this time. At this time, we must add the corresponding table ing tag and column ing tag, but remember not to write the table name in the table ing tag. For example:
This completes the report development and design.
Summary
The above section describes the basic content about report development. The next section describes the Advanced content of report development. I will share our internal experience on the report designer, to enable quick report opening
To share with you the module-based report development, which allows you to develop reports at the fastest speed. Let us focus more on business development and release some repetitive work.
Pharmacy system source code
Other articles
More articles about the AgileEAS. NET development platform are provided here.
1. official blog: AgileEAS. NET agile software development platform
2. Author's blog: Wei qiongdong
3. What about AgileEAS. NET platform-document publishing?
4. Use Cases of the AgileEAS. NET platform tool for data prototype designer
5. More...
More communication
Official blog: http://www.smarteas.net/
Http://www.agilelab.cn/
If you have any questions about using the AgileEAS. NET development platform, use the following contact methods or communication methods.
1. Telephone-Email:
He gozhou: hegezhou_hot@163.com mobile phone: 18691480181 blog: http://www.cnblogs.com/hegezhou_hot/
2. QQ chat group:
308961614 Network Name: h.o. T