Solved

VB.NET Crystal Report Designer

Posted on 2006-10-27
3
502 Views
Last Modified: 2008-02-01
I am just provisionally testing producing a Crystal Report using the embedded CR Designer in VB.Net 2005. I intend to produce a report from an xml file exported from filling a Datatable. To test the technology I have exported a crosstab query from Access 2003 to an XML file. I have then added a new crystal report via the solutions explorer and selected the xml file as the datasource. I have added a few fields to the report from the field explorer and pressed the main report view tab.

The problem is the field headings are showing but the data seems to be some sort of microsoft test data i.e. days of the week and list of colours etc that have nothing to do my data, what happened to the data in the xml file? I double clicked on the xml file which opened in the browser and all the data is present and correct?

I am obviously missing some steps?

I also noticed that Crystal report help (VB.Net embedded) says its only compatible with XML in SQL Server 2005. Does this mean I can't export from a datatable to XML  and run a crystal report?
0
Comment
Question by:JeffvClayton
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
bman9111 earned 500 total points
ID: 17824191
no to export a dataset to xml.

just use

datasetname.writexml("c:\filenameyouwant.xml")
I would say if you not seeing the data then the data source that the crystal is attached too is not loading.

what i would do is in vb.net don't export to xml if you want to display in crystal.

1st. create a dataset with the table scheme desired.
2nd write a statement to grab the data from the access query
3rd link the crystal report to the dataset created

4th at the end of filling you data set make sure you have the setdatasource for the crystal report point to the dataset.

Make any sense or am i way off what you are asking?
0
 
LVL 3

Author Comment

by:JeffvClayton
ID: 17832714
Thanks for the comment.

What I wanted to do was design a crystal report template with relevant formulas based on the fields etc., layout the fields and headings, shading and other design attributes and test it. I have done this by making a temporary access table and setting it as the datasource.

The actual data would eventually be in the same fields as the access table but extensively manipulated in code using  datatables, the final datatable i then needed to attach to my report template. Got it all working as follows:

1. Make temp access table and design report layout.
2. Make datatable with actual data
3. Link them




        Dim cr As New CrystalReport1
        cr.Load(clsGlobal.gsPath & "CrystalReport1.rpt")
        cr.SetDataSource(DT)
        CRV1.ReportSource = cr
        CRV1.Show()
0
 
LVL 3

Author Comment

by:JeffvClayton
ID: 17832717
managed to press submit before finishing but basically all works wihtout using xml.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now