VB Crystal Report >> I need crystal report viewer that has its on window

by Matt Landis » Mon, 23 May 2005 20:41:40 GMT

Hello,

We are developing a product in a development tool that does not allow
putting the crystal report viewer object on one of our forms. We need to
have a crystal viewer that opens in its own container window. (like that old
crystal viewer that came with VB 4/5?)

Does someone know where something like this would be? Can anyone point me in
the right direction?

Thanks,
Matt




VB Crystal Report >> I need crystal report viewer that has its on window

by Dale » Wed, 25 May 2005 05:29:24 GMT


Matt, I always drop the object onto a form, but I was thinking what if
you New and instance of it in code.




Similar Threads

1. Crystal Report Windows Forms Viewer - VB Crystal Report

2. Crystal Report viewer does not show toolbar on XP, but does on Windows/2000

I have a problem where the Crystal Reports viewer shows th
toolbar when running Windows/2000, but not Windows/XP. Ha
anyone ever heard of this before? I have another VB.NET solution whic
does paint the toolbar under XP, so it must be a code or technique issue.
The toolbar is functional and shows tool tips and silloete, but is
grayed out from viewing.
I will paste code here of report being launched. Any hel
would be great, I'm stumped

Private Sub mnuFileWaterCoilRpt_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnuFileWaterCoilRpt.Clic
        If CheckDirty(m_daRoot) = DialogResult.Cancel The
            Retur
        End I
        If m_projectFile Is Nothing OrElse m_projectFile.Length = 0 The
            MsgBox("You must first open or save the project that you wish to print first."
            Retur
        End I

        Dim report As New WaterCoi
        Dim viewer As New ReportViewerForm(report, m_projectFile

        Tr
            Me.Hide(
            viewer.WindowState = FormWindowState.Maximize
            viewer.ShowDialog(Me
        Catch exc As Exceptio
            MessageBox.Show(exc.ToString
        Finall
            Me.Show(
            report.Close(
            report.Dispose(
            viewer.Close(
            viewer.Dispose(
        End Tr
    End Su

here is form with viewer

Option Strict O
Option Explicit On

Imports System.Dat
Imports System.Data.SqlClien
Imports CrystalDecisions.CrystalReports.Engin
Imports CrystalDecisions.ReportSourc
Imports CrystalDecisions.Share

Public Class ReportViewerFor
    Inherits System.Windows.Forms.For

#Region " Windows Form Designer generated code 

    Public Sub New(ByVal report As ReportDocument, ByVal projectFile As String
        MyBase.New(
        Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Tabl
        Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInf

        Dim rptExpensiveProducts As New ReportDocumen
        InitializeComponent(
        'rptExpensiveProducts.Load("..\QuoteReport1.rpt"
        reportViewer.ReportSource = report      'rptExpensiveProduct
        If reportViewer.LogOnInfo.Count > 0 The
            Dim ti As TableLogOnInfo = reportViewer.LogOnInfo(0
            ti.ConnectionInfo.DatabaseName = projectFil
            ti.ConnectionInfo.ServerName = Environment.MachineNam
        End I


        ' For Each tbCurrent In rptExpensiveProducts.Database.Table
        'tliCurrent = tbCurrent.LogOnInf
        'With tliCurrent.ConnectionInf
        '.ServerName = Environment.MachineNam
        '    .UserID = "
        '   .Password = "
        '.DatabaseName = projectFil
        'End Wit
        'tbCurrent.ApplyLogOnInfo(tliCurrent
        'Next tbCurren

        ' Set the report source for the crystal reports
        ' viewer to the report instance


        'This call is required by the Windows Form Designer
        '   InitializeComponent(

        'Add any initialization after the InitializeComponent() cal
        '        reportViewer.ReportSource = repor
        '        If reportViewer.LogOnInfo.Count > 0 The
        '       Dim ti As TableLogOnInfo = reportViewer.LogOnInfo(0
        '      ti.ConnectionInfo.DatabaseName = projectFil
        '     ti.ConnectionInfo.ServerName = Environment.MachineNam
        '    End I

        'reportViewer.DisplayToolbar = Tru

    End Su

    'Form overrides dispose to clean up the component list
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean
        If disposing The
            If Not (components Is Nothing) The
                components.Dispose(
            End I
        End I
        MyBase.Dispose(disposing
    End Su

    'Required by the Windows Form Designe
    Private components As System.ComponentModel.IContaine

    'NOTE: The following procedure is required by the Windows Form Designe
    'It can be modified using the Windows Form Designer. 
    'Do not modify it using the code editor
    Friend WithEvents reportViewer As CrystalDecisions.Windows.Forms.CrystalReportViewe
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.reportViewer = New CrystalDecisions.Windows.Forms.CrystalReportViewer
        Me.SuspendLayout()
        '
        'reportViewer
        '
        Me.reportViewer.ActiveViewIndex = -1
        Me.reportViewer.DisplayBackgroundEdge = False
        Me.reportViewer.DisplayGroupTree = False
        Me.reportViewer.Dock = System.Windows.Forms.DockStyle.Fill
        Me.reportViewer.EnableDrillDown = False
        Me.reportViewer.ImeMode = System.Windows.Forms.ImeMode.NoControl
        Me.reportViewer.Location = New System.Drawing.Point(0, 0)
        Me.reportViewer.Name = "reportViewer"
        Me.reportViewer.ReportSource = Nothing
        Me.reportViewer.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.reportViewer.ShowGroupTreeButton = False
        Me.reportViewer.Size = New System.Drawing.Size(632, 389)
        Me.reportViewer.TabIndex = 2
        '
        'ReportViewerForm
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(632, 389)
        Me.Controls.Add(Me.reportViewer)
        Me.Name = "ReportViewerForm"
        Me.Text = "ReportViewerForm"
        Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub reportViewer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub reportViewer_Load_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles reportViewer.Load

    End Sub
End Class

3. Crystal Report Viewer (windows) Filter Export Dialog Types - VB Crystal Report

4. very new to crystal reports - red crosses and crystal viewer

as i say i am very new to crystal but already get the impression this is an 
old chestnut.....

when i create a web report using the crystal report viewer in .net studio , 
i get a report with red crosses where the page selectors an other graphics 
should be.  i've searched the web but cannot find a definitive solution to 
this...any advice would be appreciated.


many thanks in advance

Buzz 


5. Crystal Reports/Crystal Viewer and VB.NET - VB Crystal Report

6. crystal report viewer error: invalid report source

7. Crystal Reports Viewer + progress of report generation - VB.Net

8. crystal report viewer cant assign report source

In my Crystal Report Viewer control properties, the reportsource field is not enabled and will not allow me to insert a reportsource.  I have also tried to code in the reportsource but get an error. Is there a reference I have not added to my project? Thanks.