Results 1 to 4 of 4

Thread: How do I connect between Sql Server and PDf

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2003
    Location
    michigan
    Posts
    70

    How do I connect between Sql Server and PDf

    Hi,

    I am trying to develop a windows form wherein the User selects the Info from a user table like his firstname, lastname, ssn and addInfo. Once he clicks the Submit button what I want is the fields that are entered in this forms have to be copied to a PDF file where there will be a space provided for this columns. Can anyone help me out how to do this. Ur help will be appreciated. And I am using VB.NET for the forms.

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    I think you have two ways to go with One using a third party class that creates PDF documents, and the other is using Crystal Reports to create a report (invisible to the user) and then export it to pdf via code.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2003
    Location
    michigan
    Posts
    70
    Hi Lunatic3

    Thanks for ur reply. I would appreciate if u give me links how to do that using Crystal Reports I dont want to use third party providers. Thanks for ur help again

  4. #4
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    Here are some code snippets which may help:

    Dim Rpt1 As New ReportDocument
    Dim RptName As String = "AnnualStatement"
    Dim RptPath As String
    RptPath = DbConn.ThisRpt
    RptPath = Trim(RptPath) & "\Reports\" & RptName & ".rpt"
    Rpt1.Load(RptPath)

    Rpt1.ReportOptions.EnableSaveDataWithReport = False

    ...... This creates the document as a crystal report

    Dim RptPth As String = DbConn.ThisRpt

    Dim exp1 As New ExportOptions
    Dim dsk1 As New DiskFileDestinationOptions
    Dim Fnam As String = RptPth & "\Emails\" & "Annual Statement " & Format(FinEnd, "dd MM yyyy") & " " & Trim(Name) & ".pdf"
    exp1 = Rpt1.ExportOptions
    exp1.ExportFormatType = ExportFormatType.PortableDocFormat
    exp1.ExportDestinationType = ExportDestinationType.DiskFile
    dsk1.DiskFileName = Fnam
    exp1.DestinationOptions = dsk1
    Rpt1.Export()


    ....... This creates the PDF file and then exports it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width