在RDLC报告中没有标题的Excel导出。 [英] Excel export without header in RDLC report.

查看:110
本文介绍了在RDLC报告中没有标题的Excel导出。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含标题的RDLC报告。它工作正常并导出到excel生成带有数据和标头的excel文件。我无法删除报表查看器中所需的标题,但在导出时,标题数据不应加载,excel文件应以表列标题开头而不是报表标题。



我尝试了什么:



我试图检查标题属性,如果我取消选中在首页上打印标题是从报告查看器中删除。但我希望只在导出时删除标题。对此有任何建议都会有所帮助。谢谢

I have a RDLC report with header. It works fine and export to excel generates excel file with data as well as header. I can not remove the header as it is required in report viewer but while exporting, the header data should not load and excel file should start with table column header not report header.

What I have tried:

I tried to check header properties, If I unchecked the "Print on first page" the header is removed from Report viewer. But I want the header to be removed only while exporting. Any suggestion on this will be helpful. Thanks

推荐答案

如果你使用的是SQL 2008 R2或更高版本,导出报告时很容易隐藏元素:

Globals!RenderFormat又名渲染器依赖报表布局 - Robert Bruckner的报表服务&安培; Power View Blog [ ^ ]



如果您使用的是2012或更高版本,则还需要检查渲染格式EXCELOPENXML。



要在导出到Excel时隐藏元素,请将其隐藏属性设置为表达式:

If you're using SQL 2008 R2 or later, it's easy to hide elements when the report is exported:
Globals!RenderFormat aka Renderer Dependent Report Layout – Robert Bruckner's Reporting Services & Power View Blog[^]

If you're using 2012 or later, you'll also need to check for a render format of "EXCELOPENXML".

To hide an element when you're exporting to Excel, set its "hidden" property to the expression:
=Globals!RenderFormat.IsInteractive = "EXCEL" Or Globals!RenderFormat.IsInteractive = "EXCELOPENXML"





如果你正在使用SQL 2005或2008,似乎没有解决方案。



If you're using SQL 2005 or 2008, there doesn't seem to be a solution.


这篇关于在RDLC报告中没有标题的Excel导出。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