Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8735

Crystal Reports not showing MySQL Date

$
0
0

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.

 

cr1.jpg

 

cr2.jpg

 

Message was edited by: Biplob Shee


Viewing all articles
Browse latest Browse all 8735

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>