Exporting Options in Crystal Reports 2008

I am using Crystal Reports 2008 to make my report for my users.   I am also programming a viewer in vb 2005 so the users can view the report without changing it.  In the viewer I need to be able to export to excel or pdf or any other format.  I want the user to be able to specify where and how to export the report.  However when they press on the export button it is giving a save as dialog box, which, while it gives options to save as excel or pdf, it does not give the options such as to application, or to file, which are there in the full crystal report product. 
My form gets the report name, sets up the data source and then displays it in a
CrystalReportViewer object. 
CrystalViewer.ReportSource = MyReportDocument
        CrystalViewer.DisplayToolbar = True
        CrystalViewer.ShowRefreshButton = False
        CrystalViewer.DisplayStatusBar = True
        CrystalViewer.EnableDrillDown = True
        CrystalViewer.EnableRefresh = False
        CrystalViewer.EnableToolTips = True
        CrystalViewer.ShowExportButton = True
The export button is there, it just does not give all of the options that I would have expected.  I see there are ways to programatically use the options, however the export dialog box that appears in crystal reports 2008 would be useful to the user here.  Is there a way to make that box show up.  Perhaps it should be and I am doing something wrong.  I am very new to .net and crystal 2008, we used to use crystal 8.0 with vb6 for a viewer.  In that version the export dialog box showed up correctly.  Thank you for your help.  Also, if i am posting this in the wrong forum area please let me know so i can post it where it should be.

You are doing things the correct way, unfortunately the export dialog is very basic.  If you want this extra functionality, you will have to code it yourself.

