Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 5th, 2004, 01:00 PM
Registered User
 
Join Date: Jul 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Setting path to local "C" drive for crystal report

Hi,
I am acccessing my crystal reports bundled version developed in VB.NET 2002.
I stored my report in local C drive and set the report source as follows:
rptPositiveMatch.ReportSource = CurDir() "\Report\PositiveMatch.rpt"
But I got the error "Load Report Failed". I checked the path while running the report, but it goes to different path and into the 'bin' folder of my current project folder, instead of 'Report folder' as set earlier.
Is there any resolution to direct the form to open the report from current "C" drive of the local machine.
I don't know exactly what the CurDir() function does.Please let me know if there is any alternative.
Thnaks,
Raj

 
Old March 5th, 2004, 01:22 PM
Registered User
 
Join Date: Mar 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If your using .Net look at using the System.IO Namespace for File access.

Chris Lane
 
Old June 17th, 2004, 11:47 AM
Registered User
 
Join Date: May 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I do it by putting the .rpt file in the same folder as the program .exe and then using the following code:

        'Add any initialization after the InitializeComponent() call

        oRpt = New ReportDocument
        strDBFolder = Environment.CurrentDirectory.ToString
        oRpt.Load(strDBFolder & "\ISAP_report1.rpt")
        CrystalReportViewer1.ReportSource = oRpt







Similar Threads
Thread Thread Starter Forum Replies Last Post
displaying images in crystal report based on path thas123 Crystal Reports 1 May 24th, 2006 01:47 AM
Crystal Report is not printed to the local printer pratyush_k Crystal Reports 0 June 29th, 2005 09:07 AM
Crystal Report in asp.net - path is denied kssiva_s Crystal Reports 0 February 12th, 2005 09:30 AM
Setting up stored procedure for Crystal Report.... potato3 SQL Language 1 December 9th, 2004 12:33 PM
Absolute Path in Crystal Report lam_lvl Crystal Reports 5 August 19th, 2004 05:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.