In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to use the .net crystal report, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
1. Create a new windows application:CristalTest
2. Add a new dataset DataSet1.xsd
3. Add table DataTable1 to DataSet1, add four columns of Column1,Column2,Column3,Column4 to DataTable1, and save
4. Add a crystal report file CrystalReport1.rpt to set up the data source:
Project data (Project Data)-- > Ado.net DataSets-- > * * .DataSet1-- > DataTable1
5. Drag Column1,Column2,Column3,Column4 to Crystal report details (Details)
6. Add a control CrystalReportViewer1 to Form1
7. Then add the code for Form1_Load
Dim m_sqlConn As SqlConnection Dim m_strSqlConn As String m_strSqlConn = "Data Source=localhost; initial catalog=pubs; User id=sa Password= "m_sqlConn = New SqlConnection (m_strSqlConn) Try Dim sqlAdp As SqlDataAdapter Dim strSql As String Dim ds = New DataSet () m_sqlConn.Open () strSql =" SELECT au_lname AS Column1, au_fname AS Column2, phone AS Column3, address AS Column4 FROM dbo.authors "sqlAdp = New SqlDataAdapter (strSql M_sqlConn) sqlAdp.Fill (ds) Dim crReportDocument = New CrystalReport1 () crReportDocument.SetDataSource (ds.Tables (0)) CrystalReportViewer1.ReportSource = crReportDocument Catch ex As Exception MessageBox.Show (ex.ToString ()) End Try
8. Add Imports System.DataImports System.Data.SqlClient to the form1.vb file header
9. M_strSqlConn = "Data Source=localhost
Initial catalog=pubs; User id=sa
"password=" this may have to be changed to your machine's Sql Server connection information.
The above is all the contents of the article "how to use .net Crystal report". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.