Crystal 8.5/VB.NET (Connecting) 
Author Message
 Crystal 8.5/VB.NET (Connecting)

I have an RPT file that I've created that pulls from our SQL Server.  The
conclusion I've come to is that in order to open this report and pull data
from SQL, I have to use SetDataSource and set it to a DataSet with the
appropriate Tables/Data in it.  Is this the case?  I'd really like my end
users to not have to log on to our SQL Server directly (don't mind if it's
in underlying code).  If I just set the ReportSource of the Viewer to the
file, it prompts me for a SQL login and even if I enter it correctly, it
says Logon Failed.  Any idea how I can embed all the connection info into
the RPT file or some how cause it not to need a dataset because the entire
point was that our data department could create the reports on their own and
not have to come running to programming all the time.

Thanks a million,
Jim



Sat, 16 Oct 2004 22:17:07 GMT  
 Crystal 8.5/VB.NET (Connecting)
I am sending you information for crystal 8.5 Hope this will give you the
direction in .NET platform.

dim objcrapp as craxdrt.application
dim objreport as CRAXDRT.report
dim objDB as craxdrt.database

dim sDLLName as string

sDLLName = "p2sodbc.dll"

set objcrapp = new craxdrt.application
set objreport = objcrapp.netreport
set objdb = objreport.database

set objreport = objcrapp.openreport("report path")

objdb.logonserver sDLLName, DSN, "DatabseName", UserID, Password

objDB.Verify 'if error then exit sub with a user defined error

This works for me with out promption for userID and password.

If this is what exactly you have done and still it is prompting for user id
then check for the report design. Have you used trusted connection or SQL
log on?
If you have used trusted connection then the report will run only on your
machine.

Hope this helps.

--SriT


Quote:
> I have an RPT file that I've created that pulls from our SQL Server.  The
> conclusion I've come to is that in order to open this report and pull data
> from SQL, I have to use SetDataSource and set it to a DataSet with the
> appropriate Tables/Data in it.  Is this the case?  I'd really like my end
> users to not have to log on to our SQL Server directly (don't mind if it's
> in underlying code).  If I just set the ReportSource of the Viewer to the
> file, it prompts me for a SQL login and even if I enter it correctly, it
> says Logon Failed.  Any idea how I can embed all the connection info into
> the RPT file or some how cause it not to need a dataset because the entire
> point was that our data department could create the reports on their own
and
> not have to come running to programming all the time.

> Thanks a million,
> Jim



Mon, 18 Oct 2004 21:28:17 GMT  
 Crystal 8.5/VB.NET (Connecting)
I'm unable to access the CRAXDRT namespace.  Where is it located?

Thanks,
Jim


Quote:
> I am sending you information for crystal 8.5 Hope this will give you the
> direction in .NET platform.

> dim objcrapp as craxdrt.application
> dim objreport as CRAXDRT.report
> dim objDB as craxdrt.database

> dim sDLLName as string

> sDLLName = "p2sodbc.dll"

> set objcrapp = new craxdrt.application
> set objreport = objcrapp.netreport
> set objdb = objreport.database

> set objreport = objcrapp.openreport("report path")

> objdb.logonserver sDLLName, DSN, "DatabseName", UserID, Password

> objDB.Verify 'if error then exit sub with a user defined error

> This works for me with out promption for userID and password.

> If this is what exactly you have done and still it is prompting for user
id
> then check for the report design. Have you used trusted connection or SQL
> log on?
> If you have used trusted connection then the report will run only on your
> machine.

> Hope this helps.

> --SriT



> > I have an RPT file that I've created that pulls from our SQL Server.
The
> > conclusion I've come to is that in order to open this report and pull
data
> > from SQL, I have to use SetDataSource and set it to a DataSet with the
> > appropriate Tables/Data in it.  Is this the case?  I'd really like my
end
> > users to not have to log on to our SQL Server directly (don't mind if
it's
> > in underlying code).  If I just set the ReportSource of the Viewer to
the
> > file, it prompts me for a SQL login and even if I enter it correctly, it
> > says Logon Failed.  Any idea how I can embed all the connection info
into
> > the RPT file or some how cause it not to need a dataset because the
entire
> > point was that our data department could create the reports on their own
> and
> > not have to come running to programming all the time.

> > Thanks a million,
> > Jim



Mon, 18 Oct 2004 22:44:26 GMT  
 Crystal 8.5/VB.NET (Connecting)
If you are being prompted for logon then you must be connecting directly to
the database.  if so, you will need similar code to this to suppress the
logon:

Dim myRpt2 As New Commercial_Statistics()

        Dim logonInfo As New CrystalDecisions.Shared.TableLogOnInfo()
        Dim table As CrystalDecisions.CrystalReports.Engine.Table

        ' Set the logon information for each table.
        For Each table In myRpt2.Database.Tables
            ' Get the TableLogOnInfo object.
            logonInfo = table.LogOnInfo
            ' Set the server or ODBC data source name, database name,
            ' user ID, and password.
            logonInfo.ConnectionInfo.ServerName = "NWS"
            logonInfo.ConnectionInfo.DatabaseName = "WOOLSYS"
            logonInfo.ConnectionInfo.UserID = "sa"
            logonInfo.ConnectionInfo.Password = "sa"
            ' Apply the connection information to the table.
            table.ApplyLogOnInfo(logonInfo)
        Next table

        CrystalReportViewer1.ReportSource = myRpt2

You are correct in that you can supply a dataset at run-time, but the report
will have to have been designed for this.  This is all well documented on
the crystal site:

http://www.crystaldecisions.com/x-jump/scr_net/

Laurie Paulin


Quote:
> I have an RPT file that I've created that pulls from our SQL Server.  The
> conclusion I've come to is that in order to open this report and pull data
> from SQL, I have to use SetDataSource and set it to a DataSet with the
> appropriate Tables/Data in it.  Is this the case?  I'd really like my end
> users to not have to log on to our SQL Server directly (don't mind if it's
> in underlying code).  If I just set the ReportSource of the Viewer to the
> file, it prompts me for a SQL login and even if I enter it correctly, it
> says Logon Failed.  Any idea how I can embed all the connection info into
> the RPT file or some how cause it not to need a dataset because the entire
> point was that our data department could create the reports on their own
and
> not have to come running to programming all the time.

> Thanks a million,
> Jim



Tue, 19 Oct 2004 10:45:45 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Crystal 8.5/VB.NET (Connecting)

2. Crystal Reports 8.5 (VB6) to Crystal Reports NET (VB.NET) conversion

3. vb .net crystal reports not compatible with Crystal Reports 8.5

4. How to connect Crystal Report 8.5 to VB 6

5. Crystal Report 8.5 and VB .net

6. Crystal 8.5 Pro and Crystal from VS.Net

7. Crystal Report 8.5 and connecting to SQL Server?

8. Problems connecting to Web Report Server in Crystal 8.5

9. Crystal 8.5 and .NET licensing question

10. Crystal 8.5 and .NET : Incompatible ?

11. Crystal Upgrade to 8.5 or .NET ?

12. Crystal 8.5 and .NET licensing question

 

 
Powered by phpBB® Forum Software