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

Similar Messages

  • Crystal Reports 2008 export to PDF does not render Japanese fonts

    Hello,
    I have searched the forums for this issue, and there does not seem to be a clear resolution to this problem.  We are using CR2008 to create RPT files that are bundled with our custom .NET 2005 application, which then generates reports in PDF format by running the RPT files against an access mdb database using the CR2008 runtime (our application is deployed on a different machine than the one that is used to create the RPT files).  The issue we are having occurs when data in the access mdb file contains Strings with Japanese characters.  The system that our application is running on does contain the eastern asian language fonts so if a user opens the mdb file using access, they can see the Unicode strings in the database rendered properly (rather than the usual boxes and garbage).  However, once our application generates the report filling in the rpt file with data from the mdb and exporting the report to pdf format, the entries that should contain Japanese font data, which leads me to believe the problem is in the export pdf function of the crystal reports 2008 runtime.  Is there anyway we can configure the runtime to properly embed the fonts in the PDF so that the users can view the Japanese content from the database.  Our users end up viewing reports on both OSX and Windows using Adobe Acrobat Reader.
    Thank you very much in advance

    Thanks for the quick reply!
    1) Exact version of Crystal Reports. (Open Crystal Developer. Go to Help> About Crystal Reports).
    12.0.0.683
    Type: Full
    2) What happens if you export the report to PDF format from the standalone Crystal Reports Designer?
    Same result.  The entry shows up as giberish in the report designer preview...however, by doing this I stumbled upon something.  See below
    3) Are you able to export the report to other formats without any issue?
    See Note below
    NOTE:
    In another part of the report, I just put the fields in question directly in the report (that is, not embedded in a text object).  That part of the report when run produces the correct non-gibberish, properly rendered Japanese result (in the CR designer preview).  The same field, however, when embedded in a text object, results in the gibberish being shown in the designer preview as well.
    Now when I export this to PDF, that ends up turning both areas into the incorrect, gibberish result.  Both the one that did properly render in the preview (field not embedded in text object) and the one in the text object.
    Exporting to any other format (tried xls, rtf and html) results in correct rendering for the field not embedded in the text object and incorrect rendering for the field embedded in a text object.
    Hope this helps with the problem, and I think it means this thread probably still belongs under this current forum.
    Cheers

  • 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 10 - Export to TEXT with Delimited Space Format

    Hello,
    I am new to Crystal reports, sorry if this is a really basic question.  I am trying to create a report which I can export to a TXT file.  The TXT file format will be delimted space (size 500 characters).  I would like to know how I can use Crystal reports to fix the size of the fields.
    For example field 1 is 22 characters, field 2 starts directly after field 1 and is 9 characters (9 spaces), field 3 is then 7 characters so an example of the output I need is:
    1111111111111111111111         2222222
    I will need to use a mixture of TEXT fields and database fields to create the report.  Thefore is it possible to specify the length of a text file i.e. TEXT1 = 22?
    I am new to Crystal so I hope there is a simple solution without the use of coding
    Thanks,
    Brett

    You will have to force the fields to the length that you are looking for, as Crystal treats strings as variable length strings.  So to force a character field to 20 characters, you'd do something like:
    left({db.charfield} + ReplicateString(" ", 20), 20)
    For a number, you could use either
    ToText({db.numfield}, "0000000000")
    or
    right(ReplicateString(" ", 10) + ToText({db.numfield}, "0"), 10)
    (for a 10 digit integer; change the format string in ToText for other numeric data types)
    I suggest that it may be clearer and more accurate to create one formula field with the entire line formatted as needed, then just display that one field on the report.
    HTH,
    Carl

  • Problems in exporting Urdu data to pdf through Crystal Report  2008

    Hi,
    We have a designed a crystal report in latest Crystal Report SP2. The database used is MS Access, the data is in Urdu langauge. The data is displayed properly on crystal report main preview.
    The problem is only when we export the report to PDF there is a data loss. The content is not properly exported.
    Some additional unexpected characters are also getting inserted.
    But the same content is proper if we export the report into .rtf or .doc format.
    I have tried  this with Arial Unicode MS and C-DAC UROT-GIST Galid fonts.
    Please help.
    Regards,
    Sitaram Gaikwad
    C-DAC GIST

    CR only support UTF-8 fonts.
    Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
    http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551

  • JRC Export to Text like Crystal Report Designer Export

    We need to Export report to Text like Crystal Report Designer Export using JRC. Is this possible? I see export ReportExportFormat CSV, PDF and RTF only. These exports are working, But I need plain text that looks like Text export of Crystal Reports Designer. I see this working in RAS 2008. What I can do to get this with JRC. I am using Crystal Reports 2008 to design reports.
    Thanks for any help.
    Regards
    Raveendra
    Clarification

    Thank you Jitin.
    What could be solution to this problem?
    If still I want to go with JRC, Can I write some Java code to perform this export?
    I see TextExportFormatOptions and its not working.
    If I want to export automatically to text format, what other choices are there?
    Basically I need to execute report and generate text file automatically. Text file should look like Crystal Report Designer Exported Text file.
    Thank you for your time.
    Regards,
    Raveendra

  • Problem in Crystal Report 2008 selectionFormula

    Post Author: saro_j
    CA Forum: Crystal Reports
    Hi,
    I am having a strange problem in Crystal report 2008. Earlier I was using VS 2005 Crystal report. Then we purchased Crystal report 2008.
    When I open the VS 2005 projects it asks the reports to convert into Crystal report 2008. I did that.
    Earlier I was using the following syntax for passing the date as selectionFormula
    Dim selectionFormula As String = "{tblClient.Name} = '" & ddlClient.SelectedItem.Text & "' and {TBILL_File_Format.Week Ending Date} = #" _& Convert.ToDateTime(DtCtrlProDateFrom.DateTimeValue) & "#u201D WeeklyReportByClientNameReport.DataDefinition.RecordSelectionFormula = selectionFormula
    But now when I run this same it says
    This field name is not known. Details: errorkind Error in the file rptWeeklyReport.rpt: Error in formula Record_selection: 
    u2018{tblClient.Name} = 'ABC10' and "{TBILL_File_Format.Week Ending Date} = #04/20/2008#u2019 This field name is not known. Details: errorkind
    I have no idea about this
    Even If I tried to pass as follows
    selectionFormula = "{TBILL_File_Format.Week Ending Date} = DateTime (2008, 04, 25, 00, 00, 00) and {TBILL_File_Format.Client Code} = 'ABC10' "
    I couldnu2019t see any record on the report except Grouptree of the report. If I export the report it has all the data as I expected.
    Please help me out on this regards.
    Thanks in advance
    Saravanan

    Post Author: jehanzeb
    CA Forum: Crystal Reports
    Hello,
    I use CR2008 and VS2005, it never asked me to convert the file into VS2005. What do you mean by VS 2005 asked you to convert the file? Did you make the file in CR2008 and then imported it into VS2005 as a Report Document?
    I usually create a report on CR2008 and then move that report (copy) to the same folder as VS project folder, then from there I create a new Report Doc in VS and open the file.
    As you mentioned when you export the report it works fine but when you run it it gives errors. I think it is because of the import of the report. Look at the error message as it says the field name is not known, I suspect it is not connected/imported properly.
    "This field name is not known. Details: errorkind Error in the file rptWeeklyReport.rpt: Error in formula Record_selection: 
    u2018{tblClient.Name} = 'ABC10' and "{TBILL_File_Format.Week Ending Date} = #04/20/2008#u2019 This field name is not known. Details: errorkind"
    I think it is becasue of the import of the report or could be becasue you didnt save the report with an option of "save report data". Check your report and reimport it. might fix the problem:D

  • 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

  • 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.

  • Problem with keydecoder.dll in Crystal Reports 2008 Trial Version

    Hello,
    My company is interested in purchasing Crystal Reports 2008 and has asked me to download and try the trial version.  However, I have been running into a keydecoder.dll problem.  Setup was smooth and here are the details:
    Problem message:
    "Crystal Reports: Application Error Couldn't load keydecoder.dll"
    I have Windows Vista and I have already configured all permissions and administrative rights to the problem to full control.  I have also attempted to drag the keydecoder.dll application extension out of win32_x86 to the file folder crystal reports 2008.  I have also already attempted to reinstall and making a new program file location named 'Crystal Reports 2008'. 
    I'm running out of ideas and would appreciate some help.  Thank you

    Hi Key,
    I have found a business objects Note 1198801.
    Please have a look to it.
    We can find Business objects Note/KBase from here
    [https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_ossnotes&query=&adv=true#]
    For your reference have a look to content of that Note:-
    1198801 - Error: "Crystal Reports: Application Error - Couldn't load the keydecoder.dll" when attempting to start Crystal Reports XI
    Symptom
    When attempting to start Crystal Reports XI, the following error message appears:
    "Crystal Reports: Application Error - Couldn't load the keydecoder.dll".
    Cause :
    The error message occurs because the CommonFiles entry has the wrong path in the registry.
    Resolution :
    CAUTION The following resolution involves editing the registry. Using the Registry Editor incorrectly can cause serious problems that may require you to reinstall the Microsoft Windows operating system. Use the Registry Editor at your own risk. It is strongly recommended that you make a backup copy of the registry files before you edit the registry. For information on how to edit the registry key, view the 'Changing Keys And Values' online Help topic in the Registry Editor (Regedit.exe).
    To resolve the error message
    Click Start > Run. The Run dialog box appears.
    Type "regedit" in the Open: text field. Click OK. The Registry Editor appears.
    Navigate to the following key: HKEY_LOCLAL_MACHINESOFTWAREBusiness ObjectsSuite 11.5Crystal Reports.
    Double-click the CommonFiles string. The Edit String dialog box appears.
    Ensure that the path points to the location of <installation directory>Common3.5 in.
    For example, the default location is the following: C:Program FilesBusiness ObjectsCommon3.5 in.
    Edit the path as necessary.
    Click OK. Close the Registry Editor.
    Crystal Reports starts successfully.
    Hope that helps!!
    Regards,
    Shweta

  • 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

  • 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

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

    Hi,
         We have an serious issue while exporting the crystal report into excel. We are able to export into all type in our development environment. But when we tried to export from our server all exports working except the excel. However when we restart the IIS the excel export also working for sometimes and again we are facing the same problem.
    Development environment:
    .Net 2008
    Crystal report 2008
    SQL Server 2008
    +Server Environment:+
    IIS7.0 in Classical mode
    Crystal report 2008 runtime without any SP
        We chosen Classical mode to avoid the error 'an error occurred on the server. printing will be stopped' after a successful print. It is an known issue and I'm curious to know is there any fix available to resolve this issue. Because we prefer Integrated mode.
        Earlier we dont face the excel export problem and we encountered after the SP3 installation. So we uninstalled it from server and we just installed only the run-time. But still we are facing the same problem. we could not able to conclude the cause of this issue because classical mode may create this issue?
    This is a very critical issue to us, so if anyone has the solution please help me.
    Thanks

    Hello,
    Not clear, did you mean when you install SP 3 it worked?
    Use Process Monitor or Fiddler to see what is failing. With out an error message or any other error from IIS logs or Event Viewer logs anything could be the cause.
    Thank you
    Don

  • 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.

Maybe you are looking for

  • How to write error log while creating invoice and avoid implicite commit

    Hi, I've have written code in exit RV60AFZZ in which I check for some possible errors while invoicing via VF01/VF04. If conditions are met then we create error message and display it to the user. As result we had a lot of missing SD invoices in FI wh

  • Why can I not print from text editor?

    I am new to the mac & was trying to do up a text document.  I went to text editor thinking that would work. I did it up all nice & can not print it. I just goes all funny. I know it is not my printer; can print other things fine. Can you please help?

  • R & R: "not a correct disc" during install

    Hi, I did a backup by R & R, it made two DVDs. One called "startup disc" and the second called "product recovery". Everything went great, and the R & R said that I cannot do another copy - I know, thats right. I have formated the HDD, and I tried to

  • Thousands of duplicate favorites

    Some how my favorites have managed to duplicate themselves thousands and thousands of times. I just recently noticed this when I tried looking at my favorites in IE11 and it kept crashing. Heres what I did...I cleaned out my favorites in IE and i fig

  • How do I properly transfer CS from one machine to another

    I want to remove my apps and license from one machine and move to another. I uninstalled CC, but the apps are still on the machine and functioning? Will I be able to move to a new machine without trouble?