By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,836 Members | 2,023 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,836 IT Pros & Developers. It's quick & easy.

Access report from vb.net?

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

Thanks in advance.
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"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

P: n/a
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.