cancel
Showing results for 
Search instead for 
Did you mean: 

Error when i try to print in Crystal Report

Former Member
0 Kudos

Hi , im student from mexico, i have a truble with Crystal Report so u can help me ? plz

my problem with Crystal Report is when i try to print

check my code

    repComandaGeneral.Load("C:\Users\Usuario\Documents\DozRES - comandas\RepTicketCGeneral.rpt", CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault)                repComandaGeneral.SetDatabaseLogon("root", "1234", "localhost", "dozres") ' Login base de datos

                'Dim MiConexion As New ConnectionInfo

                'Dim myTables As Tables = repComandaGeneral.Database.Tables ' Informe.Database.Tables

                'MiConexion.ServerName = "192.168.1.254"

                'MiConexion.DatabaseName = "dozres"

                'MiConexion.UserID = "root"

                'MiConexion.Password = "1234"

                'For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In myTables

                '    Dim myTableLogonInfo As TableLogOnInfo = myTable.LogOnInfo

                '    myTableLogonInfo.ConnectionInfo = MiConexion

                '    myTable.ApplyLogOnInfo(myTableLogonInfo)

                'Next

                repComandaGeneral.SetParameterValue(0, "Value")

                repComandaGeneral.SetParameterValue("cm_id", cm_id)

                repComandaGeneral.PrintToPrinter(1, False, 0, 0)

                repComandaGeneral.Close()

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Josshua,

Do not use "localhost" for the server name, use the machine name or IP address. Or if you are connecting through ODBC then use the DSN name.

If connecting to Oracle the the Database value is an empty string.

Don

Answers (1)

Answers (1)

Former Member
0 Kudos

Thank you for you comment , now the error is in the DB

i dont have idea what is this problem ..
"Details:HY000:General error:Invalid file dsn "Database Vendor Code:556 "

when im trying to view the preverview of the report , i put the password and then show me this message

Details:HY000:General error:Invalid file dsn "Database Vendor Code:556


can you help me?

DellSC
Active Contributor
0 Kudos

What type of DB are you connecting to?  This particular error number (556) is passed through from the database.  In particular, it looks like the ODBC connection (based on the words "File DSN") is not set up correctly.

-Dell

former_member183750
Active Contributor
0 Kudos

The "database vendor error 556" indicates that the query to the database returned with error 556.  It's vendor specific.  Look up your database vendor's documented error codes, to see what 556 indicates.

Doing a bit of googling looks like the issue is that the ODBNC datasource does not exist. Remember that there are 32 bit and 64 bit ODBC datasources. If your app is 32 bit, the DSN must be 32 bit, if it is compiled as 64 bit the DSN must be 64 bit.

See KBA 1505620 - How to create a 32 bit ODBC data source on a 64 bit Operating System

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

Former Member
0 Kudos

my connection in DB is in SQLYog 

i think that the file is correct , what think about this ? 

Former Member
0 Kudos

thx for u comment Ludek
yes , i have the file of 32 bytes instaled in my pc

DellSC
Active Contributor
0 Kudos

Here's a link to an older discussion that might contain some helpful information.  Especially since you're talking about SQLyog database:  http://scn.sap.com/thread/1519593

-Dell

0 Kudos

Wrong odbcadm.exe, look for the one in c:\windows\syswow64 and use it. That is the 32 bit version

Also if you simply click on Start and type in odbc you should see both listed.

Don

Former Member
0 Kudos

thank you Don
but my pc is of 32 bits,

0 Kudos

OK then you only have the one Admin...

Interesting you are using Trusted Connection. For this type do not pass in user name and password so comment out those two line in you code.

I tested this and it now makes a connection and runs the report. If you attempt to log using Trusted and set user name and password then it will fail.

If you do not want to use Trusted then set the property to False:

crConnectioninfo.IntegratedSecurity = False

Don