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 January 28th, 2005, 01:30 PM
Registered User
 
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to cwaletzko Send a message via Yahoo to cwaletzko
Default Crystal Report to word document? help

I'm trying to programmatically export a crystal report to a word document in VB.net. Here is the code that I found in help, but it isn't working. Any ideas?

code starts
************************************************** ********************
'' Declare variables and get the export options.
Dim exportOpts As New ExportOptions
Dim diskOpts As New DiskFileDestinationOptions
Dim wordFormatOpts As New ExcelFormatOptions

    exportOpts.ExportFormatType = ExportFormatType.WordForWindows
    exportOpts.FormatOptions = wordFormatOpts

'' Set the export format.
    exportOpts.ExportFormatType = ExportFormatType.WordForWindows
    exportOpts.ExportDestinationType = ExportDestinationType.DiskFile

'' Set the disk file options.
Dim newLast As String
    newLast = LastName
Dim posLast As Integer
    posLast = Len(LastName) - 1
    newLast = Microsoft.VisualBasic.Left(LastName, posLast)

    diskOpts.DiskFileName = newLast & "_" & Month(CDate(Now())) & Year(CDate(Now()))
    exportOpts.DestinationOptions = diskOpts

    UserExpenseReports2.Export()
************************************************** ********************
code ends






Similar Threads
Thread Thread Starter Forum Replies Last Post
Word Document to PDF BSkelding ASP.NET 1.0 and 1.1 Professional 2 July 19th, 2013 04:53 AM
Cryatal Report and Word document object conflict deeptisingh20 ASP.NET 1.0 and 1.1 Basics 1 July 24th, 2006 05:25 AM
Crystal Report and word document conflict deeptisingh20 ASP.NET 1.0 and 1.1 Professional 0 July 24th, 2006 04:15 AM
how to merge crystal report fields in word doc amipen35 Classic ASP Basics 0 July 19th, 2006 10:47 AM
Protect a Word document zengfu Excel VBA 1 March 28th, 2005 11:00 AM





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