Similar Messages

  • Invalid export DLL or export format" with Crystal Reports 2008 to Excel xls

    We are experiencing the same issue as reported in the sticky thread. I answered in that thread, but thought that I woudl open a new thread to keep track of this issue.  I can give you the responses to your questions you have requested in that thread:
    Server Operating System - MS Windows Server 2003 R2 Enterprise Edition SP2
    Version of the .NET Framework - MS .NET Framework 3.5 SP1
    How did you deploy? - Installed CR 2008 SP1 runtime with msi package
    If you deployed with CRRuntime_12_0_mlb.msi - what was the date of the file and its size? CRRuntime_12_1_mlb.msi dated Sept. 16, 2008 12:55:00 PM, size: 56,717,824 bytes
    What is the file version of crpe32.dll on your server? You'll find this in the C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 directory - File was created 9/13/08 11:21AM, 9451KB File Version: 12.1.0.882
    How many libpng10.dll files are on your system? List all instances. - 1 instance is on the system located in C;\Program Files\Business Objects\Business Objects Enterprise 12.0\win32_x86 directory. It is dated 9/13/08 8:52:26AM 132KB version 1.0.30.1
    Any additional comments - We have tried to export to PDF and this works successfully. However, we can not export to xls or rft formats.
    CRXF_XLS.dll is 905KB 9/13/08 9:38AM Version 12.1.0.882
    CRXF_RTF.dll is 509KB 9/13/08 9:35AM Version 12.1.0.882
    We also have the CR XIR2 server runtime installed side by side on the server as we migrate from CR 2008 to CR XIR2 SP4 ( where this function does work currently).
    Please let me know if you need anything additional.
    Phil
    "Invalid export DLL or export format" with Crystal Reports 2008
    Posted: Sep 27, 2008 12:36 AM       E-mail this message      Reply 
    I've included this sticky because we are seeing many posts in this forum regarding the error Invalid export DLL or export format when exporting to Excel and RTF in .NET applications using the Crystal Reports 2008 .NET SDK.
    Issue
    Exporting a Crystal Report to Excel or RTF format
    .NET application using the Crystal Reports 2008 runtime (version 12.0)
    error Invalid export DLL or export format
    We've been doing some testing in-house and haven't reproduced this behavior. In order to figure this issue out we will need your help. If you are getting this error please reply to this post with the following information:
    Server Operating System
    Version of the .NET Framework
    How did you deploy?
    If you deployed with CRRuntime_12_0_mlb.msi - what was the date of the file and its size?
    What is the file version of crpe32.dll on your server? You'll find this in the C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 directory
    How many libpng10.dll files are on your system? List all instances.
    Any additional comments
    What We Know
    The error invalid export DLL or export format may occur when exporting to Excel and RTF formats in .NET applications utilizing the Crystal Reports 2008 runtime (v 12.0)
    Other export formats like Adobe PDF, Crystal Reports, CSV all export with no error
    Some customers have resolved this by adding C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 to their environment path variables
    This may have something to do with the file libpng10.dll. Both crxf_xls.dll and crxf_rtf.dll are dependent on it.
    Thanks in advance for your co-operation. We hope to figure out what is causing this issue soon.

    Hi,
    I am also having the same problem, except that I am not using Crystal Report 2008 runtime but the actual Crystal Report 2008 installation on Windows XP SP2 with VS Studio 2005 (VC++). MS .NET Framework 2.0.
    Cyrstal Report XIR2 was installed on the same machine but uninstalled before installing Crystal Report 2008.
    So only one instance of libpng10.dll and found in C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86
    Crpe32.dll        3/1/2008 version 12.0.0.683
    Crxf_xls.dll       3/1/2008 version 12.0.0.683
    Crxf_rtf.dll         3/1/2008 version 12.0.0.683
    crdb_oracle.dll  3/1/2008 version 12.0.0.683
    libpng10.dll       3/1/2008 version 1.0.30.0             122880 bytes
    There is no problem for exporting to pdf, html, word, csv, Crystal Report. If I create a testing report without any data from database, the testing report can then be exported also to rtf and xls.
    Oracle 11.1.0.6 is the DB for the reports.
    Adding C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 to the path did not resolve my problem.
    Any idea to fix this issue?
    Thanks
    Kin H Chan

  • How to set Excel Options using  crystal reports 2008

    Hi,
    I am trying to figure out CR 8.5 (Crystal report control) Equivalents in Crystal reports 2008 using crystal report viewer in .Net but not able to find the exact replacments.
    Properties used in CR 8.5
    CRAXDRT.ExportOptions.ExcelUseWorksheetFunctions=True
    CRAXDRT.ExportOptions.ExcelUseTabularFormat =True
    CRAXDRT.ExportOptions.SetLogOnInfo(1,3,4,5)
    Please let me know the replacements for the above mentioned properties in .Net using crystal report viewer (CR 2008)
    Thanks in Advance
    Regards,
    Ramnath

    Hello,
    The code that has been provided is of Report Designer Component.
    RDC has been deprecated in Crystal Reports 2008.
    Use the 'ExcelFormatOptions' class. It provides many options regarding exporting in an excel format.
    ExcelFormatOptions myExportFormatOptions = new ExcelFormatOptions();
    Try exploring the Developer guide for Crystal Reports .NET SDK [here|http://www.sdn.sap.com/irj/boc/sdklibrary#section7]..

  • "Invalid export DLL or export format" with Crystal Reports 2008

    I've included this sticky because we are seeing many posts in this forum regarding the error Invalid export DLL or export format when exporting to Excel and RTF in .NET applications using the Crystal Reports 2008 .NET SDK.
    Issue
    - Exporting a Crystal Report to Excel or RTF format
    - .NET application using the Crystal Reports 2008 runtime (version 12.0)
    - error Invalid export DLL or export format
    We've been doing some testing in-house and haven't reproduced this behavior. In order to figure this issue out we will need your help. If you are getting this error please reply to this post with the following information:
    - Server Operating System
    - Version of the .NET Framework
    - How did you deploy?
    - If you deployed with CRRuntime_12_0_mlb.msi - what was the date of the file and its size?
    - What is the file version of crpe32.dll on your server? You'll find this in the C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 directory
    - How many libpng10.dll files are on your system? List all instances.
    - Any additional comments
    What We Know
    - The error invalid export DLL or export format may occur when exporting to Excel and RTF formats in .NET applications utilizing the Crystal Reports 2008 runtime (v 12.0)
    - Other export formats like Adobe PDF, Crystal Reports, CSV all export with no error
    - Some customers have resolved this by adding C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 to their environment path variables. Note the system must be restarted after editing the path variable.
    - This may have something to do with the file libpng10.dll. Both crxf_xls.dll and crxf_rtf.dll are dependent on it.
    - libpng10.dll has changed versions from SP0 to SP1. In SP0 it was 1.0.30.0 and in SP1 it is 1.0.30.1
    libpng10.dll dependencies
    The dependencies have also been updated for libpng10.dll in service pack 1. This may have something to do with the export issue. If you've deployed your application with the latest merge modules or setup package for service pack 1 you'll want to make sure you have version 1.0.30.1 of libpng10.dll.
    Version 1.0.30.0
    - zlib.dll
    - msvcr71.dll
    - kernel32.dll
    Version 1.0.30.1
    - boezlib.dll
    - msvcr80.dll
    - kernel32.dll
    Thanks in advance for your co-operation. We hope to figure out what is causing this issue soon.
    Edited by: David Hilton on Jan 14, 2009 10:07 AM

    Our company has also been experiencing this issue with deployed versions of our software, and during my examination of the error I have made the following discoveries:
    For us the error has only been reproduced on Windows 2003 running Citrix
    The error does not occur on Windows XP, Windows 2003 or Vista without Citrix
    For installation of our application we use the CRRuntime_12_0.msm merge module (version 12.0.0.683, file size 46790KB)
    As mentioned in the first post this error is related to the files crxf_rtf.dll and cfxf_xls.dll being unable to locate its reference to the file libpng10.dll during load.
    I have run the application with ProcMon (http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx) attached on both environments that work correctly and that does not work and iIve made these observations:
    During load of dlls Windows searches for references in the following orders (see http://msdn.microsoft.com/en-us/library/ms682586.aspx):
    1. The directory from which the application loaded.
    2. The system directory.
    3. The 16-bit system directory.
    4. The Windows directory.
    5. The current directory.
    6. The directories that are listed in the PATH environment variable.
    Looking at the ProcMon log for the environment where it works correctly (Windows XP, no Citrix) it looks like this . Numbers represent the search order mentioned above:
    Load Image     C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\crxf_rtf.dll     SUCCESS     Image Base: 0x3e640000, Image Size: 0x79000
    (1) QueryOpen     C:\Program Files\<our application name>\libpng10.dll     NAME NOT FOUND     
    (2) QueryOpen     C:\WINDOWS\system32\libpng10.dll     NAME NOT FOUND     
    (3) QueryOpen     C:\WINDOWS\system\libpng10.dll     NAME NOT FOUND
    (4) QueryOpen     C:\WINDOWS\libpng10.dll     NAME NOT FOUND     
    (5) QueryOpen     C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\libpng10.dll     SUCCESS      ...
    So you can see it finds the file in the "current directory"
    Now, from the environment where it does not work (Windows 2003 Server / Citrix):
    Load Image     X:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\crxf_rtf.dll     SUCCESS     Image Base: 0x3e640000, Image Size: 0x79000
    (1) QueryOpen     X:\Program Files\<our application name>\libpng10.dll     NAME NOT FOUND     
    (2) QueryOpen     X:\WINDOWS\system32\libpng10.dll     NAME NOT FOUND     
    (3) QueryOpen     X:\WINDOWS\system\libpng10.dll     NAME NOT FOUND     
    (4) QueryOpen     X:\WINDOWS\libpng10.dll     NAME NOT FOUND     
    (5) QueryOpen     X:\Documents and Settings\<my user name>\WINDOWS\libpng10.dll     NAME NOT FOUND     
    (6) QueryOpen     ... loops trough all paths in the PATH variable, finding nothing
    As you can see somehow the current directory is %USERPROFILE%\WINDOWS and not the Crystal Reports bin path in this environment at the time of loading the dll.
    I have yet to discover why this is the case, but i tought i could share what I have found =)
    The %USERPROFILE%\WINDOWS folder is not a standard Windows folder, and I think it is used by Citrix for some files (like win.ini)
    This also shows why adding the bin folder to the PATH variable is a valid workaround for some, but for us this is not really a good solution as we need this to work out of our installer. We don't always have consultants do the installations for the customers and we cannot expect them to manually edit the PATH variable, and we don't want to add to the PATH variable in the installer unless this is the only way...
    So, I hope this maybe can bring you closer to being able to reproduce it. I'm still looking into it, will post more if I find something else interesting

  • Suppress Export Option Using Crystal Reports Web Report Viewer (viewrpt.cwr

    We have an existing Crystal Report that is being displayed using the Crystal Enterprise Web Viewer (viewrpt.cwr) in a call like this: http://<servername>:8080/CrystalReports/viewrpt.cwr?id=<an id value>etc.
    When the report is displayed, the toolbar has an export icon that allows the user to export the report to PDF, Excel, etc.
    I want to suppress the export feature, but retain the print feature.  I have read the documentation that I could find on the web for this viewer and have been unable to find a way to do this.
    Does anyone know how this could be done or a different way to display the report with a different viewer that would avoid having to redesign the report itself?

    CMC is Central Management Console. Logon to CMC
    http://server:8080/businessobjects/enterprise115/admin/en/admin.cwr
    Now select the report from the folder and click on the tab Rights and click on the advanced option for the user and here Under the report you have an option "Export the report data" check the deny option for this and apply. Now this option will apply for that particular user only, if you want to apply for all the users under one group then click on advanced for that group and change the option.
    Regards,
    Raghavendra.G

  • Regarding link option in crystal report 2008

    respected sir,
           how to enable full outer join and right outer join in link option because default is disable????

    well sir,i have selected the multiple  tables and give links to it and when i double click on links only inner join and left outer join is enabled but how to enabled full outer join and right outer join option because by default this options are  disabled
    Edited by: BharatPatel0005 on Sep 3, 2009 10:42 AM
    Edited by: BharatPatel0005 on Sep 4, 2009 7:44 AM

  • How to use drill down option in Crystal Report

    Dear all,
            I want to know how to use drill down option in Crystal report 2008.  In below i have explained my screnario
    For example
       My scenario is.  In crystal report I have Purchase order like PO101,PO102.  Each purchase order have 5 line items.  If i drill down each purchase order it should display line item in crystal report. 
    Regards,
    Baskaran.

    hi,
    Create a Group on 'Purchase order'.
    Group Expert -> Select the Purchase Order and Click the arrow button such that it appears right side. Click ok.
    GH1 is inserted.
    Your detail section should include 'Line items' fields.
    Right Click 'Detail' section on left hand side,  Click 'Hide (Drill down Ok)'.
    Now you will see only 'Purchase order's in Group Headers.
    Now when you click on a particular order, you will see respective line items.
    Regards,
    Vamsee

  • Crystal Report 2008 doesn't set  page size when export to excel file

    Hi,
    I am using Crystal Report 2008 Developer edition.
    At Crystal report design time setting the below page setup:
    Page Options -
       to A3(297X420 mm)
    Orientation --- Landscape
    and using the following code in .net (c#)
    I am using below format options to export in excel in .net 2005
    ReportDocument oReport = new ReportDocument();
    oReport.FormatEngine.PrintOptions.PaperOrientation = PaperOrientation.Landscape;
    oReport.FormatEngine.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperA3;
    if (aParamlist.ReportFormat == ReportFormatEnum.MicrosoftExcel)
    ExcelFormatOptions excel = new ExcelFormatOptions();
    excel.ExcelUseConstantColumnWidth = false;
    // Use detail section one as a guideline to determine column width
    excel.ExcelAreaGroupNumber = 1;
    //excel.ExcelAreaType = AreaSectionKind.Detail;
    excel.ExcelAreaType = AreaSectionKind.Detail;
    // Prepare exporting options
    ExportOptions export = oReport.ExportOptions;
    export.FormatOptions = excel;
    export.ExportFormatType = ExportFormatType.Excel;
    oReport.Export();
    when export to excel it doesn't set the Paper Size to  A3(297X420 mm).
    Is there any way to set the paper size while export to excel or in other formats also????
    Thanks & Regds,

    Hi,
    thanks for your email.
    This is not happening in development environment.It is setting the paper size anf paper orientation properly.
    this is happening in the production environment where only redist installation is done.
    thanks

  • CR2008 Not enough memory while exporting reports from Crystal Reports 2008

    I have recently upgraded our Crystal Reports version from Crystal Reports Basic for Visual Studio 2008 to Crystal Reports 2008. After upgradation I am facing the problem "Memory full.OtherErrorFailed to export the report. Not enough memory for operation" when I am trying to export the report from Crystal Reports 2008 Report viewer, or directly from the code behind. The application is hosted application. The problem occurs in our production environment.
    Server details:
    OS: Windows 2003 Enterprise Edition R2 with SP2
    IIS: IIS 6
    .Net Framework: 3.5
    Application details:
    Hosted application using Crystal Reports 2008 SP 3
    Crystal Reports Viewer version: 12.0.2000.0
    The data binding of the report object is done through an ADODB dataset.
    Web.Config:
    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
      <configSections>
        <sectionGroup name="businessObjects">
          <sectionGroup name="crystalReports">
            <section name="printControl" type="System.Configuration.NameValueSectionHandler" />
            <section name="crystalReportViewer" type="System.Configuration.NameValueSectionHandler" />
          </sectionGroup>
        </sectionGroup>
      </configSections>
      <businessObjects>
        <crystalReports>
          <printControl>
            <add key="url" value="http://myserver/mysite/PrintControl.cab" />
          </printControl>
          <crystalReportViewer>
            <add key="documentView" value="weblayout" />
          </crystalReportViewer>
        </crystalReports>
      </businessObjects>
      <appSettings>
        <add key="CrystalImageCleaner-AutoStart" value="true" />
        <add key="CrystalImageCleaner-Sleep" value="60000" />
        <add key="CrystalImageCleaner-Age" value="120000" />
      </appSettings>
      <system.web>
        <httpHandlers>
          <add path="CrystalImageHandler.aspx" verb="GET" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
        </httpHandlers>
        <compilation debug="false">
          <assemblies>
            <add assembly="CrystalDecisions.Data.AdoDotNetInterop, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
            <add assembly="CrystalDecisions.Shared, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
            <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
            <add assembly="CrystalDecisions.Web, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
            <add assembly="CrystalDecisions.Enterprise.InfoStore, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
            <add assembly="CrystalDecisions.Enterprise.Framework, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
            <add assembly="CrystalDecisions.ReportSource, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
            <add assembly="CrystalDecisions.CrystalReports.Engine, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
          </assemblies>
      </system.web>
      <system.webServer>
         <handlers>
             <add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode" />
         </handlers>
      </system.webServer>
    </configuration>
    Sample Code:
    Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
    Report.Load(Server.MapPath(strReportPath));
    Report.SetDataSource(dsReport);
    Creportviewer.ReportSource = Report;
    For exporting the report to PDF
    string Filename = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.InternetCache).ToString(), Guid.NewGuid().ToString() + ".pdf");
    Report.ExportToDisk(ExportFormatType.PortableDocFormat, Filename);
    Clean Up Code: (Page_UnLoad event)
    if (Report != null)
         Report.Close();
         Report.Dispose();
    Creportviewer.ReportSource = null;
    Creportviewer.Dispose();
    dsReport = null;
    GC.Collect();
    GC.WaitForPendingFinalizers();
    Can someone help me resolve the issue.

    The .rpt file size is 14MB with the Data Save option enabled, 12MB without Data Save.  Presumably the 12MB file size is because of the 24bit PNG we have as our background.
    The Designer executes the report in less than a second and we can scroll through all pages and see the image fields perfectly.
    When we Export to PDF, the Designer takes a long time, eventually gets to the 77%, the 7th record and returns "Export report failed" followed by "Memory full".  If we export only page 1 of the 3 pages, it also returns a Memory full error.  However, when the same report is run with only 1 page, that page exports to PDF but with a ridiculously large size and export time.
    The machine has 2GB of physical memory with an 8GB pagefile with Windows 2003 (latest everything).  The process runs up to about 1GB before reporting the memory full error.
    We've also tried a variety of other suggestions posted in the other thread with no success.
    We're happy to provide the RPT file to the Report Team to diagnose the problem.  Ultimately, we need to be able to produce a 15 page report with approximately 45 images.
    Our preferred scenario is fixing problem 2.  The CR Designer seems quite capable of rendering our report and printing it to our third party PDF printer in a timely manner with small size.  However, the API reports memory full.
    The API resides in a dedicated reporting web service with NO other code except for loading the report, setting parameters and printing.  When executing, it uses up to about 1.1GB before reporting the error.
    Are there any other suggestions for fixing what we have?  Are there known problems with large images in reports?  Do we need to lodge a formal support request?
    Regards,  Grant.
    PS.  Grr and my message formatting is lost when I edited this message!!!
    There is a 1500 character limit and then all formatting is removed to save space. Break you posts into separate entries.
    Edited by: grantph on Sep 30, 2009 2:49 AM

  • Crystal Report 2008 SP2 & InfoView: Custom XML Export doesnt work

    Hi,
    I have created a Crystal Report .rpt and want to use the custom xml export function to output a custom xml file. For that, I created a custom transformation file (xsl) and imported it into the .rpt . On the client machine, if I open the .rpt with Crystal Reports 2008 SP2, and select to export it using the custom xml output, all runs fine. (under SP1, only half the file was created...)
    If I upload the .rpt file to Infoview (server-side: BO Enterprise 3.1, SP2 as well) and schedule it, I can select xml, and then my custom xml as output format, but I am getting the error message u201EUngültige Exportoptionen" (="invalid export options"), in the instance history. No output file is created. I use file system as destination. Other output formats like .pdf and .rpt work fine and files are created.
    Ideas:
    -Are there any more settings needed on the server (e.g.CMC - Crystal Server Jobs, other Processes, ...) so I can schedule the report and successfully create the custom xml format file as output?
    -Do I need to upgrade to a specific SP or FP on server-side so everything runs smooth?
    Thanks for your help!

    Hi Florian,
    I'm having the same problem, have you by any chance found a solution?
    Gajus.

  • Export from Crystal Reports 2008 viewer fails if run on separate thread

    I have a windows desktop application written in Visual Basic using Visual Studio 2008.  I have installed and am trying Crystal Reports 2008 to run a report.  Everything seems to work well except that when I preview a report (using the viewer control) and click the export button found in the upper left corner of that control, I get the following message:
    Error 5: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made.  Ensure that your Main function has STAThreadAttribute marked on it.  This exception is only raised if a debugger is attached to the process.
    I am a little confused on what to do exactly.  Is the problem because I am running in the Visual Studio 2008 IDE?  It says this exception is only raise if a debugger is attached to the process.  No, I tried running it outside the IDE.  The exception wasn't generated but the application hung when the button was clicked.
    It says the current thread must be set to single thread apartment (STA) mode.  If the report is run on its own thread, is the "current" thread the thread the report is running on or is the main application's UI thread?  I don't think I want to set my main application to single thread apartment mode because it is a multi-threaded application (although I really don't know for sure because I am new to multi-threaded programming). 
    My objective is to allow reports to run asynchronously so that the user can do other things while it is being generated.  Here is the code I use to do this:
        ' Previews the report using a new thread (asynchronously)
        Public Sub PreviewReportAsynch(ByVal sourceDatabase As clsMainApplicationDatabase)
            Dim backgroundProcess As System.ComponentModel.BackgroundWorker
            ' Start a new thread to run this report.
            backgroundProcess = New System.ComponentModel.BackgroundWorker
            Using (backgroundProcess)
                ' Wire the function we want to run to the 'do work' event.
                AddHandler backgroundProcess.DoWork, AddressOf PreviewReportAsynch_Start
                ' Kick off the report asynchronously and return control to the calling process
                backgroundProcess.RunWorkerAsync(sourceDatabase)
            End Using
        End Sub
        Private Sub PreviewReportAsynch_Start(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs)
            ' The source database needed to call preview report was passed as the only argument
            Call PreviewReport(CType(e.Argument, clsMainApplicationDatabase))
        End Sub
        ' Previews the report.  From the preview window, the user can print it.
        Public Function PreviewReport(ByVal sourceDatabase As clsMainApplicationDatabase) As FunctionEndedResult
            Dim errorBoxTitle As String
            Dim frmPreview As frmReportPreview
            ' Setup error handling
            errorBoxTitle = "Preview " & Name & " Report"
            PreviewReport = FunctionEndedResult.FAILURE
            On Error GoTo PreviewError
            ' Set up the crxReport object
            If InitializeReportProcess(sourceDatabase) <> FunctionEndedResult.SUCCESS Then
                GoTo PreviewExit
            End If
            ' Use the preview form to preview the report
            frmPreview = New frmReportPreview
            frmPreview.Report = crxReport
            frmPreview.ShowDialog()
            ' Save any settings that should persist from one run to the next
            Call SavePersistentSettings()
            ' If we got this far everything is OK.
            PreviewReport = FunctionEndedResult.SUCCESS
    PreviewExit:
            ' Do any cleanup work
            Call CleanupReportProcess(sourceDatabase)
            Exit Function
    PreviewError:
            ' Report error then exit gracefully
            ErrorBox(errorBoxTitle)
            Resume PreviewExit
        End Function
    The variable crxReport is of type ReportDocument and the windows form called 'frmPreview' has only 1 control, the crystal reports viewer. 
    The print button on the viewer works fine.  Just the export button is failing.  Any ideas?

    Hi Trevor.
    Thank you for the reply.  The report document is create on the main UI thread of my application.  The preview form is created and destroyed on the separate thread.  For reasons I won't get into, restructuring the code to move all the initialization stuff inside the preview form is not an option (OK, if you a really curious, I don't always preview a report, sometimes I print and/or export it directly which means the preview form isn't used).
    What I learned through some other research is that there are some things (like COM calls and evidently some OLE automation stuff) that cannot be run on a thread that uses the MTA threading model.   The export button probably uses some of this technology, thus the message stating that an STA threading model is required.  I restructured the code as follows to accomodate this requirement.  Here is a sample:
    ' Previews the report using a new thread (asynchronously)
        Public Sub PreviewReportAsynch(ByVal sourceDatabase As clsMainApplicationDatabase)
            Dim staThread As System.Threading.Thread
            ' Start the preview report function on a new thread
            staThread = New System.Threading.Thread(AddressOf PreviewReportAsynchStep1)
            staThread.SetApartmentState(System.Threading.ApartmentState.MTA)
            staThread.Start(sourceDatabase)
        End Sub
        Private Sub PreviewReportAsynchStep1(ByVal sourceDatabase As Object)
            Dim staThread As System.Threading.Thread
            ' Initialize report preview.  This includes staging any data and configuring the
            ' crystal report document object for use by the crystal report viewer control.
            If InitializeReportProcess(DirectCast(sourceDatabase, clsMainApplicationDatabase)) = FunctionEndedResult.SUCCESS Then
                ' Show the report to the user.  This must be done on an STA thread so we will
                ' start another of that type.  See description of PreviewReportAsynchStep2()
                staThread = New System.Threading.Thread(AddressOf PreviewReportAsynchStep2)
                staThread.SetApartmentState(System.Threading.ApartmentState.STA)
                staThread.Start(mcrxReport)
                ' Wait for step 2 to finish.  This blocks the current thread, but this thread
                ' isn't the main UI thread and this thread has no UI anymore (the progress
                ' form was closed) so it won't matter that is it blocked.
                staThread.Join()
                ' Save any settings that should persist from one successful run to the next
                Call SavePersistentSettings()
            End If
            ' Release the crystal report
            Call CleanupReportProcess(DirectCast(sourceDatabase, clsMainApplicationDatabase))
        End Sub
        ' The preview form must be launched on a thread that use the single-threaded apartment (STA) model.
        ' Threads use the multi-threaded apartment (MTA) model by default.  This is necessary to make the
        ' export and print buttons on the preview form work.  They do not work when running on a
        ' thread using MTA.
        Public Sub PreviewReportAsynchStep2(ByVal crxInitializedReport As Object)
            Dim frmPreview As frmReportPreview
            ' Use the preview form to preview the report.  The preview form contains the crystal reports viewer control.
            frmPreview = New frmReportPreview
            frmPreview.Report = DirectCast(crxInitializedReport, ReportDocument)
            frmPreview.ShowDialog()
        End Sub
    Thanks for your help!
    Andy

  • Crystal Reports 2008 Export formats

    We have a full version of Crystal Reports 2008 for use with our .net application.  I also tried using the ReportAppServer's .NET assemblies but could not find a way to export to the following formats (this was possible in the previous versions of Crystal Reports)
    Excel 8.0
    Excel 8.0 Tabular
    HTML 3.2
    Looks like these are not supoorted with Crystal 2008? Can someone please confirm this?
    I came accross a document that suggested use of Excel Export Compatibility patch to support lagacy versions of excel but could not find where to download the patch from.
    Also, I did not find any document on what defalt HTML version the  crystal viewer exports to. I believe it's HTML 4.0. Is this correct?

    Hello,
    Install the latest patches for CR 2008, SP2, and you'll find the legacy formats have been added back in for Excel and HTML 3.2 is an option.
    Thank you
    Don

  • Crystal Reports 2008 Missing Page Headers and Footers when Exporting Excel

    After upgrading from Crystal Reports 9 to Crystal Reports 2008 we have noticed that when we export to Excel the document no longer retains the page headers and footers.  After doing some reading I see that there is a property called ExportPageHeadersAndFooters that we can tap into.  However, I am unable to get this to work for me.  Below is my code, do you have any suggestions?
                    ReportDocument rdReport =  new ReportDocument();
                    rdReport.Load(sReportFilePath);
                    ExportFormatType exType = ExportFormatType.Excel;
                    // create an instance of excel formatting options
                    ExcelFormatOptions foFormat = new ExcelFormatOptions();
                    foFormat.UsePageRange = false;
                    foFormat.ExcelUseConstantColumnWidth = true;
                    foFormat.ExcelTabHasColumnHeadings = true;
                    foFormat.ExportPageBreaksForEachPage = true;
                    foFormat.ExportPageHeadersAndFooters = ExportPageAreaKind.OnEachPage;
                    // set up more exporting options
                    rdReport.ExportOptions.ExportFormatType = ExportFormatType.Excel;
                    rdReport.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
                    rdReport.ExportOptions.FormatOptions = foFormat;
                    rdReport.ExportToStream(exType);

    I was able to get it to work but I had to do this.
    ExportRequestContext expReqCntxt = new ExportRequestContext();
    expReqCntxt.ExportInfo = rdReport.ExportOptions;
    sExported = ((CrystalDecisions.CrystalReports.Engine.ReportDocument)rdReport).FormatEngine.ExportToStream(expReqCntxt);

  • Internet Explorer7 Blocking Crystal Reports 2008 CrystalReportViewer Export

    Visual Studio 2008 (VS 2008)
    Crystal Reports 2008 (CR 2008)
    Production Server: Windows Server 2003
    Internet Browser: Internet Explorer 7 (IE7)
    Crystal Reports Version: 12.0.2000.0  on both development and production
    IE7 message: To help protect your security, Internet Explorer blocked this site from downloading files to your computer. Click here for options.
    I am in the process of updating my websites from Visual Studio 2005 and Crystal Reports.NET 2005 to Visual Studio 2008 and Crystal Reports 2008.
    In VS 2005, when creating a PDF or exporting from the CrystalReportsViewer, IE7 does not block the creation/download of the PDF, nor the download of an export.
    Whereas, with VS 2008 and CR 2008 using the CrystalReportViewer  in IE7 blocks the creation/download of the PDF, and the download of an export.
    The message returned in the yellow box at the top of IE7 display window:   To help protect your security, Internet Explorer blocked this site from downloading files to your computer. Click here for options.
    If I select down Download Fileu2026  from the options, I must restart the PDF or export. 
    If I show another report, I have the same problem, even if I have stated to download the fileu2026.
    1. What is different between the CrystalReportViewer versions?
    2. What is recommended to avert this problem without having users change their IE7 settings?
    I found this settings change at: http://support.dell.com/support/topics/global.aspx/support/dsn/en/document?journalid=63F807B28AEC39CEE040AE0AB6E15FC5&docid=182320
    Turn off the Information Bar for file downloads
    This procedure will allow Web sites to automatically prompt you when downloading files, bypassing the Information Bar.
    1. Open Internet Explorer.
    2. Click Tools on the menu bar.
    3. Click Internet Options...
    4. At the Internet Options window, click the Security tab.
    5. Click the Custom Level... button.
    6. Security Settings window Security Settings window, scroll down to Downloads in the Settings: list.
    7. Click to select Enable under Automatic prompting for file downloads.
    8. Click the OK button.
    9. At the Warning! message, click the Yes button to change the security settings for the zone.
    10. Click the OK button.
    You will now receive prompts directly from a Web site if it needs to download a file to your computer.

    Hi Don:
    Yes, this is an https:// site.
    This is using X500 accounts for security. Once logged in, the site is running on an anonymous local user account.
    On Internet Options | Security | Internet | Setting the security level as medium  on (the lowest I was able to go) in  IE7 does not allow the user to download without the message coming up. It even states on the side (- Prompts before downloading potentially unsafe content)
    Workaround has been:
    1. Set the site as a trusted site (Internet Options | Security | Trusted Sites | Sites | Add )
    2. On the Trusted Sites Zone | Security level of this zone | Custom levelu2026
    3. Downloads | Automatic prompting for file downloads u2013 change to Enable
    Thanks for your input.  I would like to resolve this issue. CrystalReportsViewer - Crystal Reports Exports/Printing methodology has been changed since Visual Studio 2005 .NET version. 
    Thank you for your input.
    Patti

  • Crystal Report 2008 export to text problem

    Hello,
    I am using Crystal Reports 2008 for generating reports in our WPF application. In this application, we are exporting the report to txt file on a button click. Now the application contains a form called u2018Print Manageru2019, through which the user can print the exported report(text files). Now the issue, when we try to the any of the exported report file through the application, the printer leaves alternate blank pages. The printer used in this case is DOT MATRIX EPSON LQ-1150II ESC/P2. We even tried printing the text file on HP Laser jet 4600, but the same issue is faced.
    Also, please note that when I try to read the exported txt file, a formfeed(u2018\fu2019 page break) character  can be seen  at the place where the printer leaves a blank page. Hence, my concern is, Is there any property of crystal report that I am missing on or is this a printer driver issue? But if it would have been a driver issue, then changing the printer might have solved the issue.
    I also  tried  doing u2018Keep Togetheru2019 property = false of all the sections of the report. Also, I found that the u2018New Page Afteru2019 property = true and disabled for the u2018Page Footeru2019 section. So I set u2018New Page Afteru2019 property = false programmatically as
    rdTest.ReportDefinition.Sections["Section5"].SectionFormat.EnableNewPageAfter = false;
    but no luck.
    If anyone has faced similar problem or have any clues, please help!
    Any kind of help in solving this issue will be highly appreciated.
    Thanks in anticipation!

    Good morning.
    We've got something to get straight first
    When you say "...from the Report Viewer. The report printed as expected on HP printer...", do you mean the viewer of the .NET app, or the viewer of the CR designer?
    And version 12.0.0.683, is very old (well as far as CR is concerned anyhow   ). That version is SP 1, we are now on SP 2. So that will be the place to start. Get to SP 2 which can be downloaded from here;
    https://smpdl.sap-ag.de/~sapidp/012002523100009038092009E/cr2008win_sp2.exe
    Ludek

Maybe you are looking for

  • Header Details to be Printed only for the line item details.

    Hi All, I have the following requirement. I have Page1 with the Logo, Header Window, Vendor Window, Send Invoice To, Delivere Invoice To and Main Window. Main Window Starts from the middle of the page. In the Page2 i have Logo, Header window and Main

  • Ipod Touch is not recognized on my laptop

    I just got a new Toshiba laptop with Windows 7 a couple of weeks ago. When I plugged my Ipod Touch 2g for the first time into one of the usb ports all that is recognized is a camera. Itunes doesn't notice and neither does any other program that I was

  • IPhone Device is not specified in Windows 7 after update to iOS 5

    After i updated my iPhone to iOS 5, my iPhone device become unspecified. However, my iTunes still able to detect my iPhone and sync with no problem. Another thing is my iPhone icon disappear and become a weird device, and it shows Apple iPhone instea

  • Solution Manager Project Authorization

    Dear Friends,    I have come across one authorization object namely "S_PROJ_AUTH. What is the importance of this object? In that object, field name, PROJAUTH, system asking me to enter project number. But i know only project name. From where i can th

  • Charts in WAD 7.0

    Hello Guru's Iam Currently using WAD 7.0 Can anyone suggest how to bring values inside the charts. Regards, KK