{"id":922,"date":"2014-07-08T23:12:45","date_gmt":"2014-07-08T15:12:45","guid":{"rendered":"http:\/\/blog.amjet.biz\/IT\/?p=922"},"modified":"2014-10-23T10:06:46","modified_gmt":"2014-10-23T02:06:46","slug":"birt-viewer-%e4%be%9d%e6%93%9a%e5%82%b3%e5%85%a5%e5%8f%83%e6%95%b8%e9%a1%af%e7%a4%ba%e5%a0%b1%e8%a1%a8","status":"publish","type":"post","link":"https:\/\/blog.amjet.biz\/IT\/?p=922","title":{"rendered":"BIRT viewer \u4f9d\u64da\u50b3\u5165\u53c3\u6578\u986f\u793a\u5831\u8868"},"content":{"rendered":"<p>http:\/\/localhost:8080\/birt\/frameset?__report=myreport.rptdesign&#038;name=vincent<\/p>\n<p>\u5982\u4f55\u63a5\u6536 name \u9019\u500b\u5831\u8868\u53c3\u6578\uff0c\u4e26\u53ea\u986f\u793a name \u70ba vincent \u7684\u8cc7\u6599\u5462\uff1f<\/p>\n<p>1. \u5728 report parameters \u65b0\u589e\u4e00\u500b name \u70ba &#8216;name&#8217; \u7684 parameter<\/p>\n<p>2. \u5728 dataset \u7684 beforeOpen script \u7d44\u6210 SQL<\/p>\n<p>this.queryText = &#8220;select * from user where\u00a01=1&#8221;;<\/p>\n<p>if ( null != params[&#8220;name\u00a0&#8220;].value &amp;&amp; params[&#8220;name\u00a0&#8220;].value != &#8220;&#8221; ) {<\/p>\n<p>this.queryText+=&#8221;and name\u00a0\u00a0= &#8216;&#8221;+params[&#8220;name\u00a0&#8220;]+&#8221;&#8216; &#8220;;<\/p>\n<p>}<\/p>\n<p>\u8a2d\u5b9a Data Source \u53ca Data Sets \u5c31\u4e0d\u518d\u8aaa\u660e\u4e86\uff0c\u5b8c\u6210\u4ee5\u4e0a\u6b65\u9a5f\u5982\u679c url \u6709 name=vincent \u5c31\u53ea\u6703\u7522\u751f vincent \u7684\u5831\u8868\uff0c\u6c92\u6709\u7684\u8a71\u5c31\u662f\u8f38\u51fa\u6240\u6709 user table \u8cc7\u6599\u3002<\/p>\n<p>[ratings]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>http:\/\/localhost:8080\/birt\/frameset?__report=myreport.rptdesign&#038;name=vincent \u5982\u4f55\u63a5\u6536 name \u9019\u500b\u5831\u8868\u53c3\u6578\uff0c\u4e26\u53ea\u986f\u793a name \u70ba vincent \u7684\u8cc7\u6599\u5462\uff1f 1. \u5728 report parameters \u65b0\u589e\u4e00\u500b name \u70ba &#8216;name&#8217; \u7684 parameter 2. \u5728 dataset \u7684 beforeOpen script \u7d44\u6210 SQL this.queryText = &#8220;select * from user where\u00a01=1&#8221;; if ( null != params[&#8220;name\u00a0&#8220;].value &amp;&amp; params[&#8220;name\u00a0&#8220;].value != &#8220;&#8221; ) { this.queryText+=&#8221;and name\u00a0\u00a0= &#8216;&#8221;+params[&#8220;name\u00a0&#8220;]+&#8221;&#8216; &#8220;; } \u8a2d\u5b9a Data Source \u53ca Data Sets [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[112,113],"class_list":["post-922","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-birt","tag-parameter"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/posts\/922","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=922"}],"version-history":[{"count":2,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/posts\/922\/revisions"}],"predecessor-version":[{"id":924,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/posts\/922\/revisions\/924"}],"wp:attachment":[{"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=922"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=922"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=922"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}