Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design 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 July 8th, 2004, 10:24 PM
Registered User
 
Join Date: Jul 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to enbed Word in web forms

i'm a beginner of asp.net , i want to ask help of how to enbed a .doc file in web forms. i'm developing a asp.net web application by C#.
i want to let user can open the .doc file and read it in the web form,and he also can modify the file and save it.


 
Old July 10th, 2004, 03:22 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

u can open .doc files into ur browser (I know IE but not sure about all) but its read only!

Always:),
Hovik Melkomian.
 
Old July 12th, 2004, 01:48 AM
Registered User
 
Join Date: Jul 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank you for your answer! i'm looking forward to more help!!!

 
Old July 13th, 2004, 09:07 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

This is code that I use in a class to export to multiple file formats. It is written in VB, but I am sure you can convert it to C# pretty easily.


Public Class ClassPrintCrystalReports
    'This sub is used to export the Crystal Report to Adobe Acrobat.

    Public Sub PrintReport(ByVal objReport As CrystalDecisions.CrystalReports.Engine.ReportDocum ent, _
                           ByVal SessionID As String, ByVal WebPage As System.Web.UI.Page, _
                           ByVal DocType As String)

        Dim ExpOpt As New ExportOptions()
        Dim DiskFileDestOpt As New DiskFileDestinationOptions()
        Dim ExpFile As String

        'I am using this path since I know it will exist on everyone's computer.
        ' ExpFile = "C:\WinNT\Temp\" + SessionID + ".pdf"
        Select Case DocType
            Case "pdf"
                ExpFile = "C:\WinNT\Temp\" + SessionID + ".pdf"
            Case "rtf", "txt", "doc"
                ExpFile = "C:\WinNT\Temp\" + SessionID + ".doc"
            Case Else
                Return ''No valid export type specified.
        End Select

        DiskFileDestOpt.DiskFileName = ExpFile

        ExpOpt = objReport.ExportOptions
        With ExpOpt
            .DestinationOptions = DiskFileDestOpt
            Select Case DocType
                Case "pdf"
                    .ExportFormatType = ExportFormatType.PortableDocFormat
                Case "rtf", "txt", "doc"
                    .ExportFormatType = ExportFormatType.WordForWindows
            End Select
            .ExportDestinationType = ExportDestinationType.DiskFile
        End With


        objReport.Export()

        WebPage.Response.ClearContent()
        WebPage.Response.ClearHeaders()
        Select Case DocType
            Case "pdf"
                WebPage.Response.ContentType = "application/pdf"
            Case "rtf", "txt", "doc"
                WebPage.Response.ContentType = "application/msword"
        End Select
        WebPage.Response.WriteFile(ExpFile)
        WebPage.Response.Flush()
        WebPage.Response.Close()

        System.IO.File.Delete(ExpFile)

    End Sub


 
Old July 14th, 2004, 12:50 AM
Registered User
 
Join Date: Jul 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank you very much ,jbenson001!
i think it's maybe helpful!!!^_^






Similar Threads
Thread Thread Starter Forum Replies Last Post
Web Forms Keith Smith BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 8 February 24th, 2007 02:49 PM
Transfer access2003 forms to word document q2q2 BOOK: Access 2003 VBA Programmer's Reference 0 December 29th, 2006 11:21 AM
how to enbed Word in web forms hawkclj ASP.NET 1.0 and 1.1 Basics 0 July 15th, 2004 03:51 AM
Data in Word forms in Access Tables HowardB Access VBA 1 January 9th, 2004 09:18 AM





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