Crystal Reports Excel导出与工作表 [英] Crystal Reports Excel export with worksheets

查看:523
本文介绍了Crystal Reports Excel导出与工作表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法说服Crystal Reports在导出到Excel(仅数据)时导出页面/组/任何单独的工作表?我使用VS2008(版本10.5)附带的CR。



谢谢。

解决方案

根据文档,您不能将报表直接导出到单个Excel工作簿中的多个工作表。



当Excel中的限制达到65536行时,导出器创建了一个新的工作表,但是你不能控制:)



更新

要创建自己的Excel合并:



PRE:已安装Office(Excel)SDK库。

PRE:将需要合并的文件放在一个目录中。



在VS2008解决方案:




  • 创建新的空Excel工作簿(变量: objNewWorkbook

  • 循环浏览目录(放置Excel文件的位置)和每个项目的文件:


    1. 将文件加载为Excel工作簿: objWorkbookLoop


      • objNewWorkbook 中创建新工作表(可选: > objWorkbookLoop )将 objWorkbookLoop 中的数据(可能是sheet1)复制到 objWorkbookLoop > objNewWorksheetLoop

      • >到文件。

      Is there a way to convince Crystal Reports to export a page / group / whatever to separate worksheets when exporting to Excel (Data Only)? I'm using the CR that came with VS2008 (version 10.5)

      Thanks.

      解决方案

      According to the documentation you cannot export a report directly to multiple worksheets in a single Excel workbook.

      When the limit of 65536 rows in Excel is reached though, the exporter does create a new worksheet, but you are not in control :)

      update
      To create your own Excel merger:

      PRE: Make sure you have the Office (Excel) SDK libraries installed.
      PRE: Place the files that need to be merged in a single directory.

      In a VS2008 solution:

      • Create a new empty Excel Workbook (variable: objNewWorkbook)
      • Loop through the files in the directory (where you placed the Excel files) and for each item:

        1. Load the file as a Excel Workbook (variable: objWorkbookLoop)
          • Create a new Worksheet in objNewWorkbook (optionally: with the filename of objWorkbookLoop) (variable: objNewWorksheetLoop)
          • Copy the data from (probably sheet1 in) objWorkbookLoop to objNewWorksheetLoop

      • Finally save objNewWorkbook to a file.

      这篇关于Crystal Reports Excel导出与工作表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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