找回密码
 立即注册

QQ登录

只需一步,快速开始

Lenka.Guo 讲师达人认证 悬赏达人认证
超级版主   /  发表于:2016-2-3 17:30  /   查看:4606  /  回复:0
源码下载:



功能描述:
本示例演示了通过点击按钮传进参数值,并赋给 HTML5viewer 中报表参数

开发环境:
VS2013+ActiveReports  10
(注:如果是ActiveReports10以下的版本,请将源码中的js,css 文件替换为相关版本,详情可参考http://gcdn.gcpowertools.com.cn/showtopic-15730.html
实现步骤:
1.创建工程,在Visual Studio 2013 中创建空的Web项目;
2.添加文件,安装ActiveReports 报表服务器默认路径下的 C:\ActiveReports 10 Server\SDK\Samples\HTML5 ViewerActiveReports 路径 C:\Users\Documents\GrapeCity Samples\ActiveReports 10\HTML5 Viewer)将 css 文件夹下的文件和 Scripts 目录下的文件拷贝到工程目录下(Fonts文件必要时也需要拷贝)。
3. 添加报表,设置参数







4.添加页面,点击项目添加新项,选择HTML页面;
在<body>标签内添加Text和Button
  1. <body >
  2.     <input id="input_text1" type="text" value="2" style="width: 100px;" />  
  3.    <button id="button1">获取</button >
复制代码


在<body>标签内添加Viewer:
  1. <div id="viewerContainer"/>
复制代码


添加<Script>标签
  1. <script type="text/javascript">
  2.          $(document).ready(function () {
  3.                 $("#button1").click(function () {
  4.                     var result1 = $("#input_text1").val();
  5.                     var viewer = GrapeCity.ActiveReports.Viewer({
  6.                         element: '#viewerContainer',

  7.                         report: {
  8.                             id: 'RdlReport1.rdlx',
  9.                             parameters: [{
  10.                                 name: 'ReportParameter1',
  11.                                 value: $("#input_text1").val(),
  12.                             }]},
  13.                         reportService: {
  14.                             url: '/ActiveReports.ReportService.asmx'
  15.                         },

  16.                         uiType: 'Desktop',
  17.                         localeUri: 'Scripts/i18n/Localeuri.txt',
  18.                     });

  19.                
  20.                 });           });
复制代码



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

0 个回复

您需要登录后才可以回帖 登录 | 立即注册
返回顶部