473,404 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

MS Access reports to XML to .NET

D. Lesandrini published an article some time ago about exporting Access
reports as XML, and then updating those XML reports dynamically in
..NET.
See->http://msdn.microsoft.com/library/de...tml/vs03g9.asp.

I'm not getting it to work. If I use the XML and XSL file as generated
by Access, it works OK, but if I generate the XML file myself and try
to transform that with the XSL file, I just end up with a big block of
completely unformatted text.

I've noticed that the header of the XML file is different when
generated from .NET. Specifically, the first two lines of the file
generated from Access look like:

<?xml version="1.0" encoding="UTF-8"?>
<dataroot xmlns:od="urn:schemas-microsoft-com:officedata"
generated="2006-06-27T10:06:57">

When generated by .NET, it looks like:

<?xml version="1.0" standalone="yes"?>
<dataRoot>

As an experiment, I've tried manually copying the Access-generated
lines over the .NET generated lines. In that case I get nothing at all.
Just an empty string.

The code I'm using is basically Lesandrini's, looking something like:

' connect to database
strConn = connection

' load the data and write it to our xml file.
Dim strSQL As String
strSQL = "SELECT EMPLOYEES.EmpID, EMPLOYEES.Title, " _
& "EMPLOYEES.FirstName, EMPLOYEES.LastName " _
& "FROM EMPLOYEES " _
& "ORDER BY EMPLOYEES.EmpID;"

Dim cnn As OleDbConnection = New OleDbConnection(strConn)
Dim cmd As OleDbCommand = New OleDbCommand(strSQL, cnn)
cnn.Open()

Dim objDA As OleDbDataAdapter = New OleDbDataAdapter(cmd)
Dim objDS As DataSet

objDS = New DataSet("dataRoot")
objDA.Fill(objDS)
objDS.Tables(0).TableName = "qryDelinquent"

objDS.WriteXml(strFile)

Dim objData As Object
Dim objStyle As Object

objData = Server.CreateObject("MSXML.DOMDocument")
objStyle = Server.CreateObject("MSXML.DOMDocument")

objData.load(Server.MapPath("RptDelinquent.xml"))
objStyle.load(Server.MapPath("RptDelinquent.xsl"))

Response.ContentType = "text/html"

Dim strOut As String
strOut = objData.transformNode(objStyle)

This is using Access 2003, BTW.

Another thing I've noticed is that the header of the XLS file included
in the sample .ZIP attached to the article, is different from what is
generated by Access:

Access:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:fx="#fx-functions" exclude-
result-prefixes="msxsl fx">
<xsl:output method="html" version="4.0" indent="yes"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"/>
<xsl:template match="//dataroot"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

Sample:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"
language="vbscript">
<xsl:template match="/">

Has anybody been able to successfully use Access-generated XML reports
in their .NET apps?

ddk

Jun 27 '06 #1
0 1222

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Teri Welch | last post by:
Hello, We maintain a VB6 front-end application using an Access 2000 database. All code and forms are in VB6. The program also uses several queries/reports defined in Access. For corporate...
3
by: Gheaci Maschl | last post by:
Hi all! I would like to have your opinion about my problem and my proposal how to solve it: Ingredients: - BTriev database - Crystal Reports - maybe MS Access - Liinos6 (small ERP software)
3
by: trustme1 | last post by:
I am wanting to be able to write reports against an ms-access database that is part of another package. I only want to report from the database. What I need is a package that will allow me to...
1
by: Bilal Iqbal | last post by:
Hi. Currently i have database MS Access. In the database there are some Reports already designed. i am developing interface in VB and linking to MS Access database. My Problem is to access/Link...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
16
by: cyranoVR | last post by:
This is the approach I used to automate printing of Microsoft Access reports to PDF format i.e. unattended and without annoying "Save As..." dialogs, and - more importantly - without having to use...
2
by: B.Newman | last post by:
I've got some VB.NET code that *should* get a list of reports from an Access MDB and populate a list box with them. It doesn't detect any of the reports at all. oAccess.Reports.Count comes up as...
6
by: Bob Alston | last post by:
I am looking for Access reporting add-in that would be easy to use by end users. My key focus is on selection criteria. I am very happy with the Access report writer capabilities. As far as...
16
by: JoeW | last post by:
I'm utilizing a database that I created within MS Access within a program I've created in VB.NET. I am using the VB front end to navigate the information, but want to be able to print a report,...
6
by: DeniseY | last post by:
I have an Access report that is created on the fly by the user selecting the fields to be included. The Access report comes out fine, but I want it to automatically output to an Excel spreadsheet....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.