reportviewer
- 格式:pdf
- 大小:947.09 KB
- 文档页数:60
ReportViewer,RDLC报表开发之分页前段时间开发报表,采⽤了 ReportViewer + RDLC , 开发整理如下.MS 的DataGrid ,GridView,和 ReportViewer 分页机制差不多,都需要绑定全部数据,MS控件⾃动处理分页。
只是ReportViewer 是按页⾯布局分页的,⽽不是按数据条数。
绑定全部数据的⽅式会⽆谓的增加服务器压⼒,尤其是数据计算和表关联多的情况下。
为了减轻服务器压⼒,我们采⽤数据分页,数据传到应⽤服务器端后,再加⼯⼀下(插⼊空数据),做也可分页数据源。
如果数据库有 100 条数据,每页10条数据,那存储过程返回10条数据后,还需要再插⼊90条数据。
当数据⼤的时候,插⼊的数据也很多。
有没有插⼊数据再少⼀点的办法呢?当然是有了,没有就不写了。
先提两个概念:维度和指标.维度: 是指公司,项⽬,区域等要分析的对象.指标: 是指针对维度进⾏计算的结果1. 先对维度进⾏分页.2.针对分页结果,有针对性的进⾏指标计算,可以把每个计算列,做成函数,⽅便调⽤,同时,也⽅便维护和测试。
⽅案是把页码做成分组,这样再插⼊的时候,就只插⼊ Celling( 90 ÷ 10 ) 条的空分组数据即可。
插⼊的数据少了 n 倍。
存存过程⽰例代码:CREATE proc[dbo].[R_ANALYSIS](@Query varchar(50)='', --查询条件@PageIndex int=1 , --从1开始@PageSize int=50 , --每页条数,传⼊ <=0 表⽰不分页。
@PageCount int=0 output --总页数输出参数)asbegindeclare@RowCount int ;--写业务,返回分页结果 , 分页结果放到表变量 @list 中/*⽰例:With Query_Rank as(select ROW_NUMBER() OVER (order by 1 )as RowNumber ,*from T_ROOM)select Col1,col2, dbo.Func1(Col1) , dbo.Func2(col1,col2)fromQuery_RankwhereRowNumber between 100 and 150*/if(@PageSize>0 )begin--计算 @RowCountset@PageCount=ceiling( @RowCount*1.0/@PageSize) ;endelsebeginset@PageCount=1endend所需要的两个程序加⼯函数:public static IEnumerable<T> ReportWrap<T>(this IEnumerable<T> Source, int CurrentPageIndex, int PageCount)where T : IReportModel, new(){if (PageCount < 2){foreach (var item in Source){yield return item;}yield break;}Func<int, T> CreateEmptyObj = (CurrentIndex) =>{T retVal = new T();retVal.SysPageIndex = CurrentIndex;return retVal;};for (int i = 0; i < CurrentPageIndex; i++){yield return CreateEmptyObj(i + 1);}foreach (var item in Source){item.SysPageIndex = CurrentPageIndex + 1;yield return item;}for (int i = CurrentPageIndex + 1; i < PageCount; i++){yield return CreateEmptyObj(i + 1);}}public static DataTable ReportWrap(this DataTable Source, int CurrentPageIndex, int PageCount){if (PageCount <=1){return Source;}Func<int, DataRow> CreateEmptyObj = (CurrentIndex) =>{DataRow retVal = Source.NewRow();retVal["SysPageIndex"] = CurrentIndex;return retVal;};for (int i = 0; i < CurrentPageIndex; i++){Source.Rows.InsertAt(CreateEmptyObj(i + 1), 0);}for (int i = CurrentPageIndex + 1; i < PageCount; i++){Source.Rows.Add(CreateEmptyObj(i + 1));}return Source;}程序调⽤函数代码,很简单:DataTable dt = db.Exec_SP_DataTable("sp_Report_ModuleVisitStatisView", pars);pageCount = Convert.ToInt32(pars[6].Value);dt.ReportWrap(pageIndex -1 , pageCount);之后,再把 DataTable 转成实体列表。
reportviewerReportViewer文档1. 介绍ReportViewerReportViewer是一个用于创建、显示和管理报表的控件。
它是由Microsoft开发的工具,可用于在Web或Windows应用程序中生成和呈现报表。
ReportViewer提供了一个功能强大的界面,使用户能够轻松地创建和管理报表。
2. ReportViewer的功能ReportViewer提供了多种功能,使用户能够创建、显示和管理报表。
以下是ReportViewer的一些主要功能:a. 报表设计工具:ReportViewer提供了一个报表设计工具,用户可以使用该工具创建自定义报表。
用户可以选择从多种预定义报表模板开始,然后根据自己的需求进行修改和定制。
报表设计工具提供了多种元素和控件,如文本框、图表、表格等,使用户能够创建丰富多样的报表。
b. 数据源连接:ReportViewer支持多种数据源,包括数据库、Web服务、XML文件等。
用户可以轻松地连接到不同的数据源,并将数据源中的数据用于报表的生成和呈现。
c. 报表预览:ReportViewer提供了一个实时预览功能,用户可以在报表设计过程中随时预览报表的效果。
这使得用户能够快速调整报表的布局和样式,以获得最佳的呈现效果。
d. 报表导出:ReportViewer支持多种报表导出格式,包括PDF、Excel、Word等。
用户可以将报表导出为这些格式,以便在不同的应用程序或平台上使用和共享报表。
e. 数据筛选和排序:ReportViewer允许用户对报表中的数据进行筛选和排序。
用户可以根据自己的需求定义筛选条件,并对报表中的数据进行排序。
这使得报表更加灵活和易于分析。
3. 使用ReportViewer创建报表使用ReportViewer创建报表非常简单。
以下是使用ReportViewer创建报表的一般步骤:a. 定义报表数据源:首先,用户需要定义报表的数据源。
rdlc 报表的使用第一阶段【添加数据集】首先在微软官网下载了报表并安装之。
打开VS2010,在项目中添加“新建项”,在“已安装的模版中”选择“Reporting”—》“报表”,在最下方键入名称。
打开“工具箱”,可以按照自己的需求,或拽和编辑各种控件。
也可以在“报表数据”为报表添加“内置字段”和“参数”。
打开“报表数据”的操作:“视图”—》最后一项“报表数据”,或者按“Ctrl + Alt + D ”。
既然是报表,当然离不开数据了。
我这里选择用数据库作为数据源。
在报表数据工具栏中,点击“新建”—》“数据集”会弹出一个新建数据集的界面:这里选择“数据库”,下一步,“数据集”,点击“新建连接”,选择好服务器名、密码和数据库。
测试一下:成功后,确定。
选择你所需要的表、视图、函数或存储过程。
确定后,返回到这个界面,你可以更改数据集的名称、选择具体的表、视图等。
然后确定。
这样在“报表数据”栏中就可以看到新建的数据集了。
第二阶段【设计报表】介绍一些设计报表的工具箱,在VS2010 IDE左侧“工具箱”中的报表项,文本框用于可以显示文字、传递参数。
表和矩阵则可以用来存放数据。
不同的是表是针对于“列数固定、行数可变的数据”设计的,而矩形则是针对于“列数与行数均可变”的聚合数据设计的。
一般数据库中的表字段都为引文,但是显示的时候,都用中文,为了保证数据隐秘,也行该用中文。
说说表中的实现,对于行标题,直接修改即可,而数据行可以修改,也可以不修改。
数据行由字段占位符构成,可以右击编辑占位符的属性来实现显示中文。
在查询报表时,占位符会被真实数据所代替。
,也可以编辑表达式,用!符号来做找到字段属性。
矩阵跟列表框差不多。
矩形可以作为其他报表项的容器,列表则是用于显示每一个组或数据行重复的数据项。
列表框可以通过编辑矩形属性,在可见性中绑定报表中的数据项。
图像则是用于显示图片的,可以手动导图。
对于需要汇总比较数据的用户来说,图标则是你的不二选择。
利用ReportViewer生成RDLC报表报表是应用程序,特别是数据库系统中的重要功能。
在Visual Studio 2010中,自带的ReportViewer控件,可以满足常用报表功能的实现,而且使用方便,以下就将介绍利用VS2010中的ReportViewer控件创建RDLC报表,并在winform程序中调用的实例,使用C#语法。
第一步:创建一个Windows应用程序在Visual Studio 2010中,选择“文件”菜单,新建-“项目”,从已安装模板中选择Visual C#,从中间的项目类型中,选择“Windows窗体应用程序”;在名称栏中,为项目指定名称;在位置栏中,指定想要保存的目录。
完成之后,项目中会有一个Form1,以下从对它的窗体设计器开始讲解。
像下面这样修改Form1的属性,当然也可以保留默认属性:Form1.Text = "MS Reporting Services 101 with Smart Client"Form1.Size = 750, 300第二步:为窗体(Form)添加报表查看器(Report Viewer)报表查看器,我们可以把它理解为显示和预览报表的容器。
它不仅可预览输出报表,还可帮助将报表信息生成各种格式(PDF或Excel等等),当然也包括打印功能。
请按如下步骤在Form1上放置好报表查看器控件:依次找到工具箱(ToolBox)――报表--报表查看器(ReportViewer),并把它拖到Form1上。
这会创建一个名为reportViewer1的新实例。
通过设置reportViewer1.Dock = Fill,报表查看器将会填充窗体的整个区域,以显示报表。
在完成第一步与第二步之后,窗体看起来应该如图1所示:图1第三步:为项目添加数据集(DataSet)数据集是伴随报表查看器而来的,它保存并提供从数据源而来的原始数据,我们便可对这些原始数据进行处理或在C#程序中输出。
rdlc打印时多出空⽩页⾯(reportviewer)
输⼊简体字,点下⾯繁体字按钮进⾏在线转换.RDLC报表设计好后,在ReportViewer预览报表时,页数都正常;但在切换為整页模式时,常造成多了不少空⽩页出来。
第⼀时间觉得不可思议,在ReportViewer看来正常,怎可能在整页预览时,格式会跑掉?如果在整页预览时格式跑掉,那在列印时也⼀定是这样的情形。
ReportViewer会将RDLC所设计的报表档显⽰其中,但和实际纸张列印时,并不是如此,因此时就要检查RDLC报表本⾝的⼤⼩。
1.先⾄Report.rdlc报表设计的页⾯,选择功能表上的[报表]->[报表属性],在[配置]的页籤中记录著输出报表的纸张⼤⼩,预设应為A4直式的纸张(页宽:21cm,页⾼:29.7cm,左右上下边界:2.5cm),记下这些值。
2.检查Report.rdlc的属性视窗中[主体]属性的Size值,它的宽度Width要⼩於[报表属性]中的(页宽) – (左边界) – (右边界)。
3.调整后再整页预览看看,多调⼏次应就不会再產⽣太多的空⽩页了。
ReportViewer报表的使用及参数传递新建一个Default页面,添加一个ReportViewer.在ReportViewer的最右上角有一个小三角,点击,设计新报表,这时就会跳到Reprot.rdlc里,点击工具箱,表,新建一个DataSet数据集。
新建连接,配置好数据源。
选择一个数据库,测试连接,成功,下一步,写SQK语句select * from table ,完成。
此时,到Report里,会看到网站数据源中就有刚刚的字段了。
现在可以把要显示的字段拖到表的详细信息中,再到Default中,点击小三角,选择报表Report1,此时,一个简单的报表就作好了。
下面再作一个需要参数的报表。
和刚刚一样,新建Default,报表页,数据集。
或是在刚刚的基础上,在DataSet中,点击右键,配置。
可以重写SQL语句。
数据集的查询语句像这样写。
select * from table where state=@state.这里是根据state查询在Report中,点击报表,报表参数,可以添加一个参数,state,,类型为boolean在工具箱中选择一个文本框。
在文本框上点击右键,表达式,选择参数,双击State,确定。
在Default中添加一个TextBox,Button.在 Default的数据源中,选择带参数的那个方法,到定义参数页面,参数源选择control,controlId选择传入参数的Id,如TextBox1,DefaultValue可以给一个默认值,Default页有一个TextBox1,和一个Button引用using Microsoft.Reporting.WebForms;在button的事件里写。
ReportParameter[] p = new ReportParameter[1];p[0] = new ReportParameter("state", TextBox1.Text); this.ReportViewer1.LocalReport.SetParameters(p); this.ReportViewer1.ShowParameterPrompts = false;这样,一个代参数的报表就作好了。
Winfrom的ReportViewer报表控件和.rdlc后缀的报表绑定应⽤1.创建⼀个winfrom项⽬,从⼯具箱添加ReportViewer控件,命名ReportViewer12.在项⽬中添加⼀个报表,命名Report1.rdlc3.打开刚刚添加的报表,画出模板4.添加⼀个数据集,⽤于报表绑定,命名DataSet15.在数据集中添加⼀个DataTable,命名DataTable1,有3列C1,C2,C36.在报表Report1.rdlc中添加数据集,命名DTTEST7.在报表中绑定数据 数据类型有⽂本,图⽚等等,本例就讲解这两种如何绑定。
1).⽂本:3种⽅式绑定。
A.在⽂本属性-值-输⼊栏中直接输⼊[C2] B.在⽂本属性-值-fx,输⼊=Fields!C2.Value c..在⽂本属性-值-fx-数据集-DTTEST-First(C2) 2).图⽚ a.静态图⽚:图⽚属性,图像源选择嵌⼊,然后点击导⼊。
2).动态图⽚:例如⼆维码、条形码,原理:把图⽚转成byte[],byte[]再转成base64数字编码的等效字符串。
A.图⽚属性,图像源选择数据库,选择对应MIME类型image/jpeg,字段点击fx,输⼊=System.Convert.FromBase64String(Fields!C1.Value)8.详细代码如下:using System;using System.Collections.Generic;using ponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;using Microsoft.Reporting.WinForms;using System.IO;using System.Drawing.Imaging;namespace WindowsFormsApplication1{public partial class Form1 : Form{public Form1(){InitializeComponent();}private void Form1_Load(object sender, EventArgs e){DataTable dt = new DataTable();dt.Columns.Add("C1", typeof(string));//列名必须与数据集的列名⼀致dt.Columns.Add("C2", typeof(string));//列名必须与数据集的列名⼀致dt.Columns.Add("C3", typeof(string));//列名必须与数据集的列名⼀致//动态图⽚绑定string c = Convert.ToBase64String(ImageToBytes("F:\\wenbin\\⼯作⽂件\\SF\\LOGO\\顺丰logo简体.jpg"));dt.Rows.Add(c, "陈先⽣收", "深圳市");//控件绑定报表reportViewer1.LocalReport.ReportPath = @"F:\test\QueueTest\WindowsFormsApplication1\Report1.rdlc";//报表绑定数据集reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DTTEST", dt));this.reportViewer1.RefreshReport();}///<summary>///将图⽚转成byte[]///</summary>///<param name="path">图⽚路径</param>///<returns></returns>public byte[] ImageToBytes(string path){Image image = Image.FromFile(path);//ImageFormat format = image.RawFormat;using (MemoryStream ms = new MemoryStream()) {image.Save(ms, image.RawFormat);byte[] buffer = new byte[ms.Length];//ms.Position = 0;//ms.Seek(0, SeekOrigin.Begin); //ms.Read(buffer, 0, buffer.Length);buffer = ms.ToArray();return buffer;}}///<summary>///将byte[]转成图⽚///</summary>///<param name="buffer">byte[]</param>///<returns></returns>public Image BytesToImage(byte[] buffer){MemoryStream ms = new MemoryStream(buffer);Image image = Image.FromStream(ms);return image;}}}。
服务器控件使用之Reportviewer 报表收藏1.Reportviewer 报表1.1.Reportviewer控件注:本教程附2个事例:●演练:在本地处理模式下将数据库数据源与ReportViewer Web 服务器控件一起使用●演练:在本地处理模式下将业务对象数据源与ReportViewer Web 服务器控件一起使用如果您已经对ReportViewer控件基础知识比较了解,可以直接参阅事例。
1.1.1.简介Microsoft Visual Studio 2005 包括报表设计功能和ReportViewer 控件,使您可以将功能完整的报表添加到自定义应用程序。
报表可以包含表格格式数据、聚合数据和多维数据。
提供ReportViewer 控件的目的是可以处理和显示应用程序中的报表。
控件有两种版本。
ReportViewer Web 服务器控件用于在 项目中驻留报表。
ReportViewer Windows 窗体控件用于在Windows 应用程序项目中驻留报表。
这两种版本的控件都可以配置为以本地处理模式或远程处理模式运行。
配置为何种处理模式将影响有关报表从设计到部署的所有方面。
●“本地处理模式”是指ReportViewer 控件在客户端应用程序中处理报表。
所有报表都是使用应用程序提供的数据作为本地过程处理的。
若要创建本地处理模式下使用的报表,需要使用Visual Studio 中的报表项目模板。
有关详细信息,请参阅将ReportViewer 配置为进行本地处理。
●“远程处理模式”是指由SQL Server 2005 Reporting Services 报表服务器处理报表。
在远程处理模式下,ReportViewer 控件用作查看器,显示已经在Reporting Services 报表服务器上发布的预定义报表。
从数据检索到报表呈现的所有操作都是在报表服务器上处理的。
若要使用远程处理模式,则必须具有SQL Server 2005 Reporting Services 的许可副本。
报告查看器 (ReportViewer) 是一个功能强大的报告工具,它能在.NET应用程序中方便地显示和管理报表。
而 ReportViewerCore 是ReportViewer 在 .NET Core 环境下的一个轻量级版本,它提供了与原版 ReportViewer 相似的功能,同时也方便开发者在 .NET Core 项目中使用报表功能。
接下来,我们将深入探讨 ReportViewerCore 的使用方法,帮助开发者更好地使用这一工具。
1. ReportViewerCore 是什么?ReportViewerCore 是一个在 .NET Core 应用程序中使用报表功能的工具。
它提供了类似于传统ReportViewer 的功能,包括报表的呈现、导出和打印等。
与传统的 ReportViewer 不同的是,ReportViewerCore 更轻量级,适用于 .NET Core 项目,同时也更加灵活,开发者可以更加自由地定制报表的显示和功能。
2. 使用 ReportViewerCore 的基本步骤要在 .NET Core 项目中使用 ReportViewerCore,首先需要在项目中安装相应的 NuGet 包。
安装完毕后,可以通过引用命名空间和初始化ReportViewerCore 来使用报表功能。
在初始化 ReportViewerCore 后,可以通过设置报表的路径、参数和数据源等信息来加载和显示报表。
还可以通过代码来定制报表的样式和功能,以满足项目的需求。
3. ReportViewerCore 的高级功能和定制除了基本的报表显示和管理功能,ReportViewerCore 还提供了一些高级的功能和定制选项。
可以通过设置报表的参数来实现动态筛选和查询功能;可以通过设置报表的主题和样式来定制报表的外观;还可以通过使用报表事件来控制报表的行为,比如在报表加载完成后执行特定的操作等。
这些高级功能和定制选项使得开发者可以更加灵活地使用 ReportViewerCore,并为项目定制符合需求的报表功能。
Overproduction = Structurally Low Real YieldsReal yields measure productivity of capital, i.e. output growth less growth in capital stock Real yields converging around 1-2% rate Index-linked bond markets confirm low real interest ratesChinese capital productivity low (maybe negative) but labour productivity high Third Asian Crisis?Western corporations see marginal returns flattened by Asian overproduction. Resort to:(a) cutting costs to boost 'average' return on exisiting capital(b) M&A but no new capexCorporate net cash flow invested in wholesale money markets80828486889092949698000204060810-6-4-2024681012-6-4-2024681012172227323742198019821984198619881990199219941996199820002002200420062008Fragile Finance -US Fed and Private Sector Credit Conditions'Bad' liabilities not bad assetsWholesale money markets (once) awash with liquidity from cash rich Western corporations and from 'Greenspan Put'Western banks turned away from retail deposits in favour of this 'cheap' wholesale funding. At same time, they had to find new clients to borrow Until recently Fed credit growth had been too sluggish. Growth following past crises averaged 11%. Private sector growth holding upRecent surge in Fed credit must be sustained for years. Unlike a one-off capital injection, refinancing is ongoingCentral Banks will have to increase liquidity much further and for longer than investors realiseShadow banking boom - January 2008 64,000 AAA-rated structured products and 12 AAAcompanies worldwide!73757779818385878991939597990103050709-20%0%20%40%60%80%100%120%-20%0%20%40%60%80%100%120%Shadow Banking72747678808284868890929496980002040608105,00010,00015,00020,00025,00005,00010,00015,00020,00025,000}}Wholesale Market FundingBreakdown of US Private Sector CreditPreliminary US data show credit advanced through February totalling US$20.6 trillion, or 6% below the October 2008 peak Most sources of credit still contracting, especially Commercial Paper and Finance HousesConsumer Credit is the exception and still expanding albeit at a slower pace than inlate-2009BanksFinance HousesOtherConsumer CreditGSEsCommercial Paper Securit-isationJAN 0820.73157.5 6.9% 6.8%10.6%0.6% 6.9%15.6%-24.4%-0.2%FEB 20.8180.6 6.7% 6.9%8.8% 2.1%-4.7%16.5%-16.8%0.8%MAR 20.97156.77.1%7.9%9.0% 2.4%-15.8%10.6%8.8%8.1%APR 20.91-57.2 6.2% 3.5% 2.3% 1.2%-11.9%10.1%-19.0%8.7%MAY 21.0088.3 5.9% 3.7% 1.6%-1.4%-2.1%9.3%-14.3%10.7%JUN 21.0442.5 5.3% 1.4%-1.9%-4.4% 4.0%9.9%-23.0%9.5%JUL 21.1388.9 5.0% 4.3% 2.0%-4.2% 5.7%9.1%-12.3%13.6%AUG 21.1848.6 5.2% 3.5% 1.6%-6.8%11.0% 3.9% 2.3%13.9%SEP 21.37188.3 5.4% 6.3%9.3%-7.2% 4.1% 2.6%-4.8%16.9%OCT 21.87497.87.2%14.6%25.1%-11.0% 4.4% 1.9%-2.4%32.6%NOV 21.69-182.5 5.9%9.9%17.3%-13.4% 1.4% 2.8%-8.1%23.8%DEC 21.62-61.4 5.1% 4.8%7.9%-15.6%18.3% 3.3% 6.6%9.6%JAN 0921.56-63.4 4.0%-5.5%-8.3%-15.5%14.9% 2.2% 3.2%-7.8%FEB 21.43-128.0 3.0%-4.6%-2.5%-15.0% 2.0% 2.6%-24.4%-9.6%MAR 21.43-0.6 2.2%-3.5%-1.9%-14.8%-11.5% 5.5%-29.1%-5.8%APR 21.22-209.7 1.5%-6.1%-3.0%-15.8%-11.2% 4.4%-54.8%-6.9%MAY 21.2413.8 1.1%-3.6%-0.4%-15.3%-1.9% 4.3%-52.8%-2.0%JUN 21.2512.3 1.0%-3.4%-0.4%-15.3%7.4% 3.3%-65.5% 5.4%JUL 21.16-84.80.1%-1.1%-0.7%-12.5%13.1% 6.5%-62.9%9.9%AUG 21.17 2.9-0.1%-1.3%-5.4%-12.1%27.4%7.0%-43.4%10.2%SEP 21.13-35.4-1.1%-2.2%-8.0%-11.7%32.8% 3.8% 1.4% 4.4%OCT 20.95-183.0-4.2%-4.0%-8.2%-15.3%45.9% 1.8%0.6%-2.5%NOV 20.93-16.4-3.5%-4.4%-4.3%-17.5%29.4%-1.1%-18.7%-4.5%DEC 20.90-33.4-3.4%-4.3%-1.7%-16.3%27.5%0.4%-40.9%-8.2%JAN 1020.69-205.9-4.0%-4.8%-2.2%-15.0%12.7%-0.3%-43.1%-8.0%Feb Est20.57-126.1-4.0%-6.8%-8.6%-14.0%14.6%1.3%-34.4%-8.6%3-Month Annualised % Change % Chg. 3m Ann.Total Credit (US$ Trs)MoM Chg. (US$ Bns)% Chg. YoYTrend I: MonetaryInflation - Evidence from Gold Price Regimes$ gold = 'price' of US moneyRising gold prices are a barometer of monetary excess, uncertainty and the low cost of carry Late-1996 fall coincided with "irrationalexuberance", "new economy" and productivity miracle hype. Tightening liquidity strengthens dollar but heightens credit riskStructural low real interest rates and rising liquidity bullish for goldUS$/oz. (Log Scale)79808182838485868788899091929394959697989900010203040506070809102003005001,0002003005001,000Monetary InflationMonetaryDeflation TargetMoney Supply Target Price of Gold Target Inflation Target Avoidance of Deflation Volcker Greenspan Greenspan BernankeVolatile goldStable goldFalling goldRising gold$ Gold Price Versus CommoditiesInflation is a process, not an event: gold,commodities, intermediates, then capital goods and servicesGold prices typically lead commodity prices by around 9 months2% real interest rates imply 8% real gold price gains, i.e. circa 10-12% nominal p.a.68707274767880828486889092949698000204060810-80-4004080120160200-80-4004080120160200Gold/Oil andCommodities/Gold RatiosLong-term stability apparent in both gold/oil and gold/commodity ratio'Peak Oil' concerns still existOil and non-oil commodities cheap against gold Latest gold/oil ratio =14.1x. Normal range 12-15xUS$1,000/oz. gold + ratio 12x US$85/bbl or9x US$110/bblBretton Woods gold US$35/oz. and oil US$ 2 1/2/bbl. Ratio = 141973 Floating Era, gold US$140/oz. and oil US$10/bbl. Ratio = 142005-08 gold average US$800/oz. and oilUS$60/bbl. Ratio = 13 1/30354086587087588088589089590090591091592092593093594094595095596096597097598098599099500000501105555555555555550.018731878188318881893189819031908191319181923192819331938194319481953195819631968197319781983198819931998200320080.05.018411847185318591865187118771883188918951901190719131919192519311937194319491955196119671973197919851991199720032009-80-60-40-200204060-80-60-40-200204060(0%-100%). From this data, we show'normalised' Investor Exposure Indexes for stocks and bonds, by countryWorld financial wealth peaked in October 2007 at US$112.2 trillionEquity/bond exposure chart signals 'buy' for equities80818283848586878889909192939495969798990001020304050607080910020,00040,00060,00080,000100,000120,000020,00040,00060,00080,000100,000120,000Bonds high relative to EquitiesEquities high relative to BondsEquity Market Exposure (Sentiment)Sentiment/exposure measured by standard deviation of equity asset allocation away from 'norm' vs. cashInvestor sentiment towards both developed and emerging equity markets has recovered Exposure back to 'normal' levelsDeveloped Markets (Index, LHS; Standard Deviations, RHS)Emerging Markets (Index, LHS; Standard Deviations, RHS)808182838485868788899091929394959697989900010203040506070809102040608010080818283848586878889909192939495969798990001020304050607080910-60-40-200204060Relative Equity Market Exposure (Sentiment)US versus EurozoneUS versus UKUS versus JapanUK versus Eurozone80818283848586878889909192939495969798990001020304050607080910-60-40-2020406080818283848586878889909192939495969798990001020304050607080910-60-40-2020406080818283848586878889909192939495969798990001020304050607080910-80-60-40-2002040608080818283848586878889909192939495969798990001020304050607080910-100-80-60-40-20020406080Relative Equity Market Exposure (Sentiment)US versus Emerging MarketsChina versus IndiaBrazil versus RussiaEurozone versus Emerging Markets80818283848586878889909192939495969798990001020304050607080910-60-40-2002040608080818283848586878889909192939495969798990001020304050607080910-60-40-20020406080818283848586878889909192939495969798990001020304050607080910-60-40-20204060Global Financial Assets by Major CurrencyWorld financial assets (major currencies) total US$67.7 trHoldings comprise US$27.7 tr in US dollars (40.9%); US$15.6 tr in Euros (23.1%), and US$14.2 tr in Yen (21.0%)US dollar holdings average 38.8%, a tad below current exposure10,00020,00030,00040,00050,00060,00070,000808182838485868788899091929394959697989900010203040506070809100%20%40%60%80%0%20%40%60%80%100%US dollarGold8081828384858687888990919293949596979899000102030405060708091020406080100G7 Currency Exposure (Sentiment)Yen and Euro exposure significantly above "normal"Sterling looks oversoldYenSterlingEuro-1 sd20406080100-1 sd20406080100-1 sd20406080100Index, LHS; Standard Deviations, RHS-1 sdSwiss Franc20406080100Currency Exposure (Sentiment)Index, LHS; Standard Deviations, RHSSingapore $-1 sd20406080100Brazilian Real20406080100Emerging Market Currencies-1 sd20406080100-1 sdUS$, HK$ and Remninbi20406080100-30-209900010203040506070809100Monthly Global Liquidity Cycle (Index, LHS)Major Regions: Weekly Series, Monetary Base (3m Ann. % Chg., Log Scale RHS)J a n . 22313M a r . 5261607-M a y 28189302010O c t . 12212D e c . 32414F e b . 42518829 2010J u l. 12212S e p . 22314N o v . 42516J a n . 6271710600,000800,0001,000,0001,200,0001,400,0001,600,0001,800,0002,000,0002,200,0002,400,000US Fed (monthly) liquidity index shows too hesitant start to quantitative easing in early 2008. Now tighteningFed balance sheet increasingly dependent on Treasury purchasesFed balance sheet split into "bankingdepartment" and "issue department". Former in decline, but latter increasing as Fed "prints money"Lender of Last Resort (banking department) support is in unambiguous decline. Shows that Credit Crisis 'over'757779818385878991939597990103050709TighteningGlobal Liquidity at a Peak?Global Liquidity index peaked in early 2009Key Central Banks (led by PBoC) starting to squeezeUS Fed led with ECB close behindPrivate sector liquidity weakening as funds switch into reviving real economyAsset market booms continue for 1 - 2 years after liquidity cycle peakBanking crisis typically occurs within 1 - 2 years of a liquidity cycle troughSterling Crisis US CommercialPaper CrisisUS Fiscal Volcker Fed'Nationalisation'Stock Market GoldAsset Market BoomBanking Crisis656769717375777981838587899193959799010305070920406080100204060801006567697173757779818385878991939597990103050709112040608010020406080100Next Trough 2010/11?Global Liquidity Cycle and Theoretical 5-year CycleCycle peaked in January 2009 missing its ideal 2007 'target' by some 18 monthsNext liquidity trough should be 2010/111972197719821987199319982003200820406080100020406080100 Momentum1967US Real EstateCommoditiesGoldNE Asian Stocks Real EstateGlobal Bonds Equity MarketsTechnology SharesUS Real EstateGoldGlobal EquitiesUS Penn SquareUK Banking CrisisLat Am DebtContinental IllinoisUS S&L Scandinavian Banks Japanese BanksBaringsWorldcomEnronUS Sub Prime UK Banks IcelandComparative Liquidity Cycles1980s, 1990s, 2000s Global Liquidity IndexCurrent 1990s 1980s85868788899091929394204060801002040608010091 92 93 94 95 96 97 98 99 0001 02 030405 06 07 08 09 10USJapanEmerging MarketsEurozoneComparative Liquidity Cycles1980s, 1990s, 2000sOverall Index By RegionCurrent 1990s 1980s8586878889909192939420406080100020406080108586878889909192939420406080100204060801008586878889909192939420406080100020406080100858687888990919293942046080100120240608010012091 92 93 94 95 96 97 98 99 0001 02 03 04 05 06 07 08 09 1091 92 93 94 95 96 97 98 99 0001 02 03 04 05 06 07 08 09 1091 92 93 94 95 96 97 98 99 0001 02 03 04 05 06 07 08 09 1091 92 93 94 95 96 97 98 99 0001 02 03 04 05 06 07 08 09 10Private Sector LiquidityFalling private sector liquidity consistent with V-shaped World economic rebound (i.e.money draining to real economy)USJapanEmerging MarketsEurozone7577798183858789919395979901030507090204060801002040608010075777981838587899193959799010305070902040608010020406080100757779818385878991939597990103050709020*********20406080100757779818385878991939597990103050709020*********20406080100Private Sector Liquidity Central Bank LiquidityUS Broad Money Supply GrowthM3 estimated by us since Fed stopped publication (2006)Broad money supply YoY has slowed sharply6062646668707274767880828486889092949698000204060810-5%0%5%10%15%20%-5%0%5%10%15%20%747678808284868890929496980002040608103006009001,2001,5001,8002,1002,4002,7000369121518212427303336Global Supply and Demand for LiquidityLiquidity demand has ebbed following 2008 surgeLiquidity supply slowing too8082848688909294969800020406081020406080100020406080100Supply DemandGlobal Net Supply ofLiquidity (Risk Index) andEquity Market ReturnsNet Supply of Liquidity (Risk Index; advanced 6 months)Equity Market Returns (YoY % Chg.)80828486889092949698000204060810-100-80-60-40-20020406080100-80%-60%-40%-20%0%20%40%60%80%Emerging MarketsSupply and Demand for LiquidityLiquidity supply and demand approachingequilibriumSupply Demand8082848688909294969800020406081020406080100020406080100Emerging MarketsNet Supply of Liquidity (Risk Index) and EquityMarket Returns80828486889092949698000204060810-120-80-4004080120-100%-80%-60%-40%-20%0%20%40%60%80%100%Net Supply of Liquidity (Risk Index; advanced 6 months)Equity Market Returns (YoY % Chg.)Taylor RulesThe 'Taylor Rule' is an estimated relationship showing the reaction functions of policymakers to changes in inflation and real economic activity. For example, each sustained 1% point rise (fall) in US inflation above the Fed's target is thought to raise (lower) short-term rates by 150bps Deviations correlate with changing real interest rates e.g. TIPS yield and credit spreadTaylor Rule puts Central Banks behind the curveG7USJapanEurozone7880828486889092949698000204060810024681012142468101214Taylor Rule (Percent)Actual Interest Rate (Percent)788082848688909294969800020406081002468101214161802468101214161882848688909294969800020406081024681012024681012828486889092949698000204060810-20246810-2246810Taylor Rule 'Gap' and LiquidityThe 'gap' between 'Taylor Rule' and actual interest rates measures the effective policystance, in interest rate terms. This should match liquidity conditions unless some unexpected credit demand shifts occur'Policy errors' show up in yield curves and fx movementsG7USJapanEurozone75777981838587899193959799010305070920406080100-600-400-2000200400Taylor Rule Gap (Basis Points; RHS)Liquidity Index (LHS)75777981838587899193959799010305070920406080100-800-600-400-200020040060080075777981838587899193959799010305070920406080100-700-560-420-280-140014028042056070075777981838587899193959799010305070920406080100-600-400-200200400Global Liquidity and the Yield CurveLiquidity leads yield curve by 6 - 9 months Falling liquidity flattens curves; rising liquidity steepens curvesNot unusual for yield curve to temporarily steepen just after liquidity cycle peaksOverall Liquidity Index (LHS)Yield Curve (Basis Points; RHS)727476788082848688909294969800020406081020406080100-200-100100200300LiquidityRisingYield CurveSteepeningLiquidity and the Yield Curve10-year less 3-month moneyPotential for further curve steepening is diminishingOverall Liquidity Index (LHS)Yield Curve (Basis Points; RHS)LiquidityYield CurveSteepeningLiquidityYield CurveSteepeningLiquidityYield CurveSteepeningLiquidityYield Curve SteepeningUSJapanUKEurozone8082848688909294969800020406081020406080100-600-400-2002004006008082848688909294969800020406081020406080100-300-200-10001002003004008082848688909294969800020406081020406080100-400-2002004008082848688909294969800020406081020406080100-600-400-200200400600US Liquidity and the YieldCurve30-year less 10-year yield closely correlates with liquidity cycle30/10 spread is a leading yield curve spreadand leads other spreadsspread. 10/2. 2yr yield . 3m 0LiquidityYield CurveSteepening 8385878991939597990103050709-200-100100200300400-200-1001002003004008082848688909294969800020406081020406080100-80-404080120≅RisksUS 10-Year Bond Yield (Annual Change; RHS)ECRI Weekly Leading Indicator (LHS)ECRI Weekly Leading Indicator andAnnual Change in US 10-Year Bond Yield (LHS)Series largely contemporaneous but movement in ECRI usually 'confirmed' by US bondsLarge current 'gap' (100-150bp) explained by Fed's 'buying-in' programme or complacencyUS Fed Liquidity Index (Index, 0%-100%, RHS)Probability of Fed tightening (%)Fed Liquidity Cycle (Index 0%-100%) and Probability of Tightening based on basket of US energy, food and commodity prices (RHS)US Fed has never tightened because of a CPI inflation pick-upEach of past five major tightening cycles precipitated by commodity price inflationUS Credit IndicatorsCredit tensions easing broadlyBEi (breakeven inflation) a credit-based variable0.00.51.01.52.02.53.03.5979899000102030405060708091010203040506070Credits Under PressureBretton Woods II notion ill-judgedForex volatility determines risk premia and hence credit spreadsForex market stability in the gift of Central Banks Low currency market volatility = low risk premia = tight spreadsWeak US dollar permitted more stable EM units9697989900010203040506070809102004006008001,0004%6%8%10%12%14%16%18%20%83858789919395979901030507091002003004005006007002%4%6%8%10%12%14%Trade-weighted US$Relative liquidity determines cross-ratesRelative liquidity defined as private sector less Central Bank liquidity for basket of currencies relative to US8486889092949698000204060810-25-20-15-10-50510152025-60-40-20204060Trade-weighted Exchange Rate (YoY % Chg.; LHS)Basket of Currencies less US: Central Bank Liquidity relative to Private Sector Cash Flow(Percentage Points, Advanced 12 Months; RHS)Strong DollarWeak Dollar8486889092949698000204060810-40-30-20-10010203040-100-50050100Strong Relative Liquidity and Exchange RatesRelative liquidity determines cross-ratesRelative liquidity defined as private sector less Central Bank liquidity for US relative to other country/currency zoneUS dollar should firm against the Euro in 2010Sterling should progressively stabilise against US dollarUS dollar should stabilise and recover against Yen Yen has been driven by closing of the 'carry trade' over recent months. We expect a move back in line with liquidity conditions in 2010, i.e. the Euro should strengthenUS$ Exchange Rate (YoY % Chg.; LHS)Country/Currency Zone less US:Central Bank Liquidity relative to Private Sector Cash Flow (Percentage Points,Advanced 6 Months*; RHS)* US$/£, 15m; US$/Y, 18m; Y/E, 24m.US$/-40-30-20-10010203040Strong US$US$US$US$US$/£8486889092949698000204060810-40-30-20-10010203040-100-5050100Strong US$US$US$/Y848688909294969800020406081012-60-3003060-100-5050100Yen/Strong EuroEuroUS Dollar, Commodity Prices and Emerging MarketsUS dollar trade-weighted index appears to have bottomedCyclical rally to around 90 probable Could even move towards 95 if recent downtrend is brokenCommodities and emerging markets move opposite to US dollarSource: Bank of England, Datastream858687888990919293949596979899000102030405060708091060801001201401601502002503003504004505008586878889909192939495969798990001020304050607080910608010012014016018050100150200250300350400Trade-weighted US dollar909192939495969798990001020304050607080910708090100110120130708090100110120130Emerging Market Liquidity ConditionsBrazilRussiaChinaIndia7577798183858789919395979901030507090204060801002040608010075777981838587899193959799010305070902040608010020406080100Private Sector Liquidity Central Bank Liquidity75777981838587899193959799010305070920406080100204060801007577798183858789919395979901030507092040608010020406080100Central Bank liquidity volatile, largely the result of similarly volatile foreign flows BRIC Central Banks have lately been tight0204060801007577798183858789919395979901030507090246810121416182022Fed Easing CycleFed liquidity index soared to record highs following hesitant startShort-term interest rates follow liquidity cycle by around 12 monthsFed balance sheet split into "bankingdepartment" and "issue department". Former indecline, but latter increasing as Fed "prints money"Lender of Last Resort (banking department) support is in unambiguous decline. Shows thatCredit Crisis 'over'US Liquidity Leads Business ActivityUS liquidity leads US purchasing managers index by around 12 monthsPurchasing managers index leads S&P500 aggregate profits growth by around one year Peak profits growth and falling purchasing managers index both predicted by liquidityStronger economy expected this year, but latest dip in liquidity questions its sustainabilityLiquidity downturn failed to affect corporate sector in same way since they are net cash positive757779818385878991939597990103050709112040608010020304050607080Tight8082848688909294969800020406081020304050607080-40-20204075777981838587899193959799010305070911。