Implementing an expression in an RDLC report using Xtrareport's calculatedfiled (calculated field)

Source: Internet
Author: User

DevExpress report is really powerful, a variety of tricks, dazzling.

This time use Xtrareport Development Report, many questions in the official document does not have the detailed explanation, hereby records.

1. The Formattingrules attribute in Xtrareport is a condition (Condition) that can only return a bool value, not the expression I want.

2, according to Xtrareport official document to drag the control of the way to create the calculatedfiled is the expression I want.

1 The control is not flexible in the way it is, and the dataset type used by the DataSource (data source) of the Xtrareport object must specify the DataMember property when constructing Xtrareport.

 This. CalculatedField1 =NewCalculatedfield {DataMember="Product", Expression="Iif ([id]==1,-2,2)", Name="CalculatedField1"                };  This. Calculatedfields.addrange (Newdevexpress.xtrareports.ui.calculatedfield[] { This. CalculatedField1});//This field cannot be represented by placing the calculated field in the calculated field collection of the report.                  This. DataMember ="Product";  This. DataSource =ds;  This. XRTABLECELL1.DATABINDINGS.ADD ("Text",NULL,"Product.calculatedfield1");

However, these are the drag-and-drop controls that are automatically generated and do not need to be written manually.

2 "in the form of pure code, my data source is the list<> type, it is important to note that at the time of construction, you must not specify the DataMember property.

 This. CalculatedField1 =NewCalculatedfield {//DataMember = "Product",//you must not set the DataMember property by using list as the data sourceExpression ="Iif ([id]==1,-2,2)", Name="CalculatedField1"                };  This. Calculatedfields.addrange (Newdevexpress.xtrareports.ui.calculatedfield[] { This. CalculatedField1}); //This . DataMember = "Product";//you must not set the DataMember property by using list as the data source                 This. DataSource =list;  This. XRTABLECELL1.DATABINDINGS.ADD ("Text",NULL,"CalculatedField1");

3. The Xtrareport report does not appear to support the RDLC Row group (rowgroup) and column group (Columngroup), which I may not have found.

Implementing an expression in an RDLC report using Xtrareport's calculatedfiled (calculated field)

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: info-contact@alibabacloud.com 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.