cancel
Showing results for 
Search instead for 
Did you mean: 

ConnectionInfo using 'COM Connectivity' in C#

Former Member
0 Kudos

I need to connect to a DLL using 'COM Connectivity" and a function to provide data for my crystal report in c#,

I have one report that gets populated via a database:

// DATABASE via ODBC-DSN

TableLogOnInfo tblLoginInfo = tbl.LogOnInfo;

tblLoginInfo.ConnectionInfo.ServerName = dsn;

blLoginInfo.ConnectionInfo.UserID = username;

tblLoginInfo.ConnectionInfo.Password = pw;

tbl.ApplyLogOnInfo(tblLoginInfo);

tbl.Location = db + "." + tbl.Name;

// this works great

I have another crystal report that is populated by COM Connectivity

// COM

TableLogOnInfo tblLoginInfo = tbl.LogOnInfo;

tblLoginInfo.ConnectionInfo.ServerName = "myclassname";

tblLoginInfo.ConnectionInfo.Type = ConnectionInfoType.CRQE;

// tbl.Location = ??

// this doesn't work. The report generated is empty/corrupted, but it gives no error

Thank you for your help,

Tammy

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Tammy,

Correct, that will never work, crqe is not a database driver.

What do you mean by COM Connectivity, what is the data source?

Do you mean a DataSet or a WEB Service?

Don

Former Member
0 Kudos

Hi Don,

The Datasource is a Dataset from a function call from a DLL.  I'm think I'm setting up the parameters wrong, but I can't find any examples for reference.

I get true returned when I run tbl.TestConnectivity().

When I run ExportToDisk to create the PDF, I get a completely blank tiny PDF.

Any help would be appreciated,

Tammy

0 Kudos

Hi Tammy,

Run the report from the IDE and preview it Then from the viewer export to RPT format. Now open that report up in you app and do you see data when exported?

Could be you are not setting the export code correctly.

Try viewing the report by adding the CR viewer to a Form and export the report from the Export button.

Sorry, I don't have your code so I can't help you debug it...

Don

Former Member
0 Kudos

Thanks Don,

I was able to solve my problem and have working c# code where my Crystal report pulls data from both a Database and a custom dll.

Previewing the report and re--exporting it helped.

Thanks again!

Answers (0)