使用vb.net 2010创建RDLC报告 [英] Create RDLC report using vb.net 2010
本文介绍了使用vb.net 2010创建RDLC报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都可以帮助创建一个rdlc报告,该报告将使用日期作为用户在界面上选择的参数从访问数据库获取数据
解决方案
嗯,这里有一个提示和很好的例子。
1.在项目中添加一份报表(report1.rdlc)并进行相应的设计
2 。从ReportData选项卡创建一个参数(它位于屏幕左侧靠近工具箱的位置)
3.将工具箱中的reportViewer添加到将显示报告的表单中。
4.将其停靠以使其覆盖表格的整个区域。
5.为项目添加一个数据源(即从vb连接到数据库)
到这里 http://www.sourcecodester.com/visual- basic-net / load-rdlc-report-using-report-viewer-programmatically.html [ ^ ]代码。
使用vb创建RDLC报告。来自SQL数据库的net 2010
Private Sub Formlogin_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)处理MyBase.Load
尝试
Dim con As New SqlConnection
con.ConnectionString = connection path
con.Open()
Dim cmd1 As New SqlClient.SqlCommand( tablename 中的select' columnname '' ,con)
Dim da As New SqlClient.SqlDataAdapter(cmd1)
Dim ds As New DataSet()
da.Fill(ds,list)
Dim col As New AutoCompleteStringCollection
Dim i As Integer
For i = 0 To ds.Tables(0).Rows.Count - 1
col.Add(ds.Tables (0).Rows(i)( columnname )。ToString)
Next
TextBox1.AutoCompleteSource = AutoCompleteSource.CustomSource
TextBox1.AutoCompleteCustomSource = col
TextBox1.AutoCompleteMode = AutoCompleteMode.Suggest
con.Close()
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
End Sub
Can anyone help create a rdlc report that will fetch data from access database using date as a parameter that is picked by the user on the interface
解决方案
Well, here is a tip and great example.
1. Add a report form (report1.rdlc) to your project and design accordingly
2. Create a parameter from the ReportData tab (its on the left side of the screen close to the toolbox)
3. Add a reportViewer from the toolbox to your form that will display the report.
4. Dock it to make it cover the whole area of the form.
5. Add a datasource to your project (i.e. connect to database from vb)
go here http://www.sourcecodester.com/visual-basic-net/load-rdlc-report-using-report-viewer-programmatically.html[^] for the code.
Create RDLC report using vb.net 2010 from SQL database
Private Sub Formlogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try Dim con As New SqlConnection con.ConnectionString = "connection Path" con.Open() Dim cmd1 As New SqlClient.SqlCommand("select'columnname' from 'tablename'", con) Dim da As New SqlClient.SqlDataAdapter(cmd1) Dim ds As New DataSet() da.Fill(ds, "list") Dim col As New AutoCompleteStringCollection Dim i As Integer For i = 0 To ds.Tables(0).Rows.Count - 1 col.Add(ds.Tables(0).Rows(i)("columnname").ToString) Next TextBox1.AutoCompleteSource = AutoCompleteSource.CustomSource TextBox1.AutoCompleteCustomSource = col TextBox1.AutoCompleteMode = AutoCompleteMode.Suggest con.Close() Catch ex As Exception MessageBox.Show(ex.ToString) End Try End Sub
这篇关于使用vb.net 2010创建RDLC报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文