我也不怎么会~
你发短信 问问softnap(乡下人),他的水晶报表搞的不错
 或者   alf      
楼主很有意思~~

解决方案 »

  1.   

    ....

    卖身啊说的这么严重我用的时候ASP。NET帐户加为administrator  后没出现问题 嘿嘿你的luck 不够啊
      

  2.   

    给个Method()你,直接传参数就行, 我是导出到一个固定文件夹.这个文件夹必须有写的权限
    Private Sub SavetoDoc(ByVal Format As Integer, ByVal strRptFN As String)
            Dim Fname As String = strRptFN        Dim ExportPath As String = Request.PhysicalApplicationPath + "Exported\"        If (Not Directory.Exists(ExportPath)) Then
                System.IO.Directory.CreateDirectory(ExportPath)
            End If        Dim crDiskFileDestinationOptions As New DiskFileDestinationOptions()
            Dim crExportOptions As ExportOptions = repDoc.ExportOptions
            With crExportOptions
                .DestinationOptions = crDiskFileDestinationOptions
                .ExportDestinationType = ExportDestinationType.DiskFile
                Select Case Format
                    Case 0
                        .ExportFormatType = ExportFormatType.Excel                    Dim excelFormatOpts As New ExcelFormatOptions()
                        excelFormatOpts.ExcelTabHasColumnHeadings = False
                        excelFormatOpts.ExcelAreaType = AreaSectionKind.Detail
                        excelFormatOpts.ExcelUseConstantColumnWidth = True
                        excelFormatOpts.ExcelConstantColumnWidth = 2500.0
                        .FormatOptions = excelFormatOpts                    Fname = Fname + ".xls"
                    Case 1
                        .ExportFormatType = ExportFormatType.WordForWindows
                        Fname = Fname + ".doc"
                    Case 2
                        .ExportFormatType = ExportFormatType.HTML40
                        Dim HTML40Formatopts As New HTMLFormatOptions()
                        With HTML40Formatopts
                            .HTMLBaseFolderName = ExportPath
                            .HTMLEnableSeparatedPages = True
                            .HTMLHasPageNavigator = True
                        End With
                        crExportOptions.FormatOptions = HTML40Formatopts                    Fname += ".htm"
                    Case 3
                        .ExportFormatType = ExportFormatType.PortableDocFormat
                        Fname = Fname + ".pdf"
                End Select
            End With        crDiskFileDestinationOptions.DiskFileName = ExportPath + Fname
            repDoc.Export()
            Response.Redirect("../../Exported/" + Fname)
        End Sub
    End Class
      

  3.   

    试试这个,在 IIS 里给水晶报表的虚拟目录和你的程序的虚拟目录加入“写”权限。
      

  4.   

    导出代码参考:1、csharp_web_export.exe
    该 C# .NET web 程序实例示范了如何将报表导出成多种文件格式(比如:.DOC 或者 .XLS)。本程序适用于 Visual Studio .NET 内置的水晶报表 (Crystal Reports for Visual Studio .NET 2002) 及其更新版本。
    http://support.crystaldecisions.com/communityCS/FilesAndUpdates/csharp_web_export.exe.asp2、csharp_win_export.exe
    该 C# .NET Windows 程序实例示范了如何将你的报表导出成多种格式。本程序适用于 Visual Studio .NET 内置的水晶报表 (Crystal Reports for Visual Studio .NET) 及其更新版本。
    http://support.crystaldecisions.com/communityCS/FilesAndUpdates/csharp_win_export.exe.asp3、csharp_win_exporttopdf.exe
    该 C# .NET Windows 程序实例示范了如何将你的报表导出成便携文档格式 (Portable Document Format) (PDF)。本程序适用于 Visual Studio .NET 内置的水晶报表 (Crystal Reports for Visual Studio .NET) 及其更新版本。
    http://support.crystaldecisions.com/communityCS/FilesAndUpdates/csharp_win_exporttopdf.exe.asp