469,317 Members | 2,033 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,317 developers. It's quick & easy.

Access report from vb.net?

Can I call an Access report from VB.Net? (I'm using access as the backend.)

Thanks in advance.
Nov 12 '05 #1
2 15016

"Tom Weddell" <tw******@optonline.net> wrote in message
news:bo*********************@news4.srv.hcvlny.cv.n et...
Can I call an Access report from VB.Net? (I'm using access as the

backend.)

Unless yours is a very unusual VB.Net application, you are using the Jet
database engine as the back end, with ADO.NET to handle the data retrieval,
and Access is nowhere involved.

Access is the UI and development tool, Jet is the default DB engine for
Access and other MS software.

All that said, using automation, you could run an Access report if Access
and an Access application including the Report are installed on the server
if it is a .NET web app (or the Windows workstation, of it is a .NET Windows
app). A VB.NET newsgroup might be a better source for using automation in
..NET -- it'll be somewhat different, I suspect, than using automation in a
non-.NET envoronment.

Larry Linson
Microsoft Access MVP
Nov 12 '05 #2
Yes... but... it's not pretty.

You would have to instanciate an instance of access, open the database, open
the report, and print it using automation code. I've done it before and it
works fine. It's a little slow and the client computer has to have Access
installed. You can do the whole thing while keeping Access invisible.

If you want to do the .NET way... you would use Crystal Reports to build the
report with. Choose to add a new item, choose Crystal Report, use the
wizard to start with, connect to your mdb, choose the
table/grouping/sorting/layout, save it as myCrystalReport.rpt. Then make a
..NET form, drop a CR Viewer control on, then do this on some event...

Private Sub someButton_Click......
Dim crDoc as ReportDocument
crDoc = new myCrystalReport 'note that the report becomes a class that you
can now instantiate.

'parameters are more complex, but pass them to the report here, note that
the "Parameter Fields" node is where you add parameters and the "Select
Expert" on the report designer is used to tie the parameter to the field.
Parameter syntax on the "Select Expert" is like this... {?@myParam}

crViewer = crDoc

End Sub

Good luck! Let me know how it turns out.

--
Jerry Boone
Analytical Technologies, Inc.
http://www.antech.biz
"Tom Weddell" <tw******@optonline.net> wrote in message
news:bo*********************@news4.srv.hcvlny.cv.n et...
Can I call an Access report from VB.Net? (I'm using access as the backend.)
Thanks in advance.

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Joris Kempen | last post: by
6 posts views Thread by Bob Alston | last post: by
2 posts views Thread by amith.srinivas | last post: by
9 posts views Thread by prakashwadhwani | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.