从Vb.net表格调用Crystal报表(Accsess DB) [英] Calling Crystal report from Vb.net form (Accsess DB)
本文介绍了从Vb.net表格调用Crystal报表(Accsess DB)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请注意,我使用Accsess数据库创建了一个水晶报告,我使用以下代码从Vb表单调用报告。
但我面临问题如何使数据库连接成为在不同机器上定位数据库的日常工具。
以下代码简称为报告。但我需要将数据库连接设置为daynamic。
Please note that i created an a crystal report using Accsess Database and i called the report from a Vb form using the below code.
but i facing problem on how to make a database connection to be a daynamic to locate the database on different machine.
The below code is succssefully called the report. but i need to set the database connection to be a daynamic.
Sub run_rep()
Dim rpt As New CrystalReport4
MsgBox(Application.StartupPath & "\CrystalReport4.rpt")
rpt.Load(Application.StartupPath & "\CrystalReport4.rpt")
Dim PARAMField As New CrystalDecisions.Shared.ParameterField
Dim paramvalue As New CrystalDecisions.Shared.ParameterDiscreteValue
Dim paramfileds As New CrystalDecisions.Shared.ParameterFields
PARAMField.ParameterFieldName = "P_NUM"
paramvalue.Value = p_qut_number
PARAMField.CurrentValues.Add(paramvalue)
paramfileds.Add(PARAMField)
Rep_v1.ReportSource = rpt
Rep_v1.ParameterFieldInfo = paramfileds
End Sub
请建议
Please advice
推荐答案
检查此答案是否存在类似问题
Crystal Report 13中的动态数据库连接......? [ ^ ]
Check this answer for similar question
Dynamic Database Connection in Crystal Report 13...?[^]
亲爱的
非常感谢您的重播,但请注意我在VB.net上工作而不是C#和DB是访问。
你能给我一个VB.net步骤来获取一个日常的Accsess数据库连接。
最好的问候
Kharbat。
Dear
Thanks a alot for your replay ,but please note that i am working on VB.net not C# and the DB is accesss.
Can you please send me an VB.net steps for a daynamic Accsess DB connection.
Best regards
Kharbat.
这篇关于从Vb.net表格调用Crystal报表(Accsess DB)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文