Report Viewer

by Ruben 3/20/2008 8:00:00 PM

Visual Studio 2005 includes report design functionality in CrystalReport controls so that you can add full-featured reports to a customized application report viewer. CrystalReport are designed with drag-and-drop simplicity using the Designer.

CrystalReport control offers the following benefits:
  - The reporting engine built into CrystalReport can perform operations such as filtering, sorting, grouping and aggregation.
  - Supports a variety of ways in which to present data. You can present data as lists, tables, charts and matrices (also known as crosstabs.)
  - You can specify fonts, colors, border styles, background images etc to make your report more presentable.
  - You can have collapsible sections, document map, bookmarks, interactive sorting etc in your report.
  - You can embed expressions in the report to change display style dynamically based on data values.
  - Supports export report from different application like Excel, text, word, PDF etc.
  - Supports printing and print preview.


(Here a sample code & screenshot to view your design report in VB.Net:)

CrystalReportViewer Control

CrystalReport Control

Imports System.Windows.Forms
Imports System.Data.SqlClient
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports CrystalDecisions.ReportSource

Public Class ReportViewer
  Private crReport As ReportDocument
  Private sCaption as String

  'Configure Crystal Report for SQL Connection
  Private Sub ConfigureCrystalReports()
    Dim FormCrViewer As New frmCrystalReportViewer
    Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()

    myConnectionInfo.ServerName = gsServerLocation
    myConnectionInfo.UserID = "sa"
    myConnectionInfo.Password = "+XXXXXX+"
    myConnectionInfo.IntegratedSecurity = False

    SetDBLogonForReport(myConnectionInfo, crReport)
    FormCrViewer.CrystalReportViewer1.ReportSource = crReport
    FormCrViewer.Text = sCaption
    FormCrViewer.Show()
  End Sub

  'Set All SQL databases from Crystal Report
  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
  End Sub

  Private Sub Accuracy_Detailed()
    Dim CrystalRpt As New Accuracy_Detailed

    crReport = New ReportDocument()
    crReport = CrystalRpt
    sCaption = "ACCURACY REPORT - DETAILED"
    ConfigureCrystalReports()
  End Sub
End Class

FREE PDF BOOK DOWNLOAD

Related posts

Comments

4/1/2008 1:53:53 AM

pingback

Pingback from masonplace.das-hosting.de

crystal reports

masonplace.das-hosting.de

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

9/7/2008 5:26:22 AM

Recieved Updates



Enter your email address:

Delivered by FeedBurner

About the author

Name of author RUBEN CORRAL
System Developer in outSourcing company for almost 8 years. I built this blogs just for fun, sharing idea's, contribute a piece of code, especially to newbie programmers.

E-mail me Send mail

Calendar

<<  September 2008  >>
MoTuWeThFrSaSu
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

View posts in large calendar

Disclaimer

The opinions expressed herein are my own personal point of view. Sample source codes are free to modify or enhance for your own satisfaction.

Sign in

All brand names, logos and trademarks in this site are property of their respective owners.