Exporting a crystal report as PDF and Attaching to an email via code - Filename Issuses?

Post Author: alynch
CA Forum: .NET
I need to export a crystal report as a pdf and send it out via email.  I have created a subroutine that works but the attached filename come up as "untitled.txt" so the receiving machine believes it is a text file.  If I rename it on the recipients machine to a ".pdf" I can open it with acrobat and it looks OK.  Does anyone know how to rename the file as a pdf prior to sending it out? 
Thank You.
al
I have included a copy of the subroutine:
Dim repdoc As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
Dim diskOpts As New CrystalDecisions.Shared.DiskFileDestinationOptions()
Dim ExpOpts As CrystalDecisions.Shared.ExportOptions
Dim MailOpts As New CrystalDecisions.Shared.MicrosoftMailDestinationOptions()
repdoc = Me.CrystalReport11
repdoc.Load("C:\Documents and Settings\User\My Documents\Visual Studio 2005\Projects\WindowsApplication3\WindowsApplication3\CrystalReport1.rpt")
ExpOpts = repdoc.ExportOptions
With ExpOpts
.ExportDestinationType = CrystalDecisions.[Shared].ExportDestinationType.MicrosoftMail
.ExportFormatType = CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat
End With
With MailOpts
.MailMessage = "Message"
.MailToList = "enter email adress here"
.MailSubject = "Attached is a PDF file - .net Export test "
End With
ExpOpts.DestinationOptions = MailOpts
Try
repdoc.Export()
Catch err As Exception
MessageBox.Show(err.ToString())
End Try
End Sub

