SAP Knowledge Base Article - Preview

1428217 - How to prefix the report database table location with a schema

Symptom

The following issue was resolved in the Crystal Reports .NET Development forum:

I am using CR Basic (version that comes with VB 2008). We set our connection properties through code for our Crystal Reports similar to:

Dim connection As ConnectionInfo
connection = New ConnectionInfo()
With connection
.ServerName = Our Server Name Here
.UserID = Our User ID Here
.Password = Our Password Here
.DatabaseName = Our Database Name Here
.Type = ConnectionInfoType.SQL
End With
Dim CRTableLogOnInfo As TableLogOnInfo
For Each Tbl As Table In Report.Database.Tables
CRTableLogOnInfo =Tbl.LogOnInfo
CRTableLogOnInfo.ConnectionInfo = connection
Tbl.ApplyLogOnInfo(CRTableLogOnInfo)
Tbl.Location = Our Schema Here & "." & Tbl.Location
Next

The issue is that the "ApplyLogOnInfo" method is slow and it needs executed for every report table in the main report and every report table in a sub report if a schema is used. I know there is a way to setup the connection information for the report table to use by using: "Report.DataSourceConnections.Item(0).SetConnection(Server Name, Database, User ID, Server Password)", but this only works if the report table is not prefixed with a schema.

My question:
Is there a way to set the schema for all reports tables in the report instead of looping through all the report tables on the main report and all the report tables in each sub report in the report?

It would be nice to have something like: "Report.DataSourceConnections.Item(0).SetConnection(Server Name, Database, User ID, Server Password, Schema)" which would do what the "Report.DataSourceConnections.Item(0).SetConnection(Server Name, Database, User ID, Server Password)" currently does, but also setup all the report tables (including tables in the sub reports) in the report to use the schema. In our case this would cut our 60-70 lines of code down to one line. Having one line of code would be nice, but it would also still need to execute fast. 


Read more...

Product

SAP BusinessObjects Business Intelligence platform all versions

Keywords

forum thread , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , How To

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.