如何使用水晶报告发布Windows应用程序? [英] How can i publish windows application with crystal report ?

查看:65
本文介绍了如何使用水晶报告发布Windows应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Windows应用程序,我的一个页面创建了一个使用水晶报告生成函数的报告。在运行代码时,它在我的系统中工作正常。

但是在我的系统中安装已发布的应用程序后它无法正常工作。带报告的错误

以下是cosde用于设置水晶报告源



昏暗的报告作为新报告文件

Report.Load(path)'路径正在使用应用程序。 executepath

Report.SetDataSource(< dataset name =>)

reportviewer.ReportSource = Report



但是在安装应用程序之后我无法在应用程序安装文件夹(c \programfiles \ application)中找到报告文件(.rpt)。

为什么这个报告不会来这里?

因为这会收到无法加载报告的错误(Report.Load(路径)问题,因为这里report.rpt在应用程序文件夹中不可用)

什么是soltion here?

解决方案

1。你应该打包报告文件(。rpt文件)与设置

2.设置路径变量(使用反射)而不是使用应用程序。 executepath

快乐编码!

:)


http://social.msdn.microsoft.com/Forums/en-US/vscrystalreports/thread/438b3ee8-9854 -40b8-ac8f-cadbabff455d [ ^ ]



阅读本文


i have created one windows application and one of my page i created one report genetaing function using crystal report. It is working fine in my system while am running the code.
But after installing the published application in my system it is not working.Error with report
below is the cosde which am using to set crystal report source

Dim Report As New ReportDocument
Report.Load(path) 'path am getting using application.executepath
Report.SetDataSource(<dataset name="">)
reportviewer.ReportSource = Report

but after installing the application i couldnt find the report file (.rpt) in application installed folder(c\programfiles\application).
Why this report is not coming here?
Because of this am getting error that 'failed to load report' (Problem with Report.Load(path) because here report.rpt is not available in application folder )
What is the soltion here?

解决方案

1. you should pack report file (.rpt file) with setup
2. set path varible (using reflection) not using application.executepath
Happy Coding!
:)


http://social.msdn.microsoft.com/Forums/en-US/vscrystalreports/thread/438b3ee8-9854-40b8-ac8f-cadbabff455d[^]

read this article


这篇关于如何使用水晶报告发布Windows应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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