Visual Basic .NET Forums  
Click here to advertise with us

Go Back   Visual Basic .NET Forums > Components & Controls > Reporting / Printing

Reporting / Printing Discussion on output-creation components such as reporting, pdf, etc.

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-06-2009, 3:17 AM
VB.NET Forum Newbie
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: May 2009
Age: 23
Posts: 22
Reputation: 12
c.vaibhav is on a distinguished programming path ahead
Default Crystal report doesnt work after i make the setup file

Hi folks,

I am new to VB.NET.. I have made an application that makes use of crystal report.. I have used the following code..

Code:
   Private Sub InvoicePrint_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        'InvoiceNumber = "000005"
        CrystalReportViewer1.ShowRefreshButton = False
        Me.CrystalReportViewer1.ShowGroupTreeButton = False
        CrystalReportViewer1.DisplayGroupTree = False
        Me.WindowState = FormWindowState.Maximized

        Dim ds As DataSet = New DataSet
        myConn = New SqlConnection(ConfigurationManager.ConnectionStrings("default").ToString)
        'Opening Connection
        myConn.Open()

        Dim sadapt As New SqlDataAdapter("Select * from dbo.InvoiceDatabase", myConn)
        sadapt.Fill(ds, "InvoiceDetails")

        'ds.WriteXml("D:\Test\InvoiceDetails.xsd")

        Dim strReportPath As String = Application.StartupPath
        Dim startstring
        startstring = InStr(strReportPath, "bin", CompareMethod.Text)
        strReportPath = strReportPath.Substring(0, startstring - 1)
        strReportPath = strReportPath & "Invoice.rpt"
        'strReportPath = "C:\Users\Vaibhav\Desktop\Windows Applications\Sorbe\Sorbe\CrystalReport1.rpt"
        If Not IO.File.Exists(strReportPath) Then
            Throw (New Exception("Unable to locate report file:" & vbCrLf & strReportPath))
        End If
        Dim cr As New Invoice

        cr.Load(strReportPath)
        cr.SetDataSource(ds.Tables("InvoiceDetails"))

        CrystalReportViewer1.ReportSource = cr
        'Me.CrystalReportViewer1.Zoom(150)

        myConn.Close()

    End Sub
I have given the startup path to open the crystal report.. but it doesnt work when I create a setup file.. I know that I am doing a wrong thing.. can anybody please provide a workaround..

Regards,
Vaibhav
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 10-31-2009, 5:30 PM
VB.NET Forum Newbie
.NET Framework: .NET 3.0 (VS 2005/2008)
 
Join Date: Oct 2009
Age: 29
Posts: 2
Reputation: 0
Bonny sol is on a distinguished programming path ahead
Default

I got the same problem!

I think that after you create the setup, the .RPT file still tries to get the data from the
original file that you selected when you created the crystal report!

The only problem is that I don't know how to fix this!

I'm still looking for the answer, I'll post it when I've found it.

Greetz
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 12:59 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


For advertising opportunities click here.