Automatically print Crystal Report within Windows application using VB.NET


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Automatically print Crystal Report within Windows application using VB.NET

  1. #1
    Join Date
    Dec 2008
    Posts
    2

    Automatically print Crystal Report within Windows application using VB.NET

    Hello!
    I am rewriting an existing VB 6 application which prints a label using a Crystal 7 report. It does not display the report, but merely uses it for the outline of the label. The report is stored in the application path. Currently, the VB 6 application has a reference to the Crystal Report object. I do not see this available reference within VS 2005.
    I am not very familiar with working with Crystal Reports within .NET.
    I am trying to include a Crystal report into my VB.NET project that will not be displayed, but just called to print a label.
    Do I need to include the report in my project? I do not know what references and how to include this into the project. Ideally I would just like to use the report as a shell and have the data source already populated. Can I still store it in the application path?
    Any help is greatly appreciated as I am stuck a bit.

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Welcome to DevX

    This sample project might help.

    http://www.codeproject.com/KB/recipe..._in_VBNET.aspx
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  3. #3
    Join Date
    Dec 2008
    Posts
    2
    Thanks for responding Hack. I have seen this solution when searching for answers, but it does not fit my situation. My situation seems to be unique because I am using the crystal report for the outline / format of a printed label. It is NOT displayed within the application, so I would not have a form with a report viewer on it.

    The old way in VB 6 application was to place the crystal report object on the form and then call the report located in app path. Report was tied to a specific table in the database. Table was populated by application.

    CR1.ReportFileName = App.Path & "\LBBundle.rpt"
    CR1.Destination = crptToPrinter
    CR1.DataFiles(0) = "bundles" & Hline
    CR1.Action = 1

    In .NET I am trying to find out if this same architecture is possible. I would like to model it the same way, but do not know how to use the crystal object to satisfy this need.

    Any help is appreciated and needed since I am a bit stuck.

  4. #4
    Join Date
    May 2013
    Posts
    1
    just do
    Code:
    cryRpt.PrintToPrinter(2, true, 1, 2);
    hope it will print your report

    http://csharp.net-informations.com/c...orts-print.htm

    walsh.
    Last edited by Hack; 05-20-2013 at 09:24 AM.

Similar Threads

  1. Crystal Report with VB.Net - Need Help
    By philips in forum .NET
    Replies: 3
    Last Post: 01-10-2008, 09:51 PM
  2. Crystal Report Not Opening after changing DSN
    By vijayvishwanath in forum VB Classic
    Replies: 3
    Last Post: 10-29-2006, 09:48 AM
  3. Replies: 0
    Last Post: 03-23-2006, 11:29 AM
  4. Replies: 0
    Last Post: 05-21-2002, 08:36 AM
  5. CRYSTAL report error
    By Erwin in forum VB Classic
    Replies: 1
    Last Post: 09-20-2000, 12:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center