***S 2012 Report Items -- 列表

本文深入探讨报表设计中列表的灵活使用,包括其与表格、矩阵的区别,以及如何通过列表展示多笔数据行,实现数据的个性化排列与展示。通过实例演示如何创建嵌套列表以增强报表的复杂度与实用性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

***S 2012 Report Items -- 列表


列表

 

在Tablix已经将数据表与矩阵的限制降到最低,而“列表(List)”可说是弹性格式的最大极限,在“List”中,设计者可以在列表内自由地排列组合不同种类的报表项目。与“Table”类似,列表是以逐笔的方式以呈现“Details”,但在排版上比“Table”和“Matrix”更具有弹性,你可以想象列表就是将数据表的一笔数据行打散,让每个单元格都可以各自定制的方式来陈列。在企业报表设计的需求中,列表可以广泛地应用在打印缴费单、客户通知单、邮寄名片等功能。

 

目前Reporting Services对于列表提供的设置属性与数据表相同。

 

建立列表


建立列表的方式与其他的报表项目一样,可以直接在工具箱将列表区域拖拉至报表设计区域即可。“List”的外观看起来与“Rectangle”相似,只是规范一个范围,但两者不同的地方为,“List”会逐笔显示所连接数据集或组后的详细信息,而“Rectangle”只是一个形状而已。

 

clip_image002

 

笔者在利用一个银行的学杂费缴费单的范例来说明列表的应用模式,首先,请从工具箱中拖拉“List”至报表主体,此时会启动“Data Source Properties”对话框,在“Use shared data source reference”处选择之前设置好的共享数据源,并在“Datasets”中,选择“Use a shared dataset”,选择之前设置好的共享数据集缴交的学费总金额。

 

接下来,请将数据集中的列依照学杂费缴费单的格式拖拉至列表内。由于我们还没有介绍其他修饰报表的独立工具以及表达式,所以,这个范例的呈现结果还会有点单一。

 

clip_image004

 

所有的列表都会伴随着一个同样大小的矩形,如果要设定列表的边框其实是设置此矩形的边框属性、鼠标在列表内空白处右击、选择“Rectangle Properties…”。

 

clip_image006

 

请切换至“Border”分页并点选“Outline”,此时矩阵会产生黑色的外框。预览刚才完成的报表,会显示一个学生一项缴费单的结果。

 

clip_image008

 

嵌套列表


相信大家对组的概念已经很熟悉,与其他的数据区域项目相同,列表也可以对数据行组设计,甚至可以在列表中加入列表的方式来做到“嵌套”的组架构。例如,可以在第一个列表中设计出学生的明细,然后在其中加入另一个列表或是其他列表区域项目,来列出该学生的所有缴费项目明细,利用嵌套列表的架构能够大幅扩充了列表的应用层面。

 

首先,请依照上个范例的步骤做出基础报表,只不过需将使用的数据集选择共享数据集学杂费缴费项目明细,列出该学生的所有缴费项目。由于是一个学生多笔,因此,预览列表报表时也会显示一个学生多笔的结果。接下来,请于下方的数据行组面板中右击“Details”组选择“Group Properties…”。

 

在组属性对话框中的“General”标签页的“Group expressions”处单击“Add”,将组对象设为“StudentID”,这标示是利用学生学号为组依据,把属于该学生的缴费详细信息组在一起。加入后,请记得要把“Details”以及将设计画面时系统自动增加的数据行给删除。

 

clip_image010

 

在组内拖放一个新的数据表,第一列放入缴费项目[FeeItemName],第二列放入缴费金额[Amount],并且加入总计列,设计完成后结果会如图所示的嵌套列表架构,也就是列表内又有数据表。

 

clip_image012

 

预览结果仍旧会呈现一个学生一笔缴费单,但是,将会属于该学生的缴费细项放入数据表中。不过,这个缴费单看起来还是很不正式,我们接下来会介绍独立报表以作为修饰报表版面的基础。

 

如果希望做到每个缴费单一页,请记得千万不要单击列表,然后在列表后方加入分页符号,因为列表标示这一连段项目的总集合。因此,在列表后加入分页符号是不会有分页的效果。若是要分页,请单击矩形属性,在矩形后方加入分页符号,才能得到我们要的效果。

 

