Solved

VB.NET Crystal Report Designer

Posted on 2006-10-27
3
498 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

757 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

23 Experts available now in Live!

Get 1:1 Help Now