合并来自Visual Studio的Crystal Report [英] Incorporate Crystal Report from Visual Studio

查看:49
本文介绍了合并来自Visual Studio的Crystal Report的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我是使用Crystal Report的新手,已经完成了系统并制作了一些Crystal报表,现在我要用户从我的应用程序中打开该报表,我的意思是EX:当单击按钮时,一个报表被打开..
任何人都可以帮助我做到这一点
谢谢Advanced

hi guys ,
i am new in using Crystal report , i have finished my system and i made some crystal report , for now i want the user open the report from my application , i mean for EX : When button clicked a report is opened ..
any one can help me in doing that
thanks in advanced

推荐答案

这是我的示例项目中的代码.我将数据从数据库导入到datagrid中,然后从那里打印在Crystal报表上.希望这会有所帮助.

This is the code from my sample project. I am getting the data from database into datagrid and from there printing it on crystal report. Hope this helps.

Private Sub Print_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GenPrint.Click
        Dim cryRpt As New genrep  'genrep is your crystal report name
        Dim GridData As New GetData() 
        Dim DT As DataTable = GridData.GetDataSearch()
        cryRpt.Load("F:\Projects\2008 Projects\Test Application\Test Application\Genrep.rpt")
        cryRpt.SetDataSource(DT) 'Just set your data source if you are not using a grid view
        ReportViewer.ReportSource = cryRpt
        ReportViewer.Refresh()
    End Sub


这篇关于合并来自Visual Studio的Crystal Report的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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