In case anyone else is looking for this. As of April 2013, you can still get the free Visual Studio edition of Crystal Reports from this web site: SAP Crystal Reports - Downloads. It installs into Visual Studio 2010 or VS 2012, and you can edit and save RPT files with as much capability as the standard Crystal Reports editor. Most of us develop.net applications and will try to integrate the crystal reports with the applications. I tried all possbile options, and succesfully implemented them. I would like share some of them with you all. Environment Visual Studio 2005 and Crystal Report XI. Create a Crystal Report as usual in Visual studio 2005.net using ODBC connection. In this example 'CrystalReport.rpt' 2. Create a aspx web form to display the report. This form will be a place holder for crystal report. In design mode, drag and drop Crystal Report viewer control and don't configure anything. Open code behind.aspx.vb 'Declare public variable Private myReportDocument As ReportDocument 'Note: This is Page Init event not Page Load event Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo() ' Note: This is your local ODBC Name NOT SQL SERVER NAME myConnectionInfo.ServerName = 'PUBSODBCNAME' ' If your ODBC connection defaulted to your application database, ' you can remove the following line. MyConnectionInfo.DatabaseName = 'Pubs' myConnectionInfo.UserID = 'userid' myConnectionInfo.Password = 'password' myReportDocument = New ReportDocument() 'If your crystal report is in some other folder, give proper path ' In this example,.rpt file in the same folder as.aspx file Dim reportPath As String = Server.MapPath('CrystalReport.rpt') myReportDocument.Load(reportPath) SetDBLogonForReport(myConnectionInfo, myReportDocument) CrystalReportViewer1.ReportSource = myReportDocument ' You can customize the Crystal Reports toolbar. ' like the following. I have disabled the business object logo ' in the tool bar. CrystalReportViewer1.HasCrystalLogo = False End Sub 'This Sub is necessary for Crystal report database connection Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo, ByVal myReportDocument As ReportDocument) Dim myTables As Tables = myReportDocument.Database.Tables For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In myTables Dim myTableLogonInfo As TableLogOnInfo = myTable.LogOnInfo myTableLogonInfo.ConnectionInfo = myConnectionInfo myTable.ApplyLogOnInfo(myTableLogonInfo) Next 5. Now run the.aspx page. You will see the report or the crystal report parameter form. How to download the watchtower bound volumes. It will not ask you DB login information. You can customize this.aspx file to display your banner etc. And call it from other.aspx file. Try it and give me your suggestion. And, Next week custom paramter form to replace Crystal parameter form. See you then. SujiRavi Visual Studio 2005 ASP.net 2.0 VS 2005 code ASP.NET vs2005 Web Applications Report vb.net.ASPX crystal reports parameter asp.net vb.net.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2019
Categories |