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


   Dim DC As Object
   DC = CreateObject("Neevia.docCreator")

   DC.setParameter("DocumentOutputFormat", "PDF")
   DC.setParameter("DocumentOutputName", "testAccess_VBNET")
   DC.setParameter("DocumentOutputFolder", "d:\")

   Dim RVal As Integer = DC.startPrinting
   If (RVal <> 0) Then
     MsgBox("Error while calling StartPrinting method!!!")
   End If

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

   Dim defPrinter As String = DC.getDefaultPrinter

   DC.setDefaultPrinter(DC.newPrinterName)
   objAccess.OpenCurrentDatabase("d:\access.mdb", True)

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

   objAccess.Quit(2)
   objAccess = Nothing

   DC.setDefaultPrinter(defPrinter)

   DC.setParameter("DocumentResolution", "300")

   RVal = DC.create ' Create output document
   If (RVal <> 0) Then MsgBox("Error. Create returns " + CStr(RVal))

   RVal = DC.StopPrinting
   If (RVal <> 0) Then MsgBox("Error while calling StopPrinting method!!!")

   DC = Nothing

   MsgBox("Done Converting !!!")



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