How to run MS access report in C# while keeping acces UI hidden?

J

Jama

I have access application AddressDB.adp containing access reports among
other things. I want to run the report viewer without showing the access
application UI.

I am using C# and MS access and I call the Run_Access Method bellow to open
the acces application. I set the
access.Visible = false; but still I get the Access UI opening and that
happens when I call OpenCurrentDatabase or OpenAccessProject. How can I
prevent access UI showing?

private void Run_Access_Report(string reportName)
{
Access.Application access = null;
try
{
access = new Access.ApplicationClass();
access.Visible = false; //open access in the background
string databasePath = Path.Combine(DB_PATH, "AddressDb.adp");

// using Access 10.0 object library
access.OpenCurrentDatabase(databasePath, false, null);
RunReport(Access, reportName)
}
finally
{
if (!access.UserControl) access.UserControl = true;
DisposeAutomation(access);
access = null;
}
}
The code above works but fist it opens MS Access and then it shows the
report. I would like to see only the report viewer.

Thanks
 
G

Guest

It is not possible to view an Access Report without showing the
Access Application UI.

Unlike forms, which can be constructed with the Desktop as
parent, reports can only be constructed as Application client
windows.

If you work on it, you can hide the menu's. If you work on it, you
can modify the window title. If you work very hard, you can modify
the application window (the close/minimise/restore buttons).

You may also be able to force the report to go to full screen mode,
entirely hiding Windows and the application window frame.

It might also be possible to print a report to pdf or snapshot while
the Application window is hidden.


(david)
 
J

Jama

I have a sample application that is using Northwind.mdb and the same code and
shows only the report viewer without MS Access UI. Is there a difference
between the .MDB and .adp extensions when it comes to automation?

Thanks
 
G

Guest

Ask in access.reports. What version of Access are you using?
Where in Northwind does this happen? What do you mean by
'the viewer'?

You can't view Access reports without Access, but you can
view PDF's, snapshots and MS Document format without
Access.

(david)
 
G

Gajapathy

Hi

Can you pls let me know, how you made showing the report viewer directly
without MS Access UI. my email id is

gajapathy74 at hotmail dot com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top