How to create a dataSet.xsd
I know hw to create a normal dataset et to bind it to my report.
Here is what i'm doing to create my dataset:
strSql = "SELECT SUM(SO.SalesProjUSD) AS salesProjUsd, " + _
" SUM(SO.SalesProjAED) AS SalesProjAED, " + _
" SUM(SO.AvgBuyingUSD) AS AvgBuyingUSD, " + _
" SUM(SO.AvgSellUSD) AS AvgSellUSD, " + _
" COUNT(*) AS total " + _
"FROM StoreOperation SO , storeProfile sp " + _
"WHERE so.brand = sp.brand " + _
"AND so.StoreNumber = sp.StoreNumber " + _
"AND Sp.countryCode = '" & Trim(Me.cboSelection.Text) & "' " + _
"GROUP BY sp.storeGrade "
MyCommand = New OleDbCommand(strSql, MyConnection)
MyAdapter.SelectCommand = MyCommand
dsReportData.Clear()
MyAdapter.Fill(dsReportData, "CountryStoreGrade")
frmReportViewer.ViewReport("C:\Documents and Settings\Alex\Bureau\BuyingGrid\BuyingGrid\BuyingGrid\buyingGrid\rptCountryStoreGrade.rpt", _dsReportData)
frmReportViewer.Show()
Here's my function to bind the dataset to my report
Friend Function ViewReport(ByVal sReportName As String, _
ByVal dsReportData As DataSet, _
Optional ByVal sSelectionFormula As String = "", _
Optional ByVal param As String = "") As Boolean
Dim objReport As New CrystalDecisions.CrystalReports.Engine.ReportDocument
Try
'Load the report
objReport.Load(sReportName)
'Re setting control
rptViewer.ReportSource = Nothing
objReport.SetDataSource(dsReportData )
'Set the current report object to report.
rptViewer.ReportSource = objReport
'Show the report
rptViewer.Show()
dsReportData .Clear()
dsReportData .Dispose()
Return True
Catch ex As Exception
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Function
But what am i suppose to do more to have a dataset.XSD so in crystal report i will be able to select it and put the fields in my report.
Thanks for your help