Post Author: Knight
CA Forum: .NET
I had this same problem today, here's what I used. Its built in 2 parts. Step one loops throught and exports PDF copies of a traking report. Step 2 builds an email list from a SQl query and sends it.STEP ONE:Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click        'Declare the some variables        Dim row1 As DataRow        Dim brokerID As String        Dim brokername As String        Dim brokerEmail As String        Dim shipdate As String        Dim crParameterFieldDefinitions As ParameterFieldDefinitions        Dim crParameterFieldDefinition As ParameterFieldDefinition        Dim crParameterValues As New ParameterValues()        Dim crParameterDiscreteValue As New ParameterDiscreteValue()        Dim crParameterFieldDefinitions1 As ParameterFieldDefinitions        Dim crParameterFieldDefinition1 As ParameterFieldDefinition        Dim crParameterValues1 As New ParameterValues()        Dim crParameterDiscreteValue1 As New ParameterDiscreteValue()        Dim CrReport As New CrystalReport1() ' Report Name         Dim report As ReportDocument = "O:KNIFormats_ReportPrivateSMStageShipmentInfo"        Dim CrExportOptions As ExportOptions        Dim CrDiskFileDestinationOptions As New DiskFileDestinationOptions()        Dim CrFormatTypeOptions As New PdfRtfWordFormatOptions()        Dim SHIPDATE123 As String        SHIPDATE123 = _month & "/" & _day & "/" & year        Dim db As String        db = System.Configuration.ConfigurationSettings.AppSettings("Datalogin")        Dim sqlCon As New SqlConnection        sqlCon.ConnectionString = db        Dim strsql1 As String        strsql1 = "SELECT     tblSOOrd_Hdr.BrokerCd, tblSO_Ord_Hdr.BrokerName, tblSM_Ship_Hdr.ShipDate "        strsql1 &= "FROM         tblSO_Ord_Hdr INNER JOIN tblSM_Ship_Hdr ON tblSO_Ord_Hdr.Locale = tblSM_Ship_Hdr.Locale AND tblSO_Ord_Hdr.OrdNo = tblSM_Ship_Hdr.OrdNo AND "        strsql1 &= "              tblSO_Ord_Hdr.RlsNo = tblSM_Ship_Hdr.RlsNo INNER JOIN tblSys_Cust_Broker ON tblSO_Ord_Hdr.BrokerCd = tblSys_Cust_Broker.BrokerCd "        strsql1 &= "GROUP BY tblSO_Ord_Hdr.BrokerCd, tblSM_Ship_Hdr.ShipDate, tblSO_Ord_Hdr.BrokerName "        strsql1 &= "HAVING      (tblSM_Ship_Hdr.ShipDate = '" & SHIPDATE123 & "') "        Dim da1 As New SqlDataAdapter(strsql1, sqlCon)        Dim worktbl1 As DataTable        worktbl1 = New DataTable("tblEmail")        da1.Fill(worktbl1)        da1.FillSchema(worktbl1, SchemaType.Source)        If worktbl1.Rows.Count > 0 Then            For Each row1 In worktbl1.Rows                brokerID = CStr(row1("BrokerCd")).Trim                brokername = CStr(row1("BrokerName")).Trim                shipdate = CStr(row1("ShipDate")).Trim                CrReport.Load()                crParameterDiscreteValue.Value = shipdate                crParameterFieldDefinitions = CrReport.DataDefinition.ParameterFields                crParameterFieldDefinition = crParameterFieldDefinitions.Item("ShipDate")                crParameterValues = crParameterFieldDefinition.CurrentValues                crParameterValues.Clear()                crParameterValues.Add(crParameterDiscreteValue)                crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)                crParameterDiscreteValue1.Value = brokerID                crParameterFieldDefinitions1 = CrReport.DataDefinition.ParameterFields                crParameterFieldDefinition1 = crParameterFieldDefinitions1.Item("Broker")                crParameterValues1 = crParameterFieldDefinition1.CurrentValues                crParameterValues1.Clear()                crParameterValues1.Add(crParameterDiscreteValue1)                crParameterFieldDefinition1.ApplyCurrentValues(crParameterValues1)                CrDiskFileDestinationOptions.DiskFileName = "c:Test_Folder20" & _year & "-" & _month & "-" & day & "" & brokername & ".pdf"                CrFormatTypeOptions.FirstPageNumber = 1 ' Start Page in the Report                 CrFormatTypeOptions.LastPageNumber = 1000 ' End Page in the Report                 CrFormatTypeOptions.UsePageRange = True                CrExportOptions = CrReport.ExportOptions                With CrExportOptions                    .ExportDestinationType = ExportDestinationType.DiskFile                    .ExportFormatType = ExportFormatType.PortableDocFormat                    .DestinationOptions = CrDiskFileDestinationOptions                    .FormatOptions = CrFormatTypeOptions                End With                Try                    CrReport.Export()                Catch err As Exception                    MessageBox.Show("DID NOT EXPORT")                End Try            Next            MessageBox.Show("All PDF's exported succesfully")        End If    End SubSTEP 2: Private Sub Button3Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click        Dim row2 As DataRow        Dim SHIPDATE123 As String        SHIPDATE123 = _month & "/" & _day & "/" & year        Dim db1 As String        db1 = System.Configuration.ConfigurationSettings.AppSettings("Datalogin")        Dim sqlCon As New SqlConnection        sqlCon.ConnectionString = db1        Dim strsql2 As String        strsql2 = "SELECT     tblSOOrd_Hdr.BrokerCd, tblSys_Cust_Broker.BrokerName, tblSM_Ship_Hdr.ShipDate, tblSys_Cust_Broker.ContactEmail "        strsql2 &= "FROM      tblSO_Ord_Hdr INNER JOIN tblSM_Ship_Hdr ON tblSO_Ord_Hdr.Locale = tblSM_Ship_Hdr.Locale AND tblSO_Ord_Hdr.OrdNo = tblSM_Ship_Hdr.OrdNo AND "        strsql2 &= "          tblSO_Ord_Hdr.RlsNo = tblSM_Ship_Hdr.RlsNo INNER JOIN tblSys_Cust_Broker ON tblSO_Ord_Hdr.BrokerCd = tblSys_Cust_Broker.BrokerCd "        strsql2 &= "GROUP BY  tblSO_Ord_Hdr.BrokerCd, tblSM_Ship_Hdr.ShipDate, tblSys_Cust_Broker.ContactEmail, tblSys_Cust_Broker.BrokerName, tblSys_Cust_Broker.Email_ASN "        strsql2 &= "HAVING    (tblSM_Ship_Hdr.ShipDate = '" & SHIPDATE123 & "') AND (tblSys_Cust_Broker.Email_ASN = 1) AND (tblSys_Cust_Broker.ContactEmail <> '') " Dim da1 As New SqlDataAdapter(strsql2, sqlCon) Dim worktbl2 As DataTable worktbl2 = New DataTable("tblEmail12") da1.Fill(worktbl2) da1.FillSchema(worktbl2, SchemaType.Source) Dim brokerID As String Dim brokername As String Dim brokerEmail As String Dim shipdate As String If worktbl2.Rows.Count > 0 Then For Each row2 In worktbl2.Rows brokerID = CStr(row2("BrokerCd")).Trim brokername = CStr(row2("BrokerName")).Trim brokerEmail = CStr(row2("ContactEmail")).Trim shipdate = CStr(row2("ShipDate")).Trim Dim mail As New MailMessage Dim att As String att = "c:Test_Folder20" & _year & "-" & _month & "-" & _day & "" & brokername & ".pdf" 'set the addresses mail.From = New MailAddress("[email protected]") mail.To.Add(brokerEmail) mail.Attachments.Add(New Attachment(att)) 'set the content mail.Subject = "Shipment Tracking report from Knox Nursery for " & SHIPDATE123 mail.IsBodyHtml = True mail.Body = "
" mail.Body &= "This shipment update has been requested by:
"                'send the message                Dim smtp As New SmtpClient                smtp.Send(mail)                ' MessageBox.Show("No Records Found", "Failed to send", MessageBoxButtons.OK, MessageBoxIcon.Stop            Next        Else            MessageBox.Show("No broker have opted in", "No Emails Sent", MessageBoxButtons.OK, MessageBoxIcon.Information)        End If        MessageBox.Show("Emails sent... ", "Emails Sent", MessageBoxButtons.OK, MessageBoxIcon.Information)    End Sub

Similar Messages

  • Export Arabic Crystal Report To PDF

    Hi,
    I am using JRC component to build crystal reports in English & Arabic. All works well except exporting Arabic crystal report to PDF?
    Crystal File Format Schema: 12.0.0
    I was reading another 3 years old thread and this was stated there:
    "If you are using the Java Reporting Component, you will not be able to see Arabic characters in your PDF document because the JRC does not support font embedding, and only works with a specific character set when exporting to Adobe" Any from SAP can you please confirm that does this still hold true? And are there any chances or plan to add support in future?
    Regards
    SC

    Please disregard that part of the previous message.
    As mentioned earlier, it depends on which of our products you are using to export the report.  If you are using the Java Reporting Component, you will not be able to see Arabic characters in your PDF document because the JRC does not support font embedding, and only works with a specific character set when exporting to Adobe.
    If you are using the Crystal Reports designer or BusinessObjects Enterprise SDK to export the report, you will need to ensure you have the character set installed on the same machine; for BOE SDK it needs to be on the machine with all of the services.

  • Converting a crystal report to pdf and then opening the pdf automatically

    I am successfully exporting a crystal report to a pdf file using code in vb.net 2008 in a windows application.   The crystal report is open in the viewer control and the user presses a button to export it.
    I create a variable with the report name and the location..  All works correctly.  However, I want the pdf to be open once it is saved which I believe is the case when you create  the pdf using the build in crystal export control.  But I am not using that.
    I presume I could call another form and use the adobe com control, but i prefer to do this in one place.
    How can I accomplish this.
    Thanks
    smHaig

    How about if I filter the open dialog box using the pdf name and folder.  Then that one would be the only one open in the dialog box and if the user selects it, it would open.  Have not tested yet, but this popped into my mind.   Seems better than a button on the form with the crystal view  to open another form .  Or I could have the adobe com object over laying the cr viewer and just make it visible if they press a button to open the abode  file..
    Maybe people have tried this and could comment on the better choice to view the pdf
    1.  call another form that contains  the adobe com
    2.  place the adobe control over the cr viewer and make visible if user requests to see pdf.   
    3.  use a filtered open dialog box.

  • RTF inccorect text when I export my Crystal Report to PDF

    Hello,
    I'm facing a quite unusual problem.
    I've developped a VB.NET 2008 application for my customer that creates Crystal Reports from manually-entered text.
    There's a part where the user can enter RTF text in a RichTextBox control, or import from a RTF File.
    Here's what I do :
    I'm typing a three-lines example in Word 2007 and save it in RTF.
    Then I import it in my application into the RichTextBox.
    When I display the report, everything looks fine, but when I export it to PDF, "i" letters are inserted after each "t" letter.
    It looks like it appears only after a "bold"-ed text. Here's and example:  [http://screencast.com/t/31t4X86XBs3]
    I'm using CrystalReports Editor Included in Visual Studio 2008.
    Has anyone already encoutered that issue ?
    Regards,
    Guillaume

    See [this|https://forums.sdn.sap.com/click.jspa?searchID=29094456&messageID=7206473] forum thread for possible clues to a resolution. In a nut shell, as long as the Calibri font is up to date, the other two steps are;
    1) Ensure you are using the latest Service Pack as suggested by Jonathan
    2) See what USP10.dll is loading (use the [Modules|https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip] utility)
    Also, if this is a win app, compile it to an exe and run the exe to see if the issue persists. (when running the app exe, the USP10 loaded should be from the CR bin directory. when running ion the .NET environment, the USP10 will load from win\system or other)
    Ludek
    Edited by: Ludek Uher on Jul 16, 2009 10:57 AM

  • Exporting a crystal report to PDF through web server makes fonts smaller

    Hi, I've investigated this issue and found information on the registry keys, and this has fixed crystal designer - so I can load a report, export to PDF and it looks normal. However, when compiling reports through our web-app, the fonts are still small. I've placed keys in both the Business Objects and Crystal Decisions folders on both HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE, but it doesn't seem to affect the re-distributable at all. Anyone know how I can overcome this?

    Hi
    Please update the thread with the following information:
    1. Platform for web application development.
    2. Version of crystal reports (for e.g 11.5.8.826,11.0.0.896)
    Thanks

  • Convert SMARTFORM report to PDF and send as an email attachment

    Hi
    I am using the CONVERT_OTF function module to convert a SMARTFORM report in the "spool" to a PDF file. When I use the DOWNLOAD function module, the resulting file can be opened in acrobat.
    I would like to email the report in PDF format as an attachment. I am using the function module SO_NEW_DOCUMENT_ATT_SEND_API1 to create an attachment however the attached file is not being created correctly and When try to open, it gives 'File is damaged and could not be repaired' error message. I believe that somehow I am not using the SO_NEW_DOCUMENT_ATT_SEND_API1 function module correctly.
    Please help me to correct this
    Thanks
    Rohitha
    see my code below,
    I_OTF[] = W_RETURN-OTFDATA[].
      CALL FUNCTION 'CONVERT_OTF'
        EXPORTING
          FORMAT                = 'PDF'
          MAX_LINEWIDTH         = 132
        IMPORTING
          BIN_FILESIZE          = V_LEN_IN
        TABLES
          OTF                   = I_OTF
          LINES                 = I_TLINE
        EXCEPTIONS
          ERR_MAX_LINEWIDTH     = 1
          ERR_FORMAT            = 2
          ERR_CONV_NOT_POSSIBLE = 3
          OTHERS                = 4.
      IF SY-SUBRC <> 0.
      ENDIF.
      LOOP AT I_TLINE.
        TRANSLATE I_TLINE USING '~'.
        CONCATENATE WA_BUFFER I_TLINE INTO WA_BUFFER.
      ENDLOOP.
      TRANSLATE WA_BUFFER USING '~'.
      DO.
        I_RECORD = WA_BUFFER.
        APPEND I_RECORD.
        SHIFT WA_BUFFER LEFT BY 132 PLACES.
        IF WA_BUFFER IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
      REFRESH:  I_RECLIST,
                I_OBJTXT,
                I_OBJBIN,
                I_OBJPACK.
      CLEAR WA_OBJHEAD.
      I_OBJBIN[] = I_RECORD[].
      I_OBJTXT = 'PDF Attachment'.
      APPEND I_OBJTXT.
      DESCRIBE TABLE I_OBJTXT LINES V_LINES_TXT.
      READ TABLE I_OBJTXT INDEX V_LINES_TXT.
      WA_DOC_CHNG-OBJ_NAME = 'Smartform_to_PDF'.
      WA_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10.
      WA_DOC_CHNG-OBJ_DESCR = 'Smartform to PDF'.
      WA_DOC_CHNG-SENSITIVTY = 'F'.
      WA_DOC_CHNG-DOC_SIZE = STRLEN( I_OBJTXT ) + ( ( V_LINES_TXT - 1 ) * 255 ) .
      CLEAR  I_OBJPACK-TRANSF_BIN.
      I_OBJPACK-HEAD_START = 1.
      I_OBJPACK-HEAD_NUM = 0.
      I_OBJPACK-BODY_START = 1.
      I_OBJPACK-BODY_NUM = V_LINES_TXT.
      I_OBJPACK-DOC_TYPE = 'RAW'.
      APPEND I_OBJPACK.
      I_OBJPACK-TRANSF_BIN = 'X'.
      I_OBJPACK-HEAD_START = 1.
      I_OBJPACK-HEAD_NUM = 1.
      I_OBJPACK-BODY_START = 1.
      DESCRIBE TABLE I_OBJBIN LINES V_LINES_BIN.
      READ TABLE I_OBJBIN INDEX V_LINES_BIN.
      I_OBJPACK-DOC_SIZE = V_LINES_BIN * 255 .
      I_OBJPACK-BODY_NUM = V_LINES_BIN.
      I_OBJPACK-DOC_TYPE = 'PDF'.
      I_OBJPACK-OBJ_NAME = 'ATTACHMENT'.
      I_OBJPACK-OBJ_DESCR = 'test'.
      APPEND I_OBJPACK.
      CLEAR I_RECLIST.
      I_RECLIST-RECEIVER = 'my email address u2019.
      I_RECLIST-REC_TYPE = 'U'.
      APPEND I_RECLIST.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          DOCUMENT_DATA              = WA_DOC_CHNG
          PUT_IN_OUTBOX              = 'X'
          COMMIT_WORK                = 'X'
        TABLES
          PACKING_LIST               = I_OBJPACK
          OBJECT_HEADER              = WA_OBJHEAD
          CONTENTS_BIN               = I_OBJBIN
          CONTENTS_TXT               = I_OBJTXT
          RECEIVERS                  = I_RECLIST
        EXCEPTIONS
          TOO_MANY_RECEIVERS         = 1
          DOCUMENT_NOT_SENT          = 2
          DOCUMENT_TYPE_NOT_EXIST    = 3
          OPERATION_NO_AUTHORIZATION = 4
          PARAMETER_ERROR            = 5
          X_ERROR                    = 6
          ENQUEUE_ERROR              = 7
          OTHERS                     = 8.
      IF SY-SUBRC <> 0.
        WRITE:/ 'Error ', SY-SUBRC.
      ELSE.
        WRITE:/ 'Mail sent'.
      ENDIF.

    Hi rohitha.wijewardena ,
    Please find the below code which i followed and succeed ,
    CALL FUNCTION 'WFMC_PREPARE_SMART_FORM'
        EXPORTING
          pi_nast       = nast
          pi_country    = lv_dlv-land
          pi_addr_key   = lv_addr_key
          pi_repid      = sy-repid
          pi_screen     = lc_x
        IMPORTING
          pe_returncode = gv_retcode
          pe_itcpo      = lv_itcpo
          pe_device     = lv_device
          pe_recipient  = lv_recipient
          pe_sender     = lv_sender.
      IF gv_retcode = 0.
    *moving the data to composer and control parameters for output
        MOVE-CORRESPONDING lv_itcpo TO lv_composer_param.
        lv_control_param-device      = lv_device.
        lv_control_param-no_dialog   = lc_x.
        lv_control_param-preview     = lc_x.
        lv_control_param-getotf      = lv_itcpo-tdgetotf.
        lv_control_param-langu       = nast-spras.
        lv_composer_param-tdnoprint = space.
      ENDIF.
    *Getting the Smartform Function module using Standard Function module
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname                 = lv_formname           "Smartform Name
       IMPORTING
         fm_name                  = lv_fm_name
       EXCEPTIONS
         no_form                  = 1
         no_function_module       = 2
         OTHERS                   = 3
      IF sy-subrc <> 0.
        gv_retcode = sy-subrc.
        PERFORM protocol_update.
        PERFORM add_smfrm_prot.
      ENDIF.
    **Smartform function module to get the output
      CALL FUNCTION lv_fm_name
        EXPORTING
       control_parameters         = lv_control_param
       mail_recipient             = lv_recipient
       mail_sender                = lv_sender
         output_options             = lv_composer_param
         user_settings              = ' '
          is_bil_invoice             = lv_bil_invoice
          gt_header                  = gt_header
       IMPORTING
         job_output_info            = gv_job_output
        TABLES
          gt_item                    = gt_item
       EXCEPTIONS
         formatting_error           = 1
         internal_error             = 2
         send_error                 = 3
         user_canceled              = 4
         OTHERS                     = 5
      IF sy-subrc <> 0.
        gv_retcode = sy-subrc.
        PERFORM protocol_update.
        PERFORM add_smfrm_prot.
      ENDIF.
      IF nast-nacha = lc_mail.
        gt_otfdata[] = gv_job_output-otfdata[].
    *           Converting Smartform to PDF                          *
        CALL FUNCTION 'CONVERT_OTF'
          EXPORTING
            format                = lc_pdf
            max_linewidth         = 10
          IMPORTING
            bin_filesize          = gv_binfilesize
            bin_file              = gv_pdf_xstring
          TABLES
            otf                   = gt_otfdata[]
            lines                 = gt_pdftab[]
          EXCEPTIONS
            err_max_linewidth     = 1
            err_format            = 2
            err_conv_not_possible = 3
            err_bad_otf           = 4
            OTHERS                = 5.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    *           Sending PDF to Email  using Class                     *
        IF NOT lv_email IS INITIAL .
          TRY.
             gv_send_request = cl_bcs=>create_persistent( ).
              gv_pdf_content = cl_document_bcs=>xstring_to_solix( gv_pdf_xstring ).
              gv_document = cl_document_bcs=>create_document(
                    i_type    = lc_pdf
                    i_hex     = gv_pdf_content
                    i_length  = gv_pdf_size
                    i_subject = lc_subject ).            "Subject for Email
              gv_send_request->set_document( gv_document ).
             gv_recipient = cl_cam_address_bcs=>create_internet_address( lv_email ).
              gv_send_request->add_recipient( gv_recipient ).
              gv_sent_to_all = gv_send_request->send( i_with_error_screen = lc_x ).
              COMMIT WORK.
              IF gv_sent_to_all IS INITIAL.
                MESSAGE i500(sbcoms) WITH lv_email.
              ELSE.
                MESSAGE s022(so).
              ENDIF.
            CATCH cx_bcs INTO gv_bcs_exception.
              MESSAGE i865(so) WITH gv_bcs_exception->error_type.
          ENDTRY.
        ENDIF.

  • Export Crystal Report to PDF

    Hi,
    in my Crystal Report (2008) is a chart, designed with Xcelsius 2008. The report is displayed well. When I export my Flash-Chart from Xcelsius to PDF the chart is displayed correctly in PDF document.
    When I export the Crystal Report to PDF my Flash-Chart is displayed completley grey in PDF document. There is the same issue when I schedule my Crystal Report to PDF on BO Edge-Server.
    Is this a known issue and can be fixed?

    I am bringing this subject back up because I am still having problems with this.  I am using CR 2008, Xcelsius 2008 and Edge 3.1 Enterprise Server along with a Visual Basic 2005 program.  I have Adobe Reader 9 loaded on both my local machine and the server where Edge is installed.
    I have a report that is passing flash variables to an embedded .swf file which is a pretty simple horizontal stacked bar chart.  When I view this report in CR on my local machine everything on the report is correct and I can print it to PDF and it is correct when I view it with Adobe Reader.  I can also print the report to a printer and get the desired result which is the most important thing here.
    My next step is saving the report to the Enterprise server.  I then run my Winform Visual Basic program that passes the paramters to the report and schedules it to run on the server.  The report runs fine and we access it with InfoView.  Again the report looks fine because when we open it, it opens with Adobe Reader on the server.  The problem is when we try to print this instance of the report from the server the chart keeps doubling up the stacked bars so there are two of them instead of the one.
    Does anybody have any ideas????
    Thank you in advance.
    My problem comes

  • 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

  • Unable to display Crystal Reports 2008 PDF output on smart phones

    Hi Folks,
    I'm not sure if this is the proper forum, but here goes. I am just finishing a large ASP.NET web app which makes extensive use of Crystal Reports 2008 and a CrystalReportViewer control.  My users routinely e-mail the reports in PDF format. This works great, except now they tell me that when the recipient of the e-mail tries to open the PDF on an iPhone or Blackberry, it will not open. The PDF's open fine on desktop computers.
    Here is the code which generates the PDF and attaches it to the e-mail msg.
    //  export to PDF, then mail that
    SmtpClient client = new SmtpClient();
    MailAddress from = new MailAddress(ConfigurationManager.AppSettings["ReportMailFrom"].ToString());
    MailMessage message = new MailMessage();
    message.From = from;
    message.SubjectEncoding = System.Text.Encoding.UTF8;
    message.Subject = "E-mail BackOffice report: " + strReportName;
    MemoryStream memStream = (MemoryStream)rptDoc.ExportToStream(ExportFormatType.PortableDocFormat);
    Attachment data = new Attachment(memStream, MediaTypeNames.Application.Pdf);
    ContentDisposition disposition = data.ContentDisposition;
    disposition.CreationDate = DateTime.Now;
    disposition.ModificationDate = DateTime.Now;
    disposition.FileName = strReportName + ".pdf";
    disposition.DispositionType = DispositionTypeNames.Attachment;
    message.Attachments.Add(data);
    client.Send(message);
    Any ideas on what is happening here and how to make these PDF's visible to smart phones?
    Thanks.
    Dan

    Hi Dan,
    What happens if you export from Crystal Reports designer?
    I just tried if and BlackBerry tells me I am about to download a file that cannot be viewed on the phone. It doesn't say why though.
    Going through the Platforms file it doesn't mention smart phones so it would indicate we don't support them in that format.
    HTML worked but not pretty. You'll have to see what Blackberry does support. I found this one kbase article from them:
    http://www.blackberry.com/btsc/search.do?cmd=displayKC&docType=kc&externalId=KB11245&sliceId=SAL_Public&dialogID=206744335&stateId=1%200%20206742756
    I'm testing more but I believe this is a blackberry limit and not CR.
    Seems they do support it but very limited.
    Thank you
    Don

  • How to convert sap script to pdf and send it as email attachment

    hi,
    my requirement is to convert a standard sales order form to pdf and send it as email attachment. get me some sample code for the same
    thanks in advance

    Hi
    See this sample code and after that use the fun module to send the mail
    SO_NEW_DOCUMENT_ATT_SEND_API1
    REPORT zzz_jaytest .
    Types Declaration
    TYPES : BEGIN OF ty_pa0001,
    pernr TYPE pa0001-pernr,
    bukrs TYPE pa0001-bukrs,
    werks TYPE pa0001-werks,
    END OF ty_pa0001.
    Internal Table Declaration
    DATA : i_pa0001 TYPE STANDARD TABLE OF ty_pa0001, "For pa0001 Details
    i_otf TYPE STANDARD TABLE OF itcoo, "For OTF data
    i_content_txt TYPE soli_tab, "Content
    i_content_bin TYPE solix_tab, "Content
    i_objhead TYPE soli_tab,
    Work Area Declaration
    w_pa0001 TYPE ty_pa0001, "For pa0001 Details
    w_res TYPE itcpp, "SAPscript output
    "parameters
    w_otf TYPE itcoo, "For OTF
    w_pdf TYPE solisti1, "For PDF
    w_transfer_bin TYPE sx_boolean, "Content
    w_options TYPE itcpo, "SAPscript output
    "interface
    Variable Declaration
    v_len_in TYPE so_obj_len,
    v_size TYPE i.
    Constants Declaration
    CONSTANTS : c_x TYPE c VALUE 'X', "X
    c_locl(4) TYPE c VALUE 'LOCL', "Local Printer
    c_otf TYPE sx_format VALUE 'OTF', "OTF
    c_pdf TYPE sx_format VALUE 'PDF', "PDF
    c_printer TYPE sx_devtype VALUE 'PRINTER', "PRINTER
    c_bin TYPE char10 VALUE 'BIN', "BIN
    c_name TYPE string VALUE 'C:\ZZZ_JAYTEST.PDF',"Downloading
    "File Name
    c_form(11) TYPE c VALUE 'ZZZ_JAYTEST'. "Form Name
    START-OF-SELECTION.
    Selecting the records from pa0001
    SELECT pernr bukrs werks FROM pa0001
    INTO TABLE i_pa0001 UP TO 10 ROWS.
    Setting the options
    w_options-tdcopies = 1 ."Number of copies
    w_options-tdnoprev = c_x."No print preview
    w_options-tdgetotf = c_x."Return of OTF table
    w_options-tddest = c_locl."Spool: Output device
    Opening the form
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
    form = c_form
    device = c_printer
    language = sy-langu
    OPTIONS = w_options
    IMPORTING
    RESULT = w_res.
    LOOP AT i_pa0001 INTO w_pa0001.
    Writting into the form
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    element = 'MAIN'
    window = 'MAIN'.
    ENDLOOP.
    Closing the form
    CALL FUNCTION 'CLOSE_FORM'
    IMPORTING
    RESULT = w_res
    TABLES
    otfdata = i_otf
    EXCEPTIONS
    unopened = 1
    bad_pageformat_for_print = 2
    send_error = 3
    spool_error = 4
    codepage = 5
    OTHERS = 6.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Converting OTF data to single line
    LOOP AT i_otf INTO w_otf.
    CONCATENATE w_otf-tdprintcom w_otf-tdprintpar
    INTO w_pdf.
    APPEND w_pdf TO i_content_txt.
    ENDLOOP.
    Converting to PDF Format
    CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
    EXPORTING
    format_src = c_otf
    format_dst = c_pdf
    devtype = c_printer
    CHANGING
    transfer_bin = w_transfer_bin
    content_txt = i_content_txt
    content_bin = i_content_bin
    objhead = i_objhead
    len = v_len_in
    EXCEPTIONS
    err_conv_failed = 1
    OTHERS = 2.
    v_size = v_len_in.
    Downloading the PDF File
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    bin_filesize = v_size
    filename = c_name
    filetype = c_bin
    TABLES
    data_tab = i_content_bin.
    If you r using this function module check it once....
    call function 'CONVERT_OTF'
    EXPORTING
    format = 'PDF'
    max_linewidth = 132
    IMPORTING
    bin_filesize = v_len_in
    TABLES
    otf = i_otf
    lines = i_tline
    EXCEPTIONS
    err_max_linewidth = 1
    err_format = 2
    err_conv_not_possible = 3
    others = 4.
    Fehlerhandling
    if sy-subrc <> 0.
    endif.
    or u can use the standard program RSTXPDFT4 to download the script into PDF format onto a particular location
    follow this link for sample program.
    http://searchsap.techtarget.com/tip/0,289483,sid21_gci1121833,00.html
    check...
    How to send smart form via email
    /people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp
    Regards
    Anji

  • Regarding Crystal report  parameter from and to.

    hi.
    I am having one requirement ie.
    Normally we are giving..i.e
    We are using parameter in Sap b1 like Docentry
    Based on this one Docentry the data will fetch from the data base and it will shows into the sap crystal reprot
    suppose Ex Docentry = 3 then it will show the data.. then
    but ring now what i nee dis  Docentry from and to
    fromdocentry = 1
    todocentry  = 5
    so, 1,2,3,4,5 five documents should be generate one by one in crystal report in single crystal report not 5 pdf files single pdf should have 5 doc entries
    Is it possible how can i do it.
    how can i do it...

    Hi
    I think it is not possible from Crystal Report but below discussion indicates it is possible through some Crystal Report SDK tool.
    Exporting a Crystal Reports file into multiple PDF's
    How to export a crystal report into several pdf files then email them to several email addresses
    With Regards
    Balaji Sampath

  • Exporting 'drillable' Crystal Reports

    I have produced some 'drillable' Crystal Reports that I can export as Crystal Reports.
    We would like to distribute these reports to wide audience so I've looked at exporting these as PDF but when I do the report is no longer 'drillable', is there a way around this?
    I believe that there is a free Crystal Reports viewer that we could distribute to those receivieng this report but is this the best option for handling this if we need to export and distribute this report as a Crystal Report?

    You can use Crystal Reports Server - or Enterprise to distribute the reports but exporting to other formats does not mean that those applications automatically inherit Crystal functionality (drill-down for example).
    As for 3rd party tools that would be up to you to research.

  • Creating pdf and attaching to email

    Hello,
    I am trying to write a script to help manual work and am stuck at below point:
    When click save in SAP I get pdf document generated (nhremote). What I would like to do is to somehow automatically save it on my drive and attach it in the new email that is generated after each save.
    Script end:
    'session.findById("wnd[1]/usr/btnSPOP-VAROPTION1").press - SAVING the changes and pdf is generated at this point. takes some time to popup.
    'Set MyApp = CreateObject("Outlook.Application") 
    'Set MyItem = MyApp.CreateItem(0) 'olMailItem 
    'With MyItem 
      '.To = "[email protected]"
      '.Subject = "Subject"
      '.ReadReceiptRequested = False
      '.HTMLBody = RDD
    'End With 
    'MyItem.Display
    is there any way I can put action to save and attach saved file to the email? Also please keep in mind that the script is looped and it does this for many documents. Since NHREMOTE to generate pdf usually takes sometime and is a popup window I'm afraid it can be very complicated and mess up easily.

    Hello Gediminas,
    try this:
    '-Begin-----------------------------------------------------------------
      '-Directives----------------------------------------------------------
        Option Explicit
      '-Variables-----------------------------------------------------------
        Dim application, SapGuiAuto, connection, session, RepName
        Dim WScr, MyApp, MyItem, FileName
      '-Main----------------------------------------------------------------
        If Not IsObject(application) Then
          Set SapGuiAuto = GetObject("SAPGUI")
          Set application = SapGuiAuto.GetScriptingEngine
        End If
        If Not IsObject(connection) Then
          Set connection = application.Children(0)
        End If
        If Not IsObject(session) Then
          Set session = connection.Children(1)
        End If
        If IsObject(WScript) Then
          WScript.ConnectObject session, "on"
          WScript.ConnectObject application, "on"
        End If
        Set WScr = CreateObject("WScript.Shell")
        If IsObject(WScr) Then
          RepName = "PROGDELE"
          FileName = "C:\Schnell\Dummy\" & RepName & ".pdf"
          session.findById("wnd[0]/tbar[0]/okcd").text = "/nSE38"
          session.findById("wnd[0]/tbar[0]/btn[0]").press
          session.findById("wnd[0]/usr/ctxtRS38M-PROGRAMM").text = RepName
          session.findById("wnd[0]/usr/btnSHOP").press
          WScript.Sleep 500
          WScr.AppActivate "ABAP Editor: Report " & RepName & " anzeigen"
          WScript.Sleep 2000
          session.findById("wnd[0]/usr/cntlEDITOR/shellcont/shell").SetFocus()
          WScr.SendKeys "+{F5}" 'Customize Shift+F5 to File.ExportPDF
          WScript.Sleep 250
          wscr.SendKeys FileName
          WScript.Sleep 250
          wscr.SendKeys "{ENTER}"
          WScript.Sleep 1000
          Set MyApp = CreateObject("Outlook.Application")
          If IsObject(MyApp) Then
            Set MyItem = MyApp.CreateItem(0)
            With MyItem
              .To = "[email protected]"
              .Subject = "Subject"
              .ReadReceiptRequested = False
              .Body = "Here comes the file"
              .Attachments.Add FileName
            End With
            MyItem.Display
            'MyItem.Send
            Set MyItem = Nothing
            Set MyApp = Nothing
          End If
          Set WScr = Nothing
        End If
    '-End-------------------------------------------------------------------
    This script starts the TAC SE38 and loads the Report PROGDELE. It exports the report as PDF and sends the PDF file via e-mail to hugo.bambi.
    All you have to do, to try this script, is to customize your SE38 view, that the shortcut Shift+F5 ist set to File.ExportPDF.
    You see, it is possible to save a PDF from SAP and to send it as e-mail attachment . Also you see it is possible to handle SAP dialog windows. And it should be not a great problem to do this steps in loop for more than one document.
    Let us know your result.
    Cheers
    Stefan

  • Open Crystal Report in PDF

    Hi
    If I open the Crystal Report in PDF using the below code using weblogic 8.1
    ReportExportControl exportControl = new ReportExportControl();
    Object reportSource = session.getAttribute("reportSource");
    exportControl.setReportSource(reportSource);
    ExportOptions exportOptions = new ExportOptions();
    exportControl.setExportOptions(exportOptions);
    exportControl.setExportAsAttachment(true);
    exportControl.setOwnForm(true);
    exportControl.setOwnPage(true);
    exportOptions.setExportFormatType(ReportExportFormat.PDF);
    I get the following error and the server shuts down.
    An unexpected error has been detected by HotSpot Virtual Machine:
    EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x060d9bea, pid=604, tid=1392
    Java VM: Java HotSpot(TM) Client VM (1.4.2_13-b06 mixed mode)
    Problematic frame:
    C  [awt.dll+0x69bea]
    Please help on this issue
    Regards
    kaspick

    That's not Crystal.  That's your web app server trying to load the Java JVM AWT library, and crashing when it can't.
    Sincerely,
    Ted Ueda

  • Report exported in Crystal Reports 9 won't work in Crystal Reports XI R2

    Hello,
    I have a .NET client that has been using Crystal Reports 9 for some time to generate reports and then exporting them to Crystal Reports format (.rpt), and saving the report including the data so that the user can open it at a later time and preview/print. This has been working fine so far.
    Now we're in the process of updating our system to Crystal Reports XI R2. When a user selects an old report (that was originally created in CR9) to preview, CR XI prompts the user to submit a value for a string parameter that was originally submitted to the report when it was generated in CR9 but the value was set as either Nothing or the empty string. If we try to print the report then CR XI throws this error (probably because of the same parameter):
    CrystalDecisions.CrystalReports.Engine.ParameterFieldCurrentValueException: Missing parameter values. ---> System.Runtime.InteropServices.COMException (0x8004100E): Missing parameter values.
    at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.GetLastPageNumber(RequestContext pRequestContext)
    at CrystalDecisions.ReportSource.EromReportSourceBase.GetLastPageNumber(ReportPageRequestContext reqContext)
    --- End of inner exception stack trace ---
    at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
    at CrystalDecisions.ReportSource.EromReportSourceBase.HandleException(Exception exception)
    at CrystalDecisions.ReportSource.EromReportSourceBase.GetLastPageNumber(ReportPageRequestContext reqContext)
    at CrystalDecisions.CrystalReports.Engine.FormatEngine.PrintToPrinter(Int32 nCopies, Boolean collated, Int32 startPageN, Int32 endPageN)
    at CrystalDecisions.CrystalReports.Engine.ReportDocument.PrintToPrinter(Int32 nCopies, Boolean collated, Int32 startPageN, Int32 endPageN)
    Is there a solution to this? I've tried to submit a value to the parameter in code and then exporting the report again but that doesn't work. Any help appreciated.

    Hello,
    Currently the FP is not available from our public site, it should be soon though.
    Here's a link to get to our download page. If it asks please agree to download the authentication certificate.
    https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/bobj_download/main.htm
    Thank you and sorry for the delay.

Maybe you are looking for

  • How to bind an aggregated list to a variable in an IN or ANY clause

    Hello, and thank you for helping - I have a process that involves a parameter assertion, the result of which is a string for an IN or ANY clause. I am not able to figure out how to bind the result of the assertion to to executable SQL. The actual bus

  • HP Mini 210-1000sa Track Pad Problem

    I've just bought a HP Mini 210-1000sa and I'm finding the Track pad truely AWFUL to use - not at all up to the usual HP high quality. As the left and right buttons are part of the track pad "sensitive" area, when you use one finger to position the cu

  • Report for Reject NON-PO Invoice

    Hi All, We have implemented workflow for Non- PO inovice and creating documents thru FV60.. Now we want to have a report which will provide the list of documents which are in Rejected status (Work Item has been rejected by approver.). Please advice i

  • Can InDesign CS4 files be saved down to CS3

    Can anyone confirm if InDesign CS4 files can be saved down to CS3. I need to be able to share editing of InDesign files with user on different version. Seems okay to open up a version, but then can not open file back down a version? Thanks

  • You see, all my application defined classes are declared in the 'main' clas

    hi there, class MainClass class other1; class other2; public void main(...) other1 needs other2, other2 needs other3 and so on.., so you see, for instance i'm inside other2's function, from within, i need to use other1 ie, class other1 public void af