|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
MS Access Reports and VB.NET ProgramI'm utilizing a database that I created within MS Access within a
program I've created in VB.NET. I am using the VB front end to navigate the information, but want to be able to print a report, that I've also created within MS Access. I've attempted using the Access.Application instance, but I get errors when it tries to load the database. Just wondering if anyone has any experience with this, and what I should do. Thanks for any help you can offer. Is using Crystal Reports an option for you? Does you version of VS.NET
come with Crystal? JoeW wrote: Show quoteHide quote > I'm utilizing a database that I created within MS Access within a > program I've created in VB.NET. I am using the VB front end to > navigate the information, but want to be able to print a report, that > I've also created within MS Access. I've attempted using the > Access.Application instance, but I get errors when it tries to load the > > database. Just wondering if anyone has any experience with this, and > what I should do. > > Thanks for any help you can offer. Well, yes I have crystal reports, although my experience is quite
limited with it... have you found it is easier to use than MS Access? I just need something to display a simple report. I'm wide open to suggestions, and can pick up on most things if I have a chance to work on it a bit. Thanks for your help. -joe Izzy wrote: Show quoteHide quote > Is using Crystal Reports an option for you? Does you version of VS.NET > come with Crystal? > > > JoeW wrote: > > I'm utilizing a database that I created within MS Access within a > > program I've created in VB.NET. I am using the VB front end to > > navigate the information, but want to be able to print a report, that > > I've also created within MS Access. I've attempted using the > > Access.Application instance, but I get errors when it tries to load the > > > > database. Just wondering if anyone has any experience with this, and > > what I should do. > > > > Thanks for any help you can offer. Just because Crystal comes with VS, does not mean that it is free to deploy.
There is a licensing charge for deploying CR. From my experience working with CR (back in 1997), Access was much better of a reporting tool than CR for developers. It didn't have as good of an end user designer however. You may want to consider the ReportViewer in 2005 or one of the third party report tools. I do believe you can run Access reports via interop, but have not tried it. You should be able to find samples on the web to do this. Jim Wooley http://devauthority.com/blogs/jwooley/default.aspx Show quoteHide quote > Well, yes I have crystal reports, although my experience is quite > limited with it... have you found it is easier to use than MS Access? > I just need something to display a simple report. I'm wide open to > suggestions, and can pick up on most things if I have a chance to work > on it a bit. > > Thanks for your help. > -joe > Izzy wrote: >> Is using Crystal Reports an option for you? Does you version of >> VS.NET come with Crystal? >> >> JoeW wrote: >> >>> I'm utilizing a database that I created within MS Access within a >>> program I've created in VB.NET. I am using the VB front end to >>> navigate the information, but want to be able to print a report, >>> that I've also created within MS Access. I've attempted using the >>> Access.Application instance, but I get errors when it tries to load >>> the >>> >>> database. Just wondering if anyone has any experience with this, >>> and what I should do. >>> >>> Thanks for any help you can offer. >>> You need to have the Access application installed (not just the mdb file) on
the computer you want to run the report. Try using this code: (watch out for word wrap) Public Sub PrintAccessReport(ByVal sReportName As String, Optional ByVal sQryName As String = "", Optional ByVal sSQL As String = "") Dim oAccess As New Access.ApplicationClass oAccess.Visible = True oAccess.OpenCurrentDatabase("C:\PathTo\Your\Database.mdb") oAccess.DoCmd.Minimize() 'Create new query if needed If sQryName.Length > 0 And sSQL.Length > 0 Then Try 'oAccess.CurrentDb.QueryDefs.Delete(sQryName) oAccess.DoCmd.DeleteObject(Access.AcObjectType.acQuery, sQryName) Catch 'Close and reopen the Access object if above statement failed oAccess.Visible = False oAccess.Quit(Access.AcQuitOption.acQuitSaveNone) System.Runtime.InteropServices.Marshal.ReleaseComObject(oAccess) oAccess.Visible = True oAccess.OpenCurrentDatabase("C:\PathTo\Your\Database.mdb") oAccess.DoCmd.Minimize() End Try oAccess.CurrentDb.CreateQueryDef(sQryName, sSQL) End If 'Preview the report oAccess.DoCmd.OpenReport(sReportName, Access.AcView.acViewPreview, , , Access.AcWindowMode.acDialog) 'Close the Access Instance If Not oAccess Is Nothing Then ' Call Access Quit method without saving any changes. oAccess.Quit(Access.AcQuitOption.acQuitSaveNone) ' Use Marshal class' ReleaseComObject to release the Access instance. System.Runtime.InteropServices.Marshal.ReleaseComObject(oAccess) ' Dereference the oAccess variable. oAccess = Nothing End If End Sub -- Show quoteHide quote------------------------------------------------------------------------ George Shubin Custom Software Development dX Software Systems Database Applications Ph: 503-981-6806 Fax: 503-982-0120 www.dxonline.com geo***@dxonline.com ------------------------------------------------------------------------ "JoeW" <wajo0***@stcloudstate.edu> wrote in message news:1155745516.792909.268870@m73g2000cwd.googlegroups.com... > I'm utilizing a database that I created within MS Access within a > program I've created in VB.NET. I am using the VB front end to > navigate the information, but want to be able to print a report, that > I've also created within MS Access. I've attempted using the > Access.Application instance, but I get errors when it tries to load the > > database. Just wondering if anyone has any experience with this, and > what I should do. > > Thanks for any help you can offer. >
VB.NET Express speed issue
To overload, or not to overload? ANN: VS.NET 2003 SP1 Newbie and 2005 Concurrecny RE: TO LEARN PROGRAMMING Memory Usange In VB.NET Serial Port Communuciation in VB with Compact Framework 2.0 create a folder useing vb code? Desktop Application Culture Setting Control.Visble = True ERROR |
|||||||||||||||||||||||