List Info

Thread: Help Trying to Create PDF,s using Crystal Reports XI in VB 2005 Code




Help Trying to Create PDF,s using Crystal Reports XI in VB 2005 Code
user name
2008-01-21 08:59:31
Hi, I have written some VB Code that calls Crystal to run a
report and
create a PDF file in a specific location. The result is that
I get the
PDF file but the actual data reported is the "Data
Saved with the
Report" in Crystal. I can successfully print or view
the report in the
same app but I can't seem to force a "refresh" of
data when I execute
the report creating a PDF? I'm sure that I don;t see the
obvious.....

Dim CrRpt As String = Me.CrystalReportViewer1.ReportSource
Dim CrReport As New ReportDocument
Dim CrExportsOptions As New ExportOptions
Dim CrDiskFileDestinationOptions As New
DiskFileDestinationOptions()
Dim CrFormatTypeOptions As New PdfRtfWordFormatOptions()
Dim DestPath As String
Dim Pname As String

        ' Set Export Options

        CrReport.Load(CrRpt)
        CrFormatTypeOptions.FirstPageNumber = 1
        CrFormatTypeOptions.LastPageNumber = 3
        CrFormatTypeOptions.UsePageRange = True
        CrExportsOptions = CrReport.ExportOptions


       With CrExportsOptions
              .ExportDestinationType =
ExportDestinationType.DiskFile
              .ExportFormatType =
ExportFormatType.PortableDocFormat
              .DestinationOptions =
CrDiskFileDestinationOptions
              .FormatOptions = CrFormatTypeOptions
       End With
       Try
            CrReport.Export(CrExportsOptions)
       Catch err As Exception
            MessageBox.Show(err.ToString())
       End Try

Any Ideas?

Thanks

D

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "DotNetDevelopment, VB.NET, C# .NET,
ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting"
group.
To post to this group, send email to DotNetDevelopmentgooglegroups.com
To unsubscribe from this group, send email to
DotNetDevelopment-unsubscribegooglegroups.com
For more options, visit this group at
http:
//cm.megasolutions.net/forums/default.aspx
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )