Crystal Reports XI PDF Export Options

Can someone point me to a list of the ExportOptions for a PDF?  I'm trying to print a report and export it to a PDF and I'm running into the "page header and page footer too big for the page" error.  I'm able to generate the printout fine, but the PDF is giving me the error.  Code is wrriten in Progress 4GL.
An additional question that has me even more perplexed.  This code generates the printout correctly on one server but no PC, and on my PC it generates the PDF but not the printout.  Any ideas on that one?
   IF SEARCH(cStartDirectory + "BOLTEST.rpt") EQ ? THEN DO:
      MESSAGE "Could not find report: " + cStartDirectory + "BOLTEST.rpt".
      RETURN (FALSE).
   END.
   chCrystalRep = chCrystalApp:OpenReport(cStartDirectory + "BOLTEST.rpt",1).
   /* Generate PDF */
   chCrystalRep:ExportOptions:DestinationType = 1.
   chCrystalRep:ExportOptions:DiskFileName = cExportLoc + "boltest.pdf".
   chCrystalRep:ExportOptions:FormatType = 31.
   chCrystalRep:ExportOptions:PDFExportAllPages = TRUE.
   chCrystalRep:DisplayProgressDialog = TRUE.
   chCrystalRep:EXPORT(FALSE).
   /* Print Copy */
   chCrystalRep:SelectPrinter(cDriverName, cPrinterName, cPort).
   chCrystalRep:PrintOut(FALSE).
   RETURN(TRUE).
END FUNCTION.

Digging through the forums, I found this little guy:
Change default printer in CrystalReportViewer:
Re: Change default printer in CrystalReportViewer
It's not quite what answering my problem, but I suspect the issue here is the same one I'm having.  Originally designed a report on a printer, and when it tries to print on another PC (or a server), it grabs the default printer instead of the same printer I designed it on.  The printer I designed this using is a default printer for the entire company so every PC and server has it installed on there.
Any thoughts?

