Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Help with using Crystal Report with XML data source

Posted on 2010-09-03
13
Medium Priority
?
761 Views
Last Modified: 2012-06-21
Hello,

I'm gettimg prompted for a password eventhough my XML datasource is not password protected.  Can you help me fix this problem? The code below is what I've tried, but it still doesn't work. I'm using VB.NET with crystal report 2008.

Thanks,

V.

Dim xyzcal As String
        xyzcal = Trim(TextBox1.Text)
        Dim myaop29report As New AOP29_XML
        Dim myaop6viewer As New AOP6VIEWER
        Dim mySQL_Statement As String

        Dim fs1 As System.IO.FileStream
        fs1 = New System.IO.FileStream(Application.StartupPath + "\Link.xml", IO.FileMode.Open)
        mySQL_Statement = "{Link.Receiver_ID}in [" & xyzcal & "]"
        Dim myDataAdapter As New Xml.XmlTextReader(fs1)
        Dim dtset1 As New DataSet
        dtset1.ReadXml(fs1)
        myaop29report.SetDataSource(dtset1)
        myaop29report.SetDatabaseLogon("admin", "")
        With myaop6viewer
            .CrystalViewer1.ReportSource = myaop29report
            myaop29report.RecordSelectionFormula = mySQL_Statement
            .Show()
        End With
        MsgBox(myaop29report.RecordSelectionFormula)
        Me.Cursor = Cursors.Default
        myaop29report = Nothing
0
Comment
Question by:vcharles
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
13 Comments
 
LVL 4

Expert Comment

by:TomLaw1999
ID: 33604571
Is this where the problem is occurring?:
myaop29report.SetDatabaseLogon("admin", "")

If so try sending a dummy password i.e.:
myaop29report.SetDatabaseLogon("admin", "Dummy")

Havent tested this but worth a try.
0
 

Author Comment

by:vcharles
ID: 33605191
No, that is not the Location. I don't get an error message, just a prompt for login data. Dummy did not work. Do you have another suggestion?

0
 
LVL 101

Expert Comment

by:mlmcc
ID: 33605457
How id you build the report?

Was it against the XML data source?

mlmcc
0
Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

 

Author Comment

by:vcharles
ID: 33605493
Yes, data source is xml.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 33607623
When you created the report, did you do so against an XML file or against a database?

mlmcc
0
 

Author Comment

by:vcharles
ID: 33607954
Against an XML (several xml files linked by one xml )
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 33608430
I have built many reports against XML files but they were always run against an XML file not a dataset.

DOes this idea help any
http://www.emoreau.com/Entries/Articles/2006/09/Feeding-Crystal-Reports-from-your-application.aspx

mlmcc
0
 

Author Comment

by:vcharles
ID: 33608493
Thanks for the source code, the source of my report is .xml instead of .xsd, could that be the problem?
0
 

Author Comment

by:vcharles
ID: 33608542
Hi,

Below is an example of the data source (Three xml files, donor.xml and receiver.xml are linked by link.xml) The report displays the values of Domors and recivers based on their id field in the link file.
The report works alone, but doesn't work with vb.net. Is something wrong with the files' format for .net?

Donor:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <Row>
            <Donor_ID>1</Donor_ID>
            <Donor>BEL</Donor>
      </Row>
      <Row>
            <Donor_ID>2</Donor_ID>
            <Donor>CAN</Donor>
      </Row>
      <Row>
            <Donor_ID>3</Donor_ID>
            <Donor>CZE</Donor>
      </Row>
      <Row>
            <Donor_ID>4</Donor_ID>
            <Donor>DNK</Donor>
      </Row>
      <Row>
            <Donor_ID>5</Donor_ID>
            <Donor>USA</Donor>
      </Row>
</Root>

Link.xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <Row>
            <Receiver_ID>1</Receiver_ID>
            <Donor_ID>2</Donor_ID>
            
      </Row>
      <Row
            <Receiver_ID>3</Receiver_ID>
            <Donor_ID>4</Donor_ID>
      </Row>
</Root>


Receiver:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <Row>
            <Receiver_ID>1</Receiver_ID>
            <Receiver>FRA</Receiver>
      </Row>
      <Row>
            <Receiver_ID>2</Receiver_ID>
            <Receiver>GBR</Receiver>
      </Row>
      <Row>
            <Receiver_ID>3</Receiver_ID>
            <Receiver>NLD</Receiver>
      </Row>
      <Row>
            <Receiver_ID>4</Receiver_ID>
            <Receiver>DEU</Receiver>
      </Row>
      <Row>
            <Receiver_ID>5</Receiver_ID>
            <Receiver>USA</Receiver>
      </Row>
</Root>
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 33608668
Most XML files also include the data whereas the XSD is only the database definition.

I think that is the issue.  You want to build th ereport against the data definition then pass it the dataset.  That said, I am not sure there is much difference in using the XML file rather than simply the XSD.

mlmcc
0
 

Author Comment

by:vcharles
ID: 33611642
Hello,
How do you obtain an xsd from an xml? How do you design the report with the xsd? and how do you pass the data using a dataset to the xsd?
Thanks,
V.
0
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 2000 total points
ID: 33621563
I think the example linked above shows how to use the XSD file.

I don't know how to build an XSD file.

mlmcc
0
 

Author Closing Comment

by:vcharles
ID: 33742045
issue still not resolved, another approach will be followed
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

719 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