clip_image014

 

clip_image016



错误 *** Using Compiler 'V5.06 update 5 (build 528)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin' Build target 'LL' compiling main.c... linking... LL\LL.axf: Error: L6218E: Undefined symbol SystemClock_Config (referred from main.o). Not enough information to list image symbols. Not enough information to list load addresses in the image map. Finished: 2 information, 0 warning and 1 error messages. "LL\LL.axf" - 1 Error(s), 0 Warning(s). Target not created. Build Time Elapsed: 00:00:03 main.c文件 /* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2025 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "adc.h" #include "dma.h" #include "tim.h" #include "usart.h" #include "gpio.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */ /* USER CODE END PTD */ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM */ /* USER CODE END PM */ /* Private variables ---------------------------------------------------------*/ /* USER CODE BEGIN PV */ /* USER CODE END PV */ /* Private function prototypes -----------------------------------------------*/ void SystemClock_Config(void); /* USER CODE BEGIN PFP */ /* USER CODE END PFP */ /* Private user code ---------------------------------------------------------*/ /* USER CODE BEGIN 0 */ /* USER CODE END 0 */ /** * @brief The application entry point. * @retval int */ int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ /* System interrupt init*/ /* SysTick_IRQn interrupt configuration */ NVIC_SetPriority(SysTick_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),15, 0)); /** Disable the internal Pull-Up in Dead Battery pins of UCPD peripheral */ /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_DMA_Init(); MX_USART1_UART_Init(); MX_ADC1_Init(); MX_ADC2_Init(); MX_TIM1_Init(); MX_TIM2_Init(); MX_TIM3_Init(); MX_TIM4_Init(); /* USER CODE BEGIN 2 */ /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */ } /** * @brief System Clock Configuration * @retval None */ /* USER CODE BEGIN 4 */ /* USER CODE END 4 */ /** * @brief This function is executed in case of error occurrence. * @retval None */ void Error_Handler(void) { /* USER CODE BEGIN Error_Handler_Debug */ /* User can add his own implementation to report the HAL error return state */ __disable_irq(); while (1) { } /* USER CODE END Error_Handler_Debug */ } #ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t *file, uint32_t line) { /* USER CODE BEGIN 6 */ /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* USER CODE END 6 */ } #endif /* USE_FULL_ASSERT */ sys.c文件 /* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2025 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "adc.h" #include "dma.h" #include "tim.h" #include "usart.h" #include "gpio.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */ /* USER CODE END PTD */ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM */ /* USER CODE END PM */ /* Private variables ---------------------------------------------------------*/ /* USER CODE BEGIN PV */ /* USER CODE END PV */ /* Private function prototypes -----------------------------------------------*/ void SystemClock_Config(void); /* USER CODE BEGIN PFP */ /* USER CODE END PFP */ /* Private user code ---------------------------------------------------------*/ /* USER CODE BEGIN 0 */ /* USER CODE END 0 */ /** * @brief The application entry point. * @retval int */ int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ /* System interrupt init*/ /* SysTick_IRQn interrupt configuration */ NVIC_SetPriority(SysTick_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),15, 0)); /** Disable the internal Pull-Up in Dead Battery pins of UCPD peripheral */ /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_DMA_Init(); MX_USART1_UART_Init(); MX_ADC1_Init(); MX_ADC2_Init(); MX_TIM1_Init(); MX_TIM2_Init(); MX_TIM3_Init(); MX_TIM4_Init(); /* USER CODE BEGIN 2 */ /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */ } /** * @brief System Clock Configuration * @retval None */ /* USER CODE BEGIN 4 */ /* USER CODE END 4 */ /** * @brief This function is executed in case of error occurrence. * @retval None */ void Error_Handler(void) { /* USER CODE BEGIN Error_Handler_Debug */ /* User can add his own implementation to report the HAL error return state */ __disable_irq(); while (1) { } /* USER CODE END Error_Handler_Debug */ } #ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t *file, uint32_t line) { /* USER CODE BEGIN 6 */ /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* USER CODE END 6 */ } #endif /* USE_FULL_ASS 怎么解决问题
最新发布
08-02
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值