Vb.net to produce MSaccess report

Hello,
Any Guidline/Suggestion on just a simple system that will produce a printable report using MSaccess instead of sql.
Thanx in advance.

Cheers
RIASAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AndyAinscowFreelance programmer / ConsultantCommented:
You can use a command line parameter to run a macro in access
https://support.office.com/en-us/article/Command-line-switches-for-Access-558cfe1d-3c98-4292-bee8-1f5df9702bf1

eg. msaccess.exe /ro "c:\MyFolder\MyDatabase.accdb" /x MyMacro

So your macro could print the report then close access after printing.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RIASAuthor Commented:
Hello Andy,
Thanks for the input.But ,my client wants a vb.net project to generate MSAccess report.  Any suggestions?

Cheers
AndyAinscowFreelance programmer / ConsultantCommented:
>>my client wants a vb.net project to generate MSAccess report.

If it is to print an existing report the simple suggestion I made will work.  Use a VB.Net app to use Process.Start to launch access with command line parameters.

If it is to create a report you have an incredible amount of code to write, you'd need to open a report in development mode, create and add the data source, add controls to display info where required (header, footer, body, both report and grouping).....
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

AndyAinscowFreelance programmer / ConsultantCommented:
ps.  The first only requires the free runtime access on the PC, the second requires the purchased full version of access on the PC.
RIASAuthor Commented:
Yes,have purchased access on the pc.
AndyAinscowFreelance programmer / ConsultantCommented:
and creating a report from nothing?
RIASAuthor Commented:
yup!
AndyAinscowFreelance programmer / ConsultantCommented:
As I said, loads of work.  How much really depends on just what your client wants.
It is the sort of thing I'd do as a contract job.


you'd need to open a report in development mode, create and add the data source, add controls to display info where required (header, footer, body, both report and grouping).....
RIASAuthor Commented:
Ok.
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
It would be better to create the report in Access and then fill it through automation from your .NET program. Creating a report entirely from code in Access is doable, as Andy said, but it's a tremendous amount of work for no real benefit.
RIASAuthor Commented:
Great!Any suggestions on how to add print function for the existing access report.
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Are you already interacting with Access from you .NET program? If so, then you would simply call the Access command to print your report:

<YourAccessObjject>.Docmd.OpenReport "YourReportName"

Of course, if you need to filter, or preview, you can include other arguments with that.

If you're not using the Interops method to do this, then as Andy suggested you could use a command line to do this. You'd have to setup a Macro in the Access database to print that report, and then use a commandline like this:

"path to msaccess.exe" /x name_of_your_macro

This will launch an instance of Access and run the commands in that macro.
RIASAuthor Commented:
Cheers mates!!!!Will take it from here now..
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.