添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

重分组介绍
语法:<?for-each-group: BASE-GROUP;GROUPING-ELEMENT?>
用法:重分组可以把XML数据做重新分组,这样数据的展示就不一定必须按照XML数据的结构显示。例如原来的XML数据结构是CD类别->CD信息(名称,年份,国家,价格),我们可以用重分组功能按CD年份->CD国家来显示.

重分组应用
1 按照和XML数据不同的结构显示数据
XML数据格式如下:

<CATALOG>
      <TITLE>Empire Burlesque</TITLE>
      <ARTIST>Bob Dylan</ARTIST>
      <COUNTRY>USA</COUNTRY>
      <COMPANY>Columbia</COMPANY>
      <PRICE>10.90</PRICE>
      <YEAR>1985</YEAR>
。。。。。
</CATALOG>

报表打算按照国家和年份重新分组,用到的重分组如下:

<?for-each-group:CD;COUNTRY?>
<?for-each:current-group();YEAR?> 

这里的current-group()表示当前COUNTRY组下的子分组

2 显示PIVOT报表
XML数据如下:

<ROWSET>
<RESULTS>
 <INDUSTRY>Motor Vehicle Dealers</INDUSTRY>
 <YEAR>2005</YEAR>
 <QUARTER>Q1</QUARTER>
 <SALES>1000</SALES>
</RESULTS>
<RESULTS>
 <INDUSTRY>Motor Vehicle Dealers</INDUSTRY>
 <YEAR>2005</YEAR>
 <QUARTER>Q2</QUARTER>
 <SALES>2000</SALES>
</RESULTS>
<RESULTS>
 <INDUSTRY>Motor Vehicle Dealers</INDUSTRY>
 <YEAR>2004</YEAR>
 <QUARTER>Q1</QUARTER>
 <SALES>3000</SALES>
</RESULTS>
</ROWSET>

如果想按年份生成PIVOT表,可以用如下TAG实现:

<?for-each-group@column:RESULTS;YEAR?>
<?YEAR?>
<?end for-each-group?>
<?for-each-group:RESULTS;INDUSTRY?>
<?for-each-group@cell:current-group();YEAR?>
<?sum(current-group()//SALES)?>
<?end for-each-group?>
<?end for-each-group?>

这里的@cell是给每个组生成一个CELL

Analyzing Data with Power BI and Power Pivot for Excel (Business Skills) by Alberto Ferrari English | 25 Apr. 2017 | ASIN: B0713N6BBW | 256 Pages | AZW3 | 21.78 MB Renowned DAX experts Alberto Ferrari and Marco Russo teach you how to design data models for maximum efficiency and effectiveness. How can you use Excel and Power BI to gain real insights into your information? As you examine your data, how do you write a formula that provides the numbers you need? The answers to both of these questions lie with the data model. This book introduces the basic techniques for shaping data models in Excel and Power BI. It’s meant for readers who are new to data modeling as well as for experienced data modelers looking for tips from the experts. If you want to use Power BI or Excel to analyze data, the many real-world examples in this book will help you look at your reports in a different way–like experienced data modelers do. As you’ll soon see, with the right data model, the correct answer is always a simple one! By reading this book, you will: • Gain an understanding of the basics of data modeling, including tables, relationships, and keys • Familiarize yourself with star schemas, snowflakes, and common modeling techniques • Learn the importance of granularity • Discover how to use multiple fact tables, like sales and purchases, in a complex data model • Manage calendar-related calculations by using date tables • Track historical attributes, like previous addresses of customers or manager assignments • Use snapshots to compute quantity on hand • Work with multiple currencies in the most efficient way • Analyze events that have durations, including overlapping durations • Learn what data model you need to answer your specific business questions About This Book • For Excel and Power BI users who want to exploit the full power of their favorite tools • For BI professionals seeking new ideas for modeling data 第一章    创建一个简单的RTF模板 安装好Oracle BI Publisher Desktop之后,可以使用Word中的BI Publisher插件来进行报表布局模板(RTF格式)设计。 1.      打开Word之后,在BI Publisher插件中加载XML数据: 2.      可以使用Word标准功能进行布局设计: 3.      设计订单头部分的打印样式: rtf富文本 In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word... 我正在尝试使用xsl:for-each在XSLT 2.0中对元素进行分组 .以下是我输入的说明: heading text title 1111 2222 text 3333 another title 4444 text 5555 heading text another title 6666 7777 another title 8888 9999 我试图... 定义一个组的目的是告诉XMLPublisher对重复的数据行进行循环显示,也就是说需要使用for-each进行数据记录的循环显示 <?for-each:XML group element tag name?> <?endfo... RTFTemplate巧妙的利用了word的“域”和书签实现了报表模板的设计。通过向rtf插入特定类型的域字段,用来标记将会被报表引擎用实际数据或者逻辑替代的部分。 通常单一的值用:Mergefield代替。 循环和条件采用:bookmark替代。 RefTemplate底层采用了两类模板引擎: 第一类:Jakarta Velocity 第二类:freemark 采用的模板不同生成的中