Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
| Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 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 January 10th, 2007, 04:19 PM
Authorized User
 
Join Date: Jun 2006
Location: , , .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to set password to exported Crystal Report

Hi,

Sub: How to set password to exported Crystal Report


We have VB 6.0, Crystal Reports Xi and Oracle 10 G.

I have designed a report using Oracle native connection and passed data at run time.
Exported the report to Crystal Report Format. But while opening the report, the exported report (destination report) asks for password.

Is there any way to set the password to the expoted report in Visual Basic.

Here is my code:


Dim CrAppl As CRAXDRT.Application
Dim crrep As CRAXDRT.Report
Dim crrepDest As CRAXDRT.Report
Dim strsql As String

    Set CrAppl = New CRAXDRT.Application
    Set crrep = CrAppl.OpenReport(sReportName) 'Opens the report

   With crrep
    .Database.LogOnServer "crdb_oracle.dll", strServerName, "", strUserName, strPassword
    .DiscardSavedData
    .SQLQueryString = strsql
    .ReportTitle = strReportCriterias
    .Database.Verify
    End With


   With crrep.ExportOptions
    .DestinationType = crEDTDiskFile
    .FormatType = crEFTCrystalReport
    .DiskFileName = sDestFileName
    End With

   crrep.Export (False)
    Set crrep = Nothing
    Set CrAppl = Nothing
    Exit Sub
Err:
 MsgBox Err.Description


I would appreciate your help in this regard.

Thanks,









Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Report 9 password protected mdb ACCESS sajid_rauf Pro VB Databases 2 July 27th, 2007 02:29 AM
Unable to open report exported in Crystal rep jdaulagar Beginning VB 6 3 June 4th, 2007 08:06 AM
Crystal Web Report asking User name/password abmohan75 Crystal Reports 2 January 22nd, 2006 04:40 AM
changing Password dynamically in crystal report irfanthegame Crystal Reports 0 October 7th, 2005 06:59 AM
page margins not set in the exported pdf files boat Crystal Reports 0 April 21st, 2004 04:36 AM





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