Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 5th, 2004, 08:11 AM
Authorized User
 
Join Date: Sep 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access reports

Hi everyone,

I have to create Access reports programatically. What I am doing is creating an Access database from scratch using ADOX in C++. So, I create a table that has the required data.

However, I do not know how to create reports programatically. What would be the best approach? Can someone point me to some learning resource for programatically creating access reports.

Also, is it possible to control the orientation of text (vertical, hori.) in Access reports etc.

Thanks for any help you might give me.

Sincerely,
Pankaj

 
Old March 5th, 2004, 12:57 PM
Authorized User
 
Join Date: Feb 2004
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Access databases including tables and queries therein are objects that can be created and consumed by various programming languages including C++. Access reports, forms, macros and modules are Access objects that require Access to be installed on a machine to work with the objects through the Access libraries. ADOX gives you access to the tables but I don't believe you can create any Access reports without installing Access and using COM based automation. A more generic approach would be to use Crystal for reporting.

Ciao
Jürgen Welz
Edmonton AB Canada
[email protected]
 
Old March 6th, 2004, 05:57 AM
Authorized User
 
Join Date: Sep 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
Thanks for replying. The COM based solution sounds good enough. I have access installed. Do you know of any references that will give more example of such COM automation

Thanks,

Pankaj


 
Old March 6th, 2004, 12:04 PM
Authorized User
 
Join Date: Feb 2004
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have a look at http://www.developer.com/net/cplus/article.php/628191 to get started.

Not using C++, I'm not sure how you add a reference to an object library, but in VB or Access it is from a module window on the Tools menu. Once the reference is set, you have access to the object model and information about it through the Object Browser.

If you do a goole search you may find an open version of the Access Wizards that are used for report creation. I recall that John Colby of ColbyConsulting.com found an open source version of the Access 97 wizard for creating the switchboard form. You may try emailing him if you are unsuccessful in finding this.

You would start by setting a reference to an existing database object or using the CreateDatabase method of Access. Thereafter you would open the documents collection and reports subcollection and add a report. Thereafter add controls, add a sql string or saved query name record source and then set the bound properties of the controls you added to the controls collection. You can set the top, left, width and height properties as well as the section.

I would suspect that the easiest way to get started is to create a report programatically from within Access. Thereafter, your C++ project could return an Access reference and likely use the exact syntax generated from within Access.

I have used automation for all the Office applications (including Project, Outlook, Word, Excel, PowerPoint and Access) but have not had a reason to generate Reports or Forms on the fly. If you have difficulty generating a report in this fashion, I could probably create a quick example using VB or Access to create a new report in an external Access container.

When you deploy your application, the target machines must have Access installed for this to work. It would be preferable if they have the same version of Access as it will allow you to use early bound objects.

Ciao
Jürgen Welz
Edmonton AB Canada
[email protected]
 
Old March 8th, 2004, 10:55 AM
Authorized User
 
Join Date: Sep 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Juergen,

Thanks for the reply :-) It was very helpful. I will try and see if I can figure it out. I will post something if I have more queries or some classes hat might be helpful to others.

Thanks,
Pankaj






Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Reports and Access Database solemgar Crystal Reports 0 August 18th, 2005 02:35 PM
Reports in access nikotromus Access VBA 4 July 31st, 2005 12:57 AM
Rounding in Access Reports ebs Access 1 December 19th, 2004 05:18 AM
Access Reports greig_whitney Access VBA 1 August 31st, 2004 12:01 PM
ASP and Access Reports cascade Classic ASP Databases 0 June 12th, 2003 05:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.