mysql and crystal reports

G

Guest

is there a way of integrating mysql databases into the .net crystal reports?
in the report wizard i have options for sql databases, but nothing for
mysql. is there a plugin i'm missing for it?

i've tried creating a dataset and filling it with the data from a mysql
query, but it still does not show up in the wizard. i have also tried to
create fields and import data to them, but there seems to be no way of
accessing the crystal report fields. any ideas on what the easiest way to do
this would be? or is there a better way of creating reports from datasets?

i'm an experienced programmer, just new to crystal reports.
thanks for any help given
 
R

Rob R. Ainscough

I use "Field Definitions Only" (these are .ttx files) to feed my CR .rpt --
they are very simple to create and manage.
Example .ttx
Field1 String 3
Field2 Number 10
Field3 Date
Field4 Currency

Do NOT pass a dataset to Crystal Reports, pass a DataTable.

The field names and structures need to match the field names and structures
in the DataTable.

This works with CR .NET in VS .NET 2003 and also maintain backward
compatibility to CR 8.5 rpt using .ttx approach.

You avoid the hassle of creating a DataSet.xds which is way too much
overhead IMHO and just doesn't make for easy distribution.
 
G

Guest

putting the datatable right into the crystal report works much better, but
do i have to create the reports off of a .xml version first so i know all the
fields are right and then get rid of the .xml document and bind the datatable
to the crystal report? every time i create fields in the crystal report then
send the datatable to it i get an error message telling me that the fields
don't exist.
 
R

Rob R. Ainscough

Windows CR reports or Web CR reports?

1. create a <your_report_filename>.ttx file (Notepad or from within VS as a
*.* file) per my info above
Field1 String 3
Field2 Number 10
Field3 Date
Field4 Currency
(adjust field names and types to match your datatable fields)

2. load/create .rpt in your solution/project
3. open up the "Field Explorer" in left pane
4. right click "Database Fields"
5. click on "More Data Sources"
6. click on "Field Definitions Only"
7. enter the path to the .ttx file you created above (step 1)
8. click on ">" to move the file to "Selected Tables" list
9. click Ok

You should see the list of fields you defined in your .ttx from step 1.
Drag and drop these fields into your report. So long as the field names and
types match up with your DataTable field names and types, you should be good
to go. You can probably do the same with XML document if you like, but XML
has a ton of tags and other useless garbage that isn't needed. If you need
to change the contents of you .ttx file, then right click on "Database
Fields" and do "Verify Database" -- this will synch up the .ttx to the .rpt
(be careful, type changes will remove the field from the report and you'll
have to re-add it) when you do this.

There are many ways to link up data to a report, I personally prefer the
simplest approach (.ttx) as I don't need all the overhead associated with a
DataSet (which can contain multiple tables).

Rob.
 
G

Guest

thank you for all your help.

i tried the .ttx files and they seemed speratic as to when they would work
and when they wouldn't. i actually started just creating an xml schema and
creating the crystal reports from those. i get the dataset, which is data
from the mysql database, and write the xml schema, which is always the same
file name it just rewrites it to fit the new data, and then i make a
datatable = dataset.tables[0] and import it to the report. it seems to work
very well and by rewriting my xml schema to the same file each time it
prevents me from needing to have a database file for each crystal report,
because i'm probably going to have 50-100 reports by the end of this project.


in answer to your questions, they are windows CR reports.

thanks again for the help.
 
G

Guest

as i've gotten further into this i have come accross another question i hope
you can answer. i have a customer crystal report and it can display name,
full address and notes but the user will have the option to only display
their name and phone number. do i have to create 2 different reports for
these or is there a way to hide some fields? i tried remaking the xml
schema and figured that would reset the fields, but the empty fields are
still there. is there a way to only display the fields in the datatable
being sent to the crystal report? or do you just create a report for each
type of datatable?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top