Similar Messages

  • 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

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

  • 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

  • Vista/Adobe 9/sql image Error in Crystal Report:Failed to Export the Report

    When I try to export my Crystal Report (v2008) from a Vista machine (using Crystal RDC export methods) as a PDF, I get the following error:
    Error in Crystal Report:  Failed to export the report.
    This only happens when a particular subreport (that contains a sql image) prints (based on an input parameter).  We have other subreports (within this same report) that print a sql image just fine.  But, when this subreport prints, the above error appears.
    I can run the same report on an XP machine without error.
    Exportmodeller.dll and crtsv.dll are both installed and registered to the
    C:\Program Files\Common Files\Business Objects\3.0\bin folder
    I have tried opening the report, removing the image, and then adding it back in again to the subreport.
    Still receive the same error.
    Any suggestions?

    >
    Don Williams wrote:
    > RDC is no longer shipped in CR 2008. You are using the embedded designer used within the Visual Studio .NET IDE and is not licensed for distribution.
    >
    > Upgrade to the .NET components and post your question to the .NET forums.
    >
    > Also, those old dll's will not work in CR 2008. Last patches will give you the option to export to Excel in Legacy mode. We built it into our export dll.
    Don,
    Can you please clarify?
    Our VB6 app that uses Crystal XI RDC runtime components.  Our Crystal reports are edited in CR2008 SP1 developer edition (not through the VB.NET embedded report designer).  We have deployed the CRXIRelease 2 runtime components (via the merge module) to our client machines in order to execute the RDC.
    We can print/preview/export to excel, but the pdf creation is failing with this error.
    We are only using the RDC (which we know is no longer supported) because of huge issues with the Crystal for .NET methods we are having with our customers (I have an active case for this issue).  Therefore, we have to rollback our .NET product and revert to the RDC code. 
    Vista is failing to create a PDF for a report developed in the CR2008 SP1 developer edition when using the RDC.
    When you say  "Also, those old dll's will not work in CR 2008. Last patches will give you the option to export to Excel in Legacy mode. We built it into our export dll.", what do you mean by "will not work in CR2008"?
    Thank you

  • Crystal Reports 2008 Excel Export Compatibility Patch - second attempt :)

    Hello, I actually have a question related to the following thread, so I posted there and was recommended to start a new thread:
    Crystal Reports 2008 Excel Export Compatibility Patch?
    Question is related to the following doc, specifically, is this patch still available for CR 2008 or not?:
    http://help.sap.com/businessobject/product_guides/cr2008V1/en/xi3_cr2008eecp_readme_en.pdf
    A response from Don suggested this wasnt available for CR 2008 although this is confusing since the doc refers to CR 2008. My response was as follows and is essentially the question I still have (more so because we have another PeopleSoft/Oracle customer whos come across this doc and wants to know how to apply the fix for CR 2008). Thanks very much in advance!
    Hi Don, I know this is an old thread, but Im also running into the same issue and am confused by your statement since the referenced PDF doc says this patch is available for CR 2008. Did you mean that the patch is no longer available or supported for CR 2008 for some reason? If so, any idea why?
    Im a developer for Oracle/PeopleSoft and our PeopleSoft suite includes OEM Crystal. We recently upgraded to CR 2008 for our latest release and we are getting the same complaint from a few customers about not being able to output the XLS in Excel 8.0 compatiibility mode like before (In Crystal 9, we used the \Export\Excel\CompatVersion=80 registry key to enable this). So if this patch is available, it would be a huge benefit for us to be able to point our customers to it. If not, please still let me know eitherway.
    Thanks very much!
    Andrew

    Hi Andrew,
    So the story is the Rubik's patch has been available from CR 9 up until CR XI R1 as a simple download. In R2 and above to get it you have to log a case, work with a Report Rep to try to design your reports so they use the new export dll. To get you by until you have time to do so, and after filling out a query for the PM to get info on how to possibly improve the updated export dll to meet your needs, he will then send you the patch on the agreement that this is the LAST time you ask for it.
    Support no longer has access to the patch so all requests must go through the Program Manager who keeps tract of who received it.
    Bottom line is you need to update the reports to use the new export model.
    That old legacy dll was bugging and impossible to maintain.
    You can [purchase a support case here|http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=54722300].
    This is not a bug and has been this way for 10 years now, time to update your export model and Excel Macro's....
    Thank you for your understanding
    Don

  • 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

  • Handling page breaks in Crystal Reports XI when exporting to Excel

    We generate reports in Crystal Reports and programmatically export them to Excel for our end users, so the user receives both an .rpt and .xls version.  We are upgrading from Crystal 8.5 to Crystal XI and have found with some of our reports that the page breaks in Excel are different in Crystal XI than in 8.5.  The first page will fill to the end and then the next page will contain a few lines of data, the next will be full and the next will contains a few lines.  Viewing the Excel page breaks, there are soft breaks before the short pages and hard breaks before the long pages.  It's as if there is too much data defined for each page so it spills onto the next page before creating another hard page break.  In Crystal 8.5, the paging was continuous as expected.  Is there any way to fix this in Crystal XI?

    Please note, this forum is dedicated to topics related to legacy SDKs, including the Report Designer Component (RDC), OCX, VCL, and Crystal Reports Print Engine (CRPE).
    As the issue you are encountering is in the CR designer, please post your query to the Crystal Reports Design forum at:
    SAP Crystal Reports
    I'd also suggest adding more detail to your query; version of Crystal Reports used, is this an upgrade issue, new report issue, etc., etc.
    Thank you for your understanding,
    Ludek

  • Export Crystal Report to PDF only

    Hi,
    I'm new to Crystal Report(CR) for VS2010, so please bear with me. How do i make CR to export to PDF file only. When i try to click on the export icon, it gives me so many options to export the file but i only need the user to export to PDF file. Any help is greatly appreciated.

    Hello,
    CR for VS 2010 now gives you the options through an API to allow which types will show up in the export options.
    In your viewer click event add this :
    private void ViewReport_Click(object sender, EventArgs e)
        rptClientDoc = rpt.ReportClientDocument;
        crystalReportViewer1.ReportSource = rpt;
        // set up the format export types:
        // to set each type allowed
        //int myFOpts = (int)(CrystalDecisions.Shared.ViewerExportFormats.RptFormat | CrystalDecisions.Shared.ViewerExportFormats.PdfFormat | CrystalDecisions.Shared.ViewerExportFormats.RptrFormat | CrystalDecisions.Shared.ViewerExportFormats.XLSXFormat );
        // to set all types allowed
        int myFOpts = (int)(CrystalDecisions.Shared.ViewerExportFormats.AllFormats);
        crystalReportViewer1.AllowedExportFormats = myFOpts;
    Thank you
    Don

  • Exporting Crystal reports to PDF from VB - Hmmmm doozy

    Post Author: shiniz
    CA Forum: Integrated Solutions
    Hello,
    I'm currently exporting successfully to PDF from crystal reports 10 to PDF using options:
    Report.ExportOptions.FormatType = crEFTPortableDocFormat
    Report.Export(False)
    All is well but I would like the PDF I export to be mono colour (ie black and white) not greyscale.
    Is there an option I am missing? or is this a question I should raise on a VB forum...
    Thanks for any suggestion..

    This problem cleared up when I re-saved my main report after editing the embedded sub-reports. Was related to extra headers and footers being added to sub-reports, along with "can grow" format option set to "No".

  • Exporting Crystal Report to pdf

    Hi,
    We have a crystal report that is stored in Business Objects Enterprise XI 3.1. The requirement is to connect to the Enterprise and export the report as pdf in .NET web page. I see a lot of RAS samples. But we are required to use the Business Objects Enterprise sdk dlls for this purpose.
    Can somebody provide me a sample for this.
    Thanks
    Irene

    Hi Adam,
    Yes I am trying to use the Page Server option of RAS to open the report. That is only one working due to firewall restrictions.
    But I was trying to set the report parameters in the report Object and assumed that it should be reflected when opening the report. But that does not seem to work. So now what I did is,  I tried to set the report source to report viewer control and change the parameters through code.
            boEnterpriseService = boEnterpriseSession.GetService("PSReportFactory");
            boReportAppFactory = (PSReportFactory)boEnterpriseService.Interface;
            ISCRReportSource objRep = boReportAppFactory.OpenReportSource(boInfoObject.ID);
            CrystalReportViewer1.ReportSource = objRep;
            CrystalDecisions.Shared.ParameterFields  objFields = CrystalReportViewer1.ParameterFieldInfo;
            CrystalDecisions.Shared.ParameterDiscreteValue objDis = new CrystalDecisions.Shared.ParameterDiscreteValue();
            objDis.Value = "Product Category";
            objFields[0].CurrentValues.Clear();
            objFields[0].CurrentValues.Add(objDis);
            CrystalReportViewer1.ShowFirstPage();
    So the report shown in the viewer is opened with the parameters specified. But now I have the problem of exporting. I need to export this report with the parameters specified in code to pdf.
    What are the options. I tried using the CrystalDecisions.CrystalReports.Engine.ReportDocument so I can do the export but am getting Communication Failure:FWM 0001.
    Is there any way of directly exporting the report from the viewer without user intervention ?
    Thanks
    Irene

  • No link to the local .avi files after exporting Crystal report as .pdf

    Hello all,
    The overall scenario is like-
    My application fires a query on SQL Server database and result of that query is stored in a Dataset. This dataset is set as a datasource to the Crystal report.  Now some, records (returned by the query) have .avi files(i.e. Event Videos which are stored on the local hard disk) associated with them. I have stored these .avi files in a specific path on local Hard disk say "C:/EventVideos/*.avi" .   I used a special format in these avi files name. (like - "EventVideo_1.avi" (This is for 1st event), "EventVideo_5.avi" (This is for 5th event)etc. to identify which avi is for which event. All events do not have avi files associated with them)
          Now, I take one Text Object in crystal report. Using it's Format editor created a formula for hyperlink as -
          "file:///c:/EventVideos/EventVideo_" + {DataTable1.EventID} + ".avi" .
    EventID is the field of dataset which has ID's (like 0, 1, 2,  3, 4 etc) of all resulted events. It is of a String data type.
         Now when I export, my report as .xls, .rtf, .doc, I can open the avi files. When I bring cursor on this Text Object, cursor get change to Hand and after click on it avi file start to play.
         But if I export it as .pdf, it does not contain the link for avi files. When I bring cursor on this Text Object , it does not change to Hand, and after click on it nothing happens. No video play.
    I stick to this problem. What should be done in this case?
    Appreciate your help.
    Thanks in advance.

    duplicate - please do not post multiple times

  • No link after exporting Crystal report as pdf file

    Hello,
              If my Crystal Report contain link to the .avi file saved on the local hard disk and if I export the Report as .pdf file, pdf file does not contain that link. Why?
    The overall scenario is like-
    My application fires a query on SQL Server database and result of that query is stored in a Dataset. This dataset is set as a datasource to the Crystal report.  Now some, records (returned by the query) have .avi files(i.e. Event Videos which are stored on the local hard disk) associated with them. I have stored these .avi files in a specific path on local Hard disk say "C:/EventVideos/*.avi" .   I used a special format in these avi files name. (like - "EventVideo_1.avi" (This is for 1st event), "EventVideo_5.avi" (This is for 5th event)etc. to identify which avi is for which event. All events do not have avi files associated with them)
          Now, I take one object in crystal report. Using it's Format editor created a formula for hyperlink as -
          "file:///c:/EventVideos/EventVideo_" + {DataTable1.EventID} + ".avi" .
    EventID is the field of dataset which has ID's (like 0, 1, 2,  3, 4 etc) of all resulted events. It is of a String data type.
         Now when I export, my report as .xls, .rtf, .doc, I can open the avi files. When I bring cursor on this object, cursor get change to Hand and after click on it avi file start to play.
         But if I export it as .pdf, it does not contain the link for avi files. When I bring cursor on this object, it does not change to Hand, and after click on it nothing happens. No video play.
    I stick to this problem.
    Appreciate your help.
    Thanks in advance.

    Taken from CR Help File:
    "PDF format is a page-based format. The exported documents are intended for printing and redistribution. PDF format will export both layout and formatting in a manner that is consistent with how the report looks on the Preview tab. PDF format embeds the TrueType fonts that appear in the document. (Non-TrueType fonts are not supported.) This export format does not support Microsoft font-linking technologyu2014which is used to provide support for some extended character sets such as Chinese HKCS. Therefore, the fonts used in the report must contain all of the required glyphs. These URI types are supported for hyperlinks: "http:", "https:" and "mailto:".
    Therefore your hyperlink is not working as u are using File type when cr only supports http https and mailto uri types

  • Is it be true to say a good and not corrupted crystal report always has the option to generate a PDF when click the printer icon on the Crystal toolbar ?

    ''please stick with your original questions thread about Crystal Report - https://support.mozilla.org/en-US/questions/970077 - locking this thread''l
    When i unistall and again install a fresh Crystal report for .Net 4.0 Its ok to generate only to pdf option when click to the print icon on crystal report viewer but in another computer it is promting the old fasion like "a dialog with many option" ,But if want to have a only option to generate only to pdf option what should i have to do when my project and crystal report is at Window server 2008 R2,Please suggest a requred answer?

    Firefox will update in increments when you use such old versions. The best thing to do is to go to www.getfirefox.com, and download Firefox 19.0.2. This is going to be much faster than updating to 3.0.19, then to 3.6, then 12, then 19 (which is the current process).

  • 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

Maybe you are looking for

  • Windows 8.1 (w/OSX 10.9.1)

    Please post your results using bootcamp and Windows 8.1 on 2013 model Mac Book Pro now that 10.9.1 has been released. Please include the following minimum information in your post below. Windows Type: Retail or OEM Windows Platform: 32bit or 64bit (y

  • Score Editor: best key commands for attaching symbols?

    Does anyone have suggestions for the best keys or a logical system of what Key Commands to use for attaching Score symbols.. especially these below? [IMG]http://i364.photobucket.com/albums/oo82/dogliege/ScoreEditorKC.jpg[/IMG]

  • How to convert Xls file into Xml file

    Hi, I am trying to convert Xls file into Xml  but there  is no any direct procedure for it Pls help me out to convert Xls file into Xml file Thanks Anushree

  • Web site design

    Hi i was wondering can photo shop be used as a mock up tool for websites ? 2. Can you slice a psd web file that can be used for making html files of a web site ? I'm asking because I'm wanting to make templates for muse or DW. For clients to use . Al

  • Compiling mxml

    Compiling mxml file works fine using the webtier compiler. Actuallu is great! There is only one problem I get a strange error reported by the debugger player version. To get rid of that I need to create a compilation error and run it again and then f