Wrox Programmer Forums
|
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2005 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 February 13th, 2007, 04:22 PM
Registered User
 
Join Date: Aug 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default MAC users can't read my reports

I am using VS2005 and I am creating reports in Crystal that are getting exported to Adobe. Once the report is generated, it is written to the client's browser and then opened. Everything works great when users are on a PC. However when I have users on a MAC, Firefox will open the report, but Safari will not. Does anyone have a clue as to why this is? Below is the code I am using for this export.

Code:
Protected Sub PrintReport()

        ' Define Crystal Reports variables
        Dim crTableLogonInfos As New [Shared].TableLogOnInfo()
        Dim crTableLogonInfo As New [Shared].TableLogOnInfo()
        Dim crConn As New [Shared].ConnectionInfo()
        Dim crTables As Tables
        Dim crTable As Table

        Dim crReportDocument As ReportDocument
        Dim crExportOptions As [Shared].ExportOptions
        Dim crDiskFileDestinationOptions As [Shared].DiskFileDestinationOptions
        Dim Fname As String
        ' The following code can be placed directly after the call to
        ' InitializeComponent() in the form’s constructor, or inside of
        ' a Button_Click event where the button is used by the client to
        ' get a printable copy of the report.
        crReportDocument = New ReportDocument()
        ' The following line of code loads the sample report “Chart.rpt” that installs
        ' with Visual Studio .NET


        crReportDocument.Load(Request.PhysicalApplicationPath + "\Reports\ChurchMembTotReport.rpt") ', OpenReportMethod.OpenReportByTempCopy)
        crConn.ServerName = "Server_Name"
        crConn.DatabaseName = "Database_Name"
        crConn.UserID = "Username"
        crConn.Password = "password"
        crTables = crReportDocument.Database.Tables
        For Each crTable In crTables
            crTableLogonInfo = crTable.LogOnInfo
            crTableLogonInfo.ConnectionInfo = crConn
            crTable.ApplyLogOnInfo(crTableLogonInfo)
        Next

        Fname = "C:\inetpub\" & Session.SessionID.ToString & ".pdf"
       crDiskFileDestinationOptions = New [Shared].DiskFileDestinationOptions()
        crDiskFileDestinationOptions.DiskFileName = Fname
        crExportOptions = crReportDocument.ExportOptions
        With crExportOptions
            .DestinationOptions = crDiskFileDestinationOptions
            .ExportDestinationType = [Shared].ExportDestinationType.DiskFile
            .ExportFormatType = [Shared].ExportFormatType.PortableDocFormat
        End With
        crReportDocument.Refresh()
        crReportDocument.Export()

        ' The following code writes the pdf file to the Client’s browser.
        Response.ClearContent()
        Response.ClearHeaders()
        'Response.ContentType = "application/pdf"
        Response.ContentType = "application/pdf"
        Response.WriteFile(Fname)

        Response.Flush()
        Response.Close()
        'delete the exported file from disk
        System.IO.File.Delete(Fname)

    End Sub





Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting the MAC Address mswombat Classic ASP Basics 0 June 3rd, 2006 11:45 AM
Mac odditie BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 8 June 7th, 2004 03:11 PM
JRun4 for Mac OS + Mac OS X's Java 1.4.1 elbicho J2EE 0 June 27th, 2003 12:18 PM





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