Hello Sir,
I am trying to create a crystal report dynamically from my MySQL database.
My code is as below.
Try
   OpenConnection()
  qry ="SELECT * FROM sales LEFT JOIN salesdetails ON salesdetails.InvoiceId = sales.InvoiceId WHERE salesdetails.InvoiceId='"&TbInvNo.Text&"' AND sales.InvoiceId='"&TbInvNo.Text&"'"
   Dim dbcommand AsNewMySqlCommand
   Dim dbadapter AsNewMySqlDataAdapter
   Dim stdata AsNewDataSet()
  dbcommand.Connection= conn
  dbcommand.CommandText= qry
  dbadapter.SelectCommand= dbcommand
  dbadapter.Fill(stdata)
  stdata.WriteXml(Application.StartupPath&"\ReportXml\bill.xml",XmlWriteMode.WriteSchema)
   Dim objRpt AsNewNormalSaleBill
  objRpt.SetDataSource(stdata.Tables(0))
   FormReport.RptViewer.ReportSource= objRpt
   FormReport.ShowDialog()
   FormReport.RptViewer.RefreshReport()
   Catch ex AsMySqlException
   MsgBox(ex.Message)
   Finally
   CloseConnection()
EndTry
Everything is ok in my generated `Crystal Report` except the `InvoiceDate` field. It is not showing anything. When I open the xml file I found the below in InvoiceDate field.
<xs:element name="InvoiceDate" msdata:DataType="MySql.Data.Types.MySqlDateTime, MySql.Data, Version=6.6.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" type="xs:anyType" minOccurs="0" />
I searched and found a similar question here. It was told that the above must be changed by
<xs:element name="InvoiceDate" type="xs:dateTime" minOccurs="0" />
But I don't know how to do it.
How could I solve this ? I tried to find the solution but failed. For your information, I have removed Allow Zero Datetime from my ConnectionString but the result is same.
Message was edited by: Biplob Shee

