Click here to Skip to main content
15,891,650 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: communicating between two exes Pin
Mycroft Holmes11-Oct-13 13:44
professionalMycroft Holmes11-Oct-13 13:44 
GeneralRe: communicating between two exes Pin
GuyThiebaut15-Oct-13 5:44
professionalGuyThiebaut15-Oct-13 5:44 
Question"400" error from Excel VBA Pin
jasmith410-Oct-13 3:58
jasmith410-Oct-13 3:58 
AnswerRe: "400" error from Excel VBA Pin
thatraja10-Oct-13 4:39
professionalthatraja10-Oct-13 4:39 
QuestionHow to represent a netmask? Pin
Bogus Exception4-Oct-13 15:38
Bogus Exception4-Oct-13 15:38 
AnswerRe: How to represent a netmask? Pin
Ron Beyer4-Oct-13 16:31
professionalRon Beyer4-Oct-13 16:31 
QuestionImage Shading Correction Pin
Member 103146653-Oct-13 20:52
Member 103146653-Oct-13 20:52 
QuestionCrystal Report with XML DataSource Problem Pin
Biplob Singha Shee3-Oct-13 8:53
Biplob Singha Shee3-Oct-13 8:53 
Hi,

I have 2 tables and from those two I created two different XML files and merge them into one.

My code is...
VB
Try
            OpenConnection()
            '// Writing Sales Data into XML Document
            Dim sb As New StringBuilder '<------------------- Table 1
            With sb
                .Append("SELECT * FROM salesdetails WHERE InvoiceId='" & TbInvNo.Text & "'")
            End With
            Dim dbcommand As New MySqlCommand
            Dim dbadapter As New MySqlDataAdapter
            Dim stdata As New DataSet()
            dbcommand.Connection = conn
            dbcommand.CommandText = sb.ToString
            dbadapter.SelectCommand = dbcommand
            dbadapter.Fill(stdata, "salesdetails")
            stdata.WriteXml(Application.StartupPath & "\ReportXml\SaleXml.xml", XmlWriteMode.WriteSchema)
            Dim dbread As MySqlDataReader = dbcommand.ExecuteReader
            While dbread.Read
                IID = dbread("InvoiceId")
            End While
            dbread.Close()

            '// Writing SalesItems Data into XML Document
            Dim sb2 As New StringBuilder '<------------------- Table 2
            With sb2
                .Append("SELECT * FROM salesitems WHERE InvoiceId='" & TbInvNo.Text & "'")
            End With
            Dim dcmd As New MySqlCommand
            Dim sadapter As New MySqlDataAdapter
            Dim sd As New DataSet()
            dcmd.Connection = conn
            dcmd.CommandText = sb2.ToString
            sadapter.SelectCommand = dcmd
            sadapter.Fill(sd, "salesitems")
            sd.WriteXml(Application.StartupPath & "\ReportXml\SalesItems.xml", XmlWriteMode.WriteSchema)

            '// Merge Into One (Two XML Files)  <------------- Table 1 + Table2
            Dim Table1 As New XmlTextReader(Application.StartupPath & "\ReportXml\SaleXml.xml")
            Dim Table2 As New XmlTextReader(Application.StartupPath & "\ReportXml\SalesItems.xml")
            Dim XmlDataSet1 As New DataSet
            Try
                XmlDataSet1.ReadXml(Table1)
                Dim XmlDataSet2 As New DataSet
                XmlDataSet2.ReadXml(Table2)

                XmlDataSet1.Merge(XmlDataSet2)
                XmlDataSet1.WriteXml(Application.StartupPath & "\ReportXml\CompleteSales.xml", XmlWriteMode.WriteSchema)
            Catch ex As Exception
                MsgBox(ex.Message, MsgBoxStyle.Critical, "Error!!!")
            End Try

            Dim objRpt As New SaleBill '<------------- SaleBill is the name of CrystalReport
            objRpt.SetDataSource(XmlDataSet1.Tables())
            FormReport.RptViewer.ReportSource = objRpt
            FormReport.ShowDialog()
            FormReport.RptViewer.RefreshReport()
        Catch ex As Exception
            MsgBox(ex.Message)
        Finally
            CloseConnection()
        End Try

I created the Datasource of the crystalreport file from the XML file and designed it.

But the problem is when I tried to generate the report, It shows only the SalesItems table data whereas the other table data are also present in the XML file BUT NOT SHOWING.

What should I do ?

I am using CrystalReport 13 with VB.NET 2010.

modified 3-Oct-13 16:37pm.

AnswerRe: Crystal Report with XML DataSource Problem Pin
Biplob Singha Shee3-Oct-13 10:40
Biplob Singha Shee3-Oct-13 10:40 
AnswerRe: Crystal Report with XML DataSource Problem Pin
thatraja7-Oct-13 4:11
professionalthatraja7-Oct-13 4:11 
GeneralRe: Crystal Report with XML DataSource Problem Pin
Biplob Singha Shee11-Oct-13 6:26
Biplob Singha Shee11-Oct-13 6:26 
QuestionRemote Desktop Pin
hansoctantan3-Oct-13 1:06
professionalhansoctantan3-Oct-13 1:06 
AnswerRe: Remote Desktop Pin
Richard MacCutchan3-Oct-13 2:26
mveRichard MacCutchan3-Oct-13 2:26 
GeneralRe: Remote Desktop Pin
hansoctantan3-Oct-13 3:03
professionalhansoctantan3-Oct-13 3:03 
GeneralRe: Remote Desktop Pin
Richard MacCutchan3-Oct-13 3:05
mveRichard MacCutchan3-Oct-13 3:05 
GeneralRe: Remote Desktop Pin
hansoctantan3-Oct-13 3:08
professionalhansoctantan3-Oct-13 3:08 
GeneralRe: Remote Desktop Pin
Richard MacCutchan3-Oct-13 3:28
mveRichard MacCutchan3-Oct-13 3:28 
GeneralRe: Remote Desktop Pin
hansoctantan3-Oct-13 3:31
professionalhansoctantan3-Oct-13 3:31 
AnswerRe: Remote Desktop Pin
GuyThiebaut4-Oct-13 0:06
professionalGuyThiebaut4-Oct-13 0:06 
GeneralRe: Remote Desktop Pin
hansoctantan4-Oct-13 0:17
professionalhansoctantan4-Oct-13 0:17 
GeneralRe: Remote Desktop Pin
Eddy Vluggen5-Oct-13 0:42
professionalEddy Vluggen5-Oct-13 0:42 
QuestionAutomating export of fs10n query from SAP using VBA Pin
David Pepper2-Oct-13 23:28
David Pepper2-Oct-13 23:28 
QuestionPlease help interpreting debug output Pin
Jayme652-Oct-13 22:07
Jayme652-Oct-13 22:07 
AnswerRe: Please help interpreting debug output Pin
GuyThiebaut2-Oct-13 22:29
professionalGuyThiebaut2-Oct-13 22:29 
SuggestionRe: Please help interpreting debug output Pin
Richard Deeming3-Oct-13 1:37
mveRichard Deeming3-Oct-13 1:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.