In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
How to create a custom DevExpress report control, for this problem, this article details the corresponding analysis and solution, hoping to help more friends who want to solve this problem find a simpler and easier way.
How to build a custom DevExpress Report control (Swiss QR-Bill report component), and how to solve problems encountered during development, hopefully this information will be valuable to users who create custom DevExpress Report controls.
To help demystify report control development, here's how to create design-time settings, serialize designer components and related "bricks," and render and print components. The first part contains general information about the Swiss QR Bill control and describes the requirements of the control itself; the second part details the component implementation.
general information
Swiss QR Bill is a new payment form with QR code. Swiss QR Bill contains the following elements:
receipt
payment portion
barcode
Invoice can use the following layout:
"Full" invoice printed on A4 paper;
"Short" invoices printed on A6 paper;
Print invoices continuously;
Invoice printed on a single page.
"Complete" invoices contain receipts, while "empty" invoices contain payment information only. The BillKind property of the component specifies the PaymentAndReceipt value for the full invoice and the PaymentOnly value for the short-term invoice, and continuous printing or separate printing is specified through the IntegratedMode property.
Print the invoice on A4 or A6 paper (or export to PDF) and specify the permutation line with the BillOption.PreviewSeparatorKind and BillOption.PdfSeparatorKind properties, respectively This component allows you to change the language and font of any field, and the StringData property can be used to bind fields to external data sources.
Report Control Development-Overview
To create a new report control, you must:
Select a base class, and if no suitable control derivation can be found, inherit a component from the XRControl class.
Create an object model for the component, specifying a set of attributes and related attributes that determine how the attributes are serialized and displayed in the Property grid.
Create component designers for Visual Studio and End User Designer, where designers determine the appearance and operation of components at design time, adding attributes as needed.
Select the "brick" of the component, an obvious choice is the building block created by the base class, but if the component inherits from the XRControl class, there are two options-choose VisualBrick as the base class for Brick if you want a simple Brick, or PanelBrick if you want a container.
Specifies how the component creates its "brick" and maps the component's attributes to the brick's characteristics.
Implement the BrickExporter class to render "brick," overriding methods for drawing and exporting.
component implementation
Because the SwissQRBill component is a descendant of XRControl, it has its own "brick," serialization, and item in the designer's toolbox.
design time
To add a component to the Visual Studio Toolbox, the component must have the ToolBoxItem (true) attribute.
WinForms End-User Designer requires that the component be registered with IToolBoxService, handles the DesignPanelLoaded event, and then calls the IToolBoxService.AddToolBoxItem method to register the component.
To implement design-time functionality for components, add Designer and XRDesigner properties for Visual Studio and WinForms End-User Designer, respectively. Control sizing rules and smart tag items, specified through the DesignerActionList object registered in the Component Designer, must be modified as needed, and the GetSelectionRulesCore method modifies control sizing rules.
When setting up the attribute grid, pay special attention to extensible objects. In this example, ExpandableObjectConverter descendants are created to override the ConvertTo method, and the new ConvertTo method implementation changes the strings displayed in the Property Grid Editor. The GetProperties method of AddressTypeConverter removes unnecessary properties of the address type.
About how to create custom DevExpress report control questions to share the answer here, I hope the above content can be of some help to everyone, if you still have a lot of doubts not solved, you can pay attention to the industry information channel to learn more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.