on 02-18-2014 3:37 AM
Hi, everyone
Im using VB.NET 2010 and MySQL. I have created reports using XML as datasource. I didn't have problems during the development, all seems to work fine.
My problem is whenever I copy the exe file from the "bin" folder of my project and try to run it outside(ex: desktop), it can no longer generate the exact report.
The same is true when I create a deployment setup and try to install it.
This doesn't works even though I'm still using the DEV pc.
I think it cannot generate an exact report when it is not in the "bin" or project location.
Here is the code I got from youtube in creating xml file to be used in creating reports. The code creates an xml file where the reports based its data/content. The xml files are created just where the exe file is located.
Dim ds As New DataSet
Dim cs As New MySqlConnection(connStr)
Dim da As New MySqlDataAdapter
sql = "SELECT * . . . . "
Try
cs.Open()
da.SelectCommand = New MySqlCommand(sql, cs)
da.Fill(ds)
ds.WriteXml(CurDir() & "\reportFile.xml", XmlWriteMode.WriteSchema)
Catch ex As Exception
MsgBox(ex.Message)
End Try
I hope I can get any help or suggestions.
Thank you so much.
Sounds like you are manually deploying CR runtime. Please search on how to deploy runtime, lot's of post in this forum.
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you please expand on:
I think it cannot generate an exact report
What does that mean?
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your code simply saves the xml file but it does update the report to use the xml file just saved.
Add this:
...
ds.WriteXml(CurDir() & "\reportFile.xml", XmlWriteMode.WriteSchema)
rpt.SetDataSource(ds)
Catch ex As Exception
MsgBox(ex.Message)
End Try
You may have to add in a rpt.VerifyDatabase to confirm the DS matches the reprot exactly.
Don
Check out the samples here:
Crystal Reports for .NET SDK Samples - Business Intelligence (BusinessObjects) - SCN Wiki
Also see:
SAP Crystal Reports .NET SDK Developer Guide
SAP Crystal Reports .NET API Guide
- Ludek
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.