Exporting Crystal XI embedded in VB6

Thanks in advance...
I'm using Crystal XI embedded in VB6.
I'm trying to have the report automatically generate to a PDF file without the user having to update options. I can set the export options, but can't see how to have it just run using the options I've set without involving the user. I'm clearly not using the PromptForExportOptions and Export procedures correctly....
Dim Report As New CrystalReport3
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
Report.DiscardSavedData
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
'Report.ExportOptions.PromptForExportOptions
Report.ExportOptions.FormatType = crEFTPortableDocFormat
Report.ExportOptions.DestinationType = crEDTDiskFile
Report.ExportOptions.DiskFileName = "c:\vbprog\testing.pdf"
Report.ExportOptions.PDFExportAllPages = True
Report.Export
End Sub

Change the last line:
Report.Export
To be as:
Report.Export false
This will eliminate the user prompt
Ludek

Similar Messages

  • Exporting Crystal Report to HTML is not working in Windows 7

    Hi Sir,
    I am trying to export Crystal Report to HTML format using VB.NET code. Functionality is working fine at Windows XP Environment (Save to Disk, Open an Application and Email Attachment). But the same functionality is not working at Windows 7 Environment (both 32-Bit as well as 64-Bit).
    Below is the code to Exporting Crystal Report to HTML in VB.NET.
    Dim CrDiskFileDestinationOptions As New DiskFileDestinationOptions
    Dim CrFormatTypeOptions          As New HTMLFormatOptions
    Dim vFormat As Integer
    Dim CrExportOptions As New ExportOptions
    Dim vRdReport As New ReportDocument
    Dim sfd As SaveFileDialog
    Dim vFileName As String = Nothing
    vRdReport = vRptSource
    sfd = New SaveFileDialog
    If Not (vRptPath = "") Then
        sfd.InitialDirectory = vRptPath
    End If
    sfd.Filter = "Webpage, Complete(.htm;.htm)|.htm|Web Archive, Single file(.mht)|.mht|Webpage, HTML only(.htm;.html)|.html"
    If sfd.ShowDialog = DialogResult.OK Then
        ' Set the disk file options.
         CrDiskFileDestinationOptions.DiskFileName = sfd.FileName.ToString()
    Else
         Return
    End If
    CrExportOptions = vRdReport.ExportOptions
    CrFormatTypeOptions.HTMLFileName = vFileName
    CrFormatTypeOptions.HTMLEnableSeparatedPages = True
    CrFormatTypeOptions.HTMLEnableSeparatedPages = True
    CrFormatTypeOptions.HTMLHasPageNavigator = True
    CrFormatTypeOptions.UsePageRange = True
    With CrExportOptions
                        .ExportDestinationType = ExportDestinationType.DiskFile
                        .ExportFormatType = ExportFormatType.HTML32
                        .DestinationOptions = CrDiskFileDestinationOptions.DiskFileName
                        .FormatOptions = CrFormatTypeOptions
    End With
    vRdReport.Export()
    Catch ex As Exception
            MsgBox(ex.ToString)
    End Try
    Code working fine at Windows XP, But it is not woking in Windows 7 environment.
    Please can anyone share your valuable thoughts or ideas reg. this.
    Thanks in Advance
    Deivanayaga Perumal D.

    user13509659 wrote:
    Run this code to reproduce the issue.Which issue?
    It looks like inheritance is broken in the component hierarchy for JFrame in Windows 7 JDK 1.6.0_23-b05. The only thing remotely related to inheritance in your code snippet is the WindowListener, which does little. See camickr's advice about built-in exit management.
    EDIT - using the post title as a clue, I realize you may be talking about the component hierarchy, and whether the contentPane's background is visible through the upper layers. Instead of guessing, I'd prefer you describe your "issue" accurately (observed vs expected behavior).
    Edited by: jduprez on Feb 10, 2011 1:01 PM

  • Help needed  while exporting crystal reports to HTML file format using java

    Help needed  while exporting crystal reports to HTML file format using java api(not using crystalviewer).i want to download the
    html file of the report
    thanks

    the ReportExportFormat class does not have HTML format, it has got to be XML. Export to HTML is available from CR Designer only.
    Edited by: Aasavari Bhave on Jan 24, 2012 11:37 AM

  • Logon Failed when exporting crystal report to PDF

    Hi, I am Teguh
    i want to ask about error when export crystal report to pdf
    error message
    CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed
    [LogOnException: Logon failed.]
       .I(String , EngineExceptionErrorID ) +506
       .D(Int16 , Int32 ) +537
       .C(Int16 ) +10
       CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext) +577
       CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportFormatType formatType) +141
       Falcon.CRTransferSlip.Page_Load(Object sender, EventArgs e) in C:\inetpub\wwwroot\Falcon\CRTransferSlip.aspx.vb:77
       System.Web.UI.Control.OnLoad(EventArgs e) +67
       System.Web.UI.Control.LoadRecursive() +35
       System.Web.UI.Page.ProcessRequestMain() +750
    environment:
    OS : Windows server 2008 standard SP1
    IIS: Version 7.0
    SQL: Sql server 2000
    VS : Visual studio 2003
    i really confused with this error,
    please help me for this problem
    many thank's

    Hi Ludek
    Thank you for your response. I have installed SP3 and ProcMon and still the same result.
    I applied a filter on ProcMon to filter out items where the path contains 'export'.
    There are a few items where the result is 'NAME NOT FOUND' but I don't think it necessarly had anything to do with the barcode. These include items such as 'EXPORT\MailDestType','EXPORT\DisableExportLiveOfficeSupport'','EXPORT\ExportDirectory' to name a few.
    What drew my attention was the ACCESS DENIED result on specifically the EXPORT\PDF folders. The detail for these are  Desired Access : All access, however the very same entry appears a little futher on as a SUCCESS but this is detailed as Desired Access: Query Value.
    So in summary it looks something like this:
    User : Server\XXX
    Operation : RegOpenKey
    Path : HKU\.DEFAULT\Software\Business Objects\Suite 12.0\Crystal Reports\Export\Pdf
    Result : ACCESS DENIED
    Desired Access : All Access
    User : Server\XXX
    Operation : RegOpenKey
    Path : HKU\.DEFAULT\Software\Business Objects\Suite 12.0\Crystal Reports\Export\Pdf
    Result : SUCCESS
    Desired Access : Query Value
    There are a few other entries that follow this pattern that exists in other locations such as HKLM\Software...
    Could this 'ACCESS DENIED' be the problem? and If so how do I, and should I give user XXX this ALL Access its looking for.
    Regards
    Elroy

  • Error While Exporting Crystal Report in XLS

    Hi
    when i am exporting crystal report in PDF or MS-Word its working fine
    When i am going to export crystal report to Microsoft-Excel 97-2000 (XLS) i am encountering ....
    Error in File C:\WINNT\TEMP\{6A5FE727-7FDE-479F-A7D0-96EE33EF5A4F}.rpt: The request could not be submitted for background processing.  this error...
    Can anybudy plz have its solution??
    Edited by: vishal patil on Sep 29, 2008 3:21 PM

    Hi Visahal,
    Try to re-install the export excell dll files.  Go in Controll pannel Add and Remove ProgaramsClick on Crystal Reports Click on ChangeSelect Add/RemoveThen expend ExportSelect Excel export and click on ok to reinstall the excel export dlls.
    After re-installation try to export to excel.
    Thanks,
    Sastry

  • "The process cannot access the file ..." occurs when export crystal report

    We are using a web application developed in VS 2005, .NET 2.0 with the bundled Crystal Reports version 10.2.3600.0 running on a Windows 2003 Standard server with 4GB Ram and Dual CPU's. Periodically we are still receiving the following error in our production environment:
    InnerException:
    The process cannot access the file because it is being used by another process.
       at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)
       at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
       at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportOptions options)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportFormatType formatType)
    This is occuring at the point on the code where the report is being exported to a PDF. Exporting the report to Excel does not appear to cause the error.
                    Stream outStream = report.ExportToStream(ExportFormatType.PortableDocFormat);
                    byte[] charStream = new byte[outStream.Length];
                    outStream.Read(charStream, 0, (int)outStream.Length);
                    if ((charStream != null) && (charStream.Length > 0))
                        HttpContext.Current.Response.ContentType = "application/pdf";
                        HttpContext.Current.Response.OutputStream.Write(charStream, 0, charStream.Length);
                        HttpContext.Current.Response.End();
                report.Close();
                report.Dispose();
                ds.Dispose();
                GC.Collect();
    Closing and disposing of the report and dataset (xsd) are followed by a call for garbage collection. We are unable to produce the error in our development environmennt and have not at this point been unable to pinpoint a problematic report. The development team members do have SP1 installed. The report limit has not been changed from the standard of 75 jobs.  Reviewed the following document, Re: "The process cannot access the file ..." occurs when export crystal report However this applies to VS 2008. Any suggestions to resolve the issue would be greatly appreciated.
    Thanks,
    Joe

    Good morning Joe
    For more details re. loading please see the following resources:
    [Crystal Reports 2008 Component Engine Scalability|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/7025839b-00d4-2b10-33b4-cf0aa9e08412?quicklink=index&overridelayout=true]
    [How Can I Optimize Scalability?|http://msdn.microsoft.com/en-us/library/ms225519.aspx]
    [Choosing the Right Business Objects SDK for Your Needs|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40bccdfd-88a6-2b10-1da1-c47a54b625a7]
    To answer your questions:
    Is it correct to presume that the physical number of CPU's is not factored into the CPL? So that a Server with 2 or more processors does not increase the 3 concurrent requests? Therefore 2 CPU's would not increase the CPL limit to 6 processes?
    - Server with 2 or more processors does not increase the 3 concurrent requests.
    What would be an alternate solution to this limit be, considering the report requests could increase significantly?
    - Only way around this would be to web farm the solution
    If only only 3 reports can be processed at the same time. If one or more of the reports currently processing is taking longer due to receiving large amounts of data, how does that affect the queue? And what is stored in the queue, data and/or the report? Is this something that could consume memory?
    - The report can take as much time as it needs. The result is that one license will not be released until the report is done. There is no data stored, just a pointer to the report. However queued apps will chew up memory, some times to the point of the server becoming unresponsive
    I have read in the documentation on this site, that the dataset sent to the engine is copied in memory during report construction. So if a large amount of data is requested for a report (as an example 10+ MB) Could enough users requesting reports drive the memory up because memory usage doubled due to the dataset?
    - Absolutely. See [Crystal Reports Guide to ADO.NET|http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/401c4455-a31d-2b10-ae96-fa57af5aec20].
    Understanding the the CR DLL's are loaded on the first report request, do they get released at some point time due to inactivity or garbage collection? How much memory usage could be consumed when they load and stay resident?
    - No they do not. Not as long as the application is running.
    Ludek

  • Problems in exporting crystal report to word format

    Hi All,
    I am getting trouble in exporting crystal report to word formats.
    Here are my questions:
    1) The exported word file will have a text "R..950" added on top right hand corner, How to get rid of it?
    2) For those "Can Grow" fields, it can show multiple line data correctly in the viewer. However, the text box in exported word file will be too small to show all the content and lower half of the text is cut.
    Thanks and Regards,
    Cherry

    Hi Asha,
    Thanks for reply.
    The version of crystal report designer and viewer which I am using is version 11 Release 2.
    Besides, I guess it might relate to the format of report so I would like to tell you more.
    Font Face: Arial Unicode MS (in order to show chinese characters)
    Font Size: 9 pt
    For the text "R..950" issue, I just found that some people in the internet having the same issue and they suggested that may relate to the locate. In my case, the locate is Chinese (Hong Kong S.A.R.).
    If it is necessary, I may send you my report with sample for test.
    Regards,
    Cherry

  • Export Crystal to excel

    I have written the following code for windows application to export crystal report to excel. When I run this code, I get the following error :
    Error in File Item_Master {104SW232-6fwe-4ber....}.rpt: Invalid export DLL or export format.
    I can export to any other format except excel. I am using VS2005 windows app with Crystal reports 2008.
    Following is my code :
                Dim rptExcel As New ReportDocument
                Dim strExportFile As String = "C:\RT_Interface\RT_Interface\test.xls"
                rptExcel.Load("C:\RT_Interface\RT_Interface\Item_Master.rpt")
                rptExcel.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile
                rptExcel.ExportOptions.ExportFormatType = ExportFormatType.Excel
                Dim objExcelOptions As ExcelFormatOptions = New ExcelFormatOptions
                objExcelOptions.ExcelUseConstantColumnWidth = False
                rptExcel.ExportOptions.FormatOptions = objExcelOptions
                Dim objOptions As DiskFileDestinationOptions = New DiskFileDestinationOptions
                objOptions.DiskFileName = strExportFile
                rptExcel.ExportOptions.DestinationOptions = objOptions
                Dim crLogin As New ApplyCRLogin
                crLogin.c_dbName = rptExcel.DataSourceConnections.Item(0).DatabaseName
                crLogin.c_serverName = rptExcel.DataSourceConnections.Item(0).ServerName
                crLogin.c_userID = "user1"
                crLogin.c_passWord = "pw!2wer"
                crLogin.ApplyInfo(rptExcel)
                rptExcel.Export()
                objOptions = Nothing
                rptExcel = Nothing
    Edited by: Don Perera on Feb 15, 2011 5:47 PM
    Edited by: Don Perera on Feb 15, 2011 5:48 PM

    Yes I can export with CR designer. Following is the login code. If I assign the report to crystal report viewer control, the report get displayed. So nothing wrong with the login code.
    Imports CrystalDecisions.Shared
    Imports CrystalDecisions.CrystalReports.Engine
    Imports Microsoft.VisualBasic
    Public Class ApplyCRLogin
        Public c_dbName As String
        Public c_serverName As String
        Public c_userID As String
        Public c_passWord As String
        Public c_integratedSecurity As Boolean
        Public c_reportType As Integer
        Public Sub ApplyInfo(ByRef _oRpt As CrystalDecisions.CrystalReports.Engine.ReportDocument)
            Dim oCRDb As CrystalDecisions.CrystalReports.Engine.Database = _oRpt.Database()
            Dim oCRTables As CrystalDecisions.CrystalReports.Engine.Tables = oCRDb.Tables()
            Dim oCRTable As CrystalDecisions.CrystalReports.Engine.Table
            Dim oCRTableLogonInfo As CrystalDecisions.Shared.TableLogOnInfo
            Dim oCRConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo
            oCRConnectionInfo.ServerName = c_serverName
            oCRConnectionInfo.UserID = c_userID
            oCRConnectionInfo.Password = c_passWord
            oCRConnectionInfo.IntegratedSecurity = c_integratedSecurity
            If c_reportType = 2 Then
                '_dbName = _serverName
                SetDBLogonForReport(oCRConnectionInfo, _oRpt)
                SetDBLogonForSubreports(oCRConnectionInfo, _oRpt)
                _oRpt.DataSourceConnections(0).SetConnection(c_serverName, c_dbName, c_userID, c_passWord)
                Return
            End If
            For Each oCRTable In oCRTables
                oCRTableLogonInfo = oCRTable.LogOnInfo()
                oCRTableLogonInfo.ConnectionInfo = oCRConnectionInfo
                oCRTable.ApplyLogOnInfo(oCRTableLogonInfo)
            Next
            oCRTables(0).TestConnectivity()
            If Len(Trim(c_dbName)) = 0 Then
            Else
                _oRpt.DataSourceConnections(0).SetConnection(c_serverName, c_dbName, c_userID, c_passWord)
            End If
        End Sub
        Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo, ByVal myReportDocument As ReportDocument)
            Dim myTables As Tables = myReportDocument.Database.Tables
            For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In myTables
                Dim myTableLogonInfo As TableLogOnInfo = myTable.LogOnInfo
                myTableLogonInfo.ConnectionInfo.AllowCustomConnection = True
                myTableLogonInfo.ConnectionInfo = myConnectionInfo
                myTable.ApplyLogOnInfo(myTableLogonInfo)
            Next
            myReportDocument.DataSourceConnections(0).SetConnection(c_serverName, c_dbName, c_userID, c_passWord)
        End Sub
        Private Sub SetDBLogonForSubreports(ByVal myConnectionInfo As ConnectionInfo, ByVal myReportDocument As ReportDocument)
            Dim mySections As Sections = myReportDocument.ReportDefinition.Sections
            For Each mySection As Section In mySections
                Dim myReportObjects As ReportObjects = mySection.ReportObjects
                For Each myReportObject As ReportObject In myReportObjects
                    If myReportObject.Kind = ReportObjectKind.SubreportObject Then
                        Dim mySubreportObject As SubreportObject = CType(myReportObject, SubreportObject)
                        Dim subReportDocument As ReportDocument = mySubreportObject.OpenSubreport(mySubreportObject.SubreportName)
                        SetDBLogonForReport(myConnectionInfo, subReportDocument)
                    End If
                Next
            Next
        End Sub
    End Class

  • Unable export crystal report XI to pdf on window server 2003 SP1

    I have a class asp function to export crystal report XI to pdf file, it is workable at winXP but when i copy it to window server 2003, it exported the file with zero length (file size is 0kb).
    when i try to open the zero length pdf file, it shows the file is already open or in use by another application.
    when i run my export function, i can see there is a new file created at the folder "C:\windows\Temp", when i try to open the tmp file, i get the message "The process cannot access the file because it is being used by another process", i can open the tmp file after i end the process "w3wp.exe network service", the data in the tmp file is exactly what i need to export to the pdf file.
    At the window server 2003, I have installed the Crystal Report XI developer edition,
    For the web application folder and the pdf export folder, Read, Write and Modify permission has been set for the following accounts:
    1. myServer\Administrators
    2. myServer\ASPNET
    3. myserver\IUSR_myserver
    4. myServer\IWAN_myserver
    5. Network Service
    6. System
    7. myServer\Users
    I think it is the permission problem, but how to set the right permission at the window server 2003 SP1? please advise. thanks

    Hello,
    It is a permission issue. When you export Crystal first tries to write the file to the local TEMP folder and then delete it to see if it has read/write permissions. If it fails to delete the file you need to give the TEMP folder on the WEB server permissions for your application. Check Microsofts WEB site on how to set permissions on shared folders for your ASP application.
    You may want to search in forums also, this looks familar.
    Thank you
    Don

  • Problem exporting crystal PDF using printoutputController.export method

    Has anyone used PrintOutputController().export() method in ReportClientdocument to export Crystal PDF report to a JavaIOStream. I am getting an error when I try to export it using this method. The error I get is unable to connect RAS.rptappsrver followed by classcast unable to export to IXMLSerializable. Here is the code I am using.
    Is there some setting I need to enable on the server to use the export function or any other idea will be appreciated?
    IReportAppFactory reportAppFactory = (IReportAppFactory) enterpriseSession.getService("","RASReportFactory");
    ReportClientDocument reportClientDoc = reportAppFactory.openDocument(reportID, 0, Locale.ENGLISH);
    return reportClientDoc.getPrintOutputController().export(exportOptions);
    Here is the exact Exception:
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException: Unable to connect to the server: FICLDEV303VWIN.RAS.rptappserver. --- com/crystaldecisions/sdk/occa/report/exportoptions/ReportExportFormat incompatible with com/crystaldecisions/xml/serialization/IXMLSerializable---- Error code:-2147217387 Error code name:connectServer
    Caused by:
    java.lang.ClassCastException: com/crystaldecisions/sdk/occa/report/exportoptions/ReportExportFormat incompatible with com/crystaldecisions/xml/serialization/IXMLSerializable
         at com.crystaldecisions.proxy.remoteagent.FetchReportViewingRequest.saveContents(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.FetchReportViewingRequest.save(Unknown Source)
         at com.crystaldecisions.xml.serialization.XMLObjectSerializer.save(Unknown Source)
         at com.crystaldecisions.sdk.occa.managedreports.ras.internal.CECORBACommunicationAdapter.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.managedreports.ras.internal.CECORBACommunicationAdapter.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.managedreports.ras.internal.CECORBACommunicationAdapter.request(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.z.a(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.s.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.cf.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
         at com.fmr.fic.fund2fund.web.servlet.CrystalReportServlet.getReportByteStream(CrystalReportServlet.java)
         at com.fmr.fic.fund2fund.web.servlet.CrystalReportServlet.processUsingReportExportControl(CrystalReportServlet.java)
         at com.fmr.fic.fund2fund.web.servlet.CrystalReportServlet.doGet(CrystalReportServlet.java:128)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:629)
         at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2837)
         at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:220)
         at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:204)
         at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1681)
         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
         at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:94)
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:601)
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
         at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)
    I
    Is there some setting I need to enable on the server to use the export function or any other idea will be appreciated?
    Edited by: Dilshad Ahmed on Nov 5, 2008 5:55 PM
    Edited by: Dilshad Ahmed on Nov 5, 2008 6:09 PM

    Here is the answer. After getting ReportClientDoc from factory we need to set the DatabaseController userid and password (if report on Crystal server is accessing oracle database as datasource). In addition we need to set parameters on the ReportClientDoc for reports and subreports before doing the the export.
    Here is snippet of code: The code below is used to get ReportClientDocument and export it as PDF using bytestream.
    /* Code for getting report client document */
    private static synchronized ReportClientDocument getReportClientDocument() throws Exception
             int count = 3;
             ReportClientDocument rpt = null;
             while (count > 0 && rpt == null)
                  try
                       if (_enterpriseSession == null)
                            ISessionMgr _sessionMgr = CrystalEnterprise.getSessionMgr();
                            _enterpriseSession = _sessionMgr.logon(CRYSTAL_USERID, CRYSTAL_PASSWORD, CRYSTAL_SERVER, CRYSTAL_AUTH);
                             LOG.info("Successful Logging into Crystal Server: " + CRYSTAL_SERVER);
                             _reportAppFactory = (IReportAppFactory)_enterpriseSession.getService("", "RASReportFactory");
                             _infoStore = (IInfoStore)_enterpriseSession.getService("InfoStore");
                             IInfoObjects result = _infoStore.query("Select SI_ID, SI_NAME From CI_INFOOBJECTS Where SI_NAME = '" + CRYSTAL_REPORT_NAME + "' And SI_INSTANCE = 0");
                             IInfoObject infoObject = (IInfoObject)result.get(0);
                             _reportId = infoObject.getID();
                             LOG.info("Located Report Id on Crystal Server: "+_reportId);
                        LOG.info("Created or found CR session");
                        rpt = _reportAppFactory.openDocument(_reportId, 0, Locale.ENGLISH);
                        break;
                  catch (Exception e)
                       rpt = null;
                       _enterpriseSession = null;
                       if (--count == 0)
                            throw e;
              return rpt;
    /* report for setting parameter */
    private synchronized void setReportParameters(ParameterFieldController fieldController, String reportName,
                  String[] reportParameterValues,     DataDefController subDataController) throws SalesforceException
             try
                  Fields params = subDataController.getDataDefinition().getParameterFields();
                   for (Iterator it = params.iterator(); it.hasNext();)
                        ParameterField paramField = (ParameterField)it.next();
                        int paramIndex = getElementIndex(_reportParameters, paramField.getName());
                        if (paramIndex < 0)
                             throw new SalesforceException("Parameter not defined in the configuration");
                        ParameterFieldDiscreteValue dVal = new ParameterFieldDiscreteValue();
                        dVal.setValue(reportParameterValues[paramIndex]);
                        fieldController.setCurrentValue(reportName, paramField.getName(), dVal);
                   LOG.info("Completed setting parameters for report " + reportName);
             catch (ReportSDKException e)
                   LOG.error("Set Report Parameters error: ", e);
                   throw new SalesforceException("Set Report Parameters error", e);
         catch (Exception e)
                   LOG.error("Error from getElementIndex: ", e);
                   throw new SalesforceException("Set Report Parameters error", e);
    /* main method used to getReport based on passing information */
        private synchronized byte[] getReport(String contactId) throws SalesforceException
             try
                  String[] reportParameterValues =
                       new String[] {_sessionId, _viewId, _requestId, contactId, _language};
                   DataDefController reportDefController = reportClientDoc.getDataDefController();
                   reportParameterValues[0] = (_cache.equalsIgnoreCase("true") ? "CACHE:Main" : "Main");
                   setReportParameters(reportDefController.getParameterFieldController(), null,
                             reportParameterValues, reportDefController);//.getDataDefinition().getParameterFields());
                   IStrings subRepNames = reportClientDoc.getSubreportController().getSubreportNames();
                   for (Iterator iname = subRepNames.iterator(); iname.hasNext();)
                        String subName = (String)iname.next();
                        reportParameterValues[0] = (_cache.equalsIgnoreCase("true") ? "CACHE:" : "") + subName;
                        setReportParameters(reportDefController.getParameterFieldController(), subName, reportParameterValues,
                                  reportClientDoc.getSubreportController().getSubreport(subName).getDataDefController());//.getDataDefinition().getParameterFields());
                   InputStream is = reportClientDoc.getPrintOutputController().export(ReportExportFormat.PDF);
                 byte[] reportBinaries = new byte[is.available()];
                 is.read(reportBinaries);
                 is.close();
                 LOG.info("Completed exporting Crystal Report as InputStream using export() method: "+contactId);
                 return reportBinaries;
             catch (ReportSDKException e)
                   LOG.error("Report generating error: ", e);
                   throw new SalesforceException("Report generating error", e);
             catch (IOException e)
                   LOG.error("Report exporting error: ", e);
                   throw new SalesforceException("Report exporting error", e);

  • Crystal Report Embedded server 2008

    Hi SAP,
    I have reports created in Crystal reports 2008 sp1 designer. Reports are created using stored procedures.Reports are called through .net application and placed at Crystal Report Embedded server 2008.If Reports  are at local machine they work fine.If reports are  at Crystal Report Embedded server 2008 it prompts for parameter and database credentials.
    Here is my code
    CrystalDecisions.CrystalReports.Engine.ReportDocument rd= new CrystalDecisions.CrystalReprots.Engine.ReportDocument();
    String rptfilepath="ras://C:\Reports\EmbededRpt.rpt";
    Rd.ReportAppServer="RasServer";
    Rd.FileName= rptfilepath;
    Rcd=rd.ReportClentDocument;
    System.Data.Dataset ds = this.GetData();
    Rd.SetDataSource(CrystalDecisions.ReportAppServer.DataSetConversion.DataSetConverter.Convert(ds));
    CrystalReportViewer1.ReportSource=rcd.ReportSource;
    Any response will be appreciated.
    Thanks.

    Hi,
    I believe Crystal Report Embedded server 2008 does not come with .NET SDKs. You need to wait for its SP1 release that should make make .NET sdks available for the application.
    Thanks.

  • Exporting jpegs with embedded previews?

    For compatibility with a web application I wrote using an old workflow ending with a save-for-web in Photoshop, I need to export jpegs with embedded previews. (Not DNG or other format files with embedded jpeg previews.) This happens by default with Photoshop, but Lightroom doesn't do it and I can't find anything to change that in the settings. Am I missing something? And if this isn't included, is it on the to-do list for improvements?

    Hi Andrew,
    Please refer to the following forum post : http://forums.adobe.com/message/5770863#5770863
    Regards,
    Aish

  • Drill-down options on exported Crystal reports (PDF/HTML)

    Is it possible to drill-down on the exported crystal reports in PDF/HTML format?

    PDF format does not support drill-down. 
    PDF format supports bookmarking to specific locations in the document, but not something refined as drilling.
    Sincerely,
    Ted Ueda

  • Could not export Crystal report from SAP B1 to MS excel

    Hi Experts.
    Could not Export crystal report  which are created in .net crysta report to MS excel in SAP business one.
    Kindly give any solution.
    Thanks & Regards,
    Bhushan

    Hi,
    Crystal reports it self u can export data from MS excel .
    Regards,
    Siva

  • How to export crystal report to excel through progeam

    Hi,
    Can any help me how to export crystal report to excel through program(C#). I'm using VS2005.
    Also, the report should be in a pivot table format after exporting to the excel..please help me how to do this
    Thanks,
    Venky

    Hi Venkat,
    The link below provides the code C# in an ASP.NET codebehind file
    http://www.codeproject.com/KB/cs/Crystal_Report_Export.aspx
    http://aspalliance.com/478_Exporting_to_Excel_in_Crystal_Reports_NET__Perfect_Excel_Exports.2
    Regards,
    Abhijeet  T.

Maybe you are looking for

  • How can I get status of a production order from database?

    Hi,    I need to write a report to show user details about the production order. Because there are some customized linkages between our sales order and production order, we can't use COOIS directly.   But I met a problem when writing this report. I f

  • Photoshop 5 won't start

    I have Windows 7 and Photoshop 5.1. Photoshop gets stuck on the startup screen at 'initializing' since around Dec 5th. It will only start again when I roll back to a restore point before Dec 5th. I have cleared preferences many times to get it to sta

  • A really bright light just came on, on my husbands phone

    I don't really know what he did, he doesn't either.  He said his phone was just sitting on his lap and this bright light (for the camera maybe?) came on and stayed on.  It finally went out, but now he wants to know how it came on?  I can't find it my

  • Grid Preview image different colours to Develop module

    I have just scanend a load of colour negatives with a Nikon Coolscan V and created NEF 6000 x 4000 pixels 14 bit 137Mb files and imprted into LR 3.6.  When i look att hme in the develop modeule they look great and sky is good blue colour.  When I loo

  • How to turn off remote control on mac 10.8.4

    I need to turn off remote access? Where do I do this ?