Neevia Technology Sites:   www.neevia.com  |  docuPub.com  |  www.neeviaPDF.com
:: Home :: Products :: Technical Support :: About Us :: Contact Us
Technical support > Neevia docuPrinter SDK code samples
Example 7: Convert a MS Access report into PDF from VB.NET  Print Example 

Sub AccessConverter()

    Dim DPSDK As Object = CreateObject("docuPrinter.SDK")

    DPSDK.DocumentOutputFormat = "PDF"
    DPSDK.DocumentOutputName = "demoAccess"
    DPSDK.DocumentOutputFolder = "c:\"

    DPSDK.DocumentResolution = 300

    DPSDK.HideSaveAsWindow = True
    DPSDK.DefaultAction = 1

    DPSDK.ApplySettings()

    Dim objAccess As Object
    objAccess = CreateObject("Access.Application")

    Dim defPrinter As String = DPSDK.GetDefaultPrinter

    DPSDK.SetDefaultPrinter("docuPrinter")
    objAccess.OpenCurrentDatabase("c:\access.mdb", True)

    objAccess.DoCmd.OpenReport("rptCatalog", 0)
    'rptCtatalog is the repport name

    objAccess.Quit(2)
    objAccess = Nothing

    Dim RVal As Integer = DPSDK.Create ' Create output document
    If (RVal <> 0) Then MsgBox("Error. Create returns " + CStr(Rval))

    DPSDK.SetDefaultPrinter(defPrinter)

    DPSDK = Nothing

    MsgBox("Done converting!!!")

End Sub



Copyright © 1999-2016 Neevia Technology. All Rights Reserved. Home | Products | Technical Support | About Us | Contact Us