Print Page | Close Window

Object reference not set to an instance of ...

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=12808
Printed Date: 06 May 2024 at 9:23pm


Topic: Object reference not set to an instance of ...
Posted By: Matheuus
Subject: Object reference not set to an instance of ...
Date Posted: 05 Apr 2011 at 4:27am
Hi, i'm trying to export a report to a PDF file.

I have a dataset.xsd with a few tables inside.

When i set the data source for this report by clicking with the right button on Database Field (at Field Explorer) and clicking on Set Datasource Location then specifying the exactly dataset path my app works fine. But what i need is do not specify the exactly path, i need that the app finds out for the dataset (I set only the dataset name, not the full dataset path) - this is what my boss says.

Here goes my code (This 3 tables i have inside my dtset):

iReport.Database.Tables["T9805_Ocorrencias_Notifcacoes_TEMP"].SetDataSource(_Tabela);                    iReport.Database.Tables["T0006_Orgao"].SetDataSource(DtImagem.Tables[0]);                iReport.Database.Tables["Cabecalho"].SetDataSource(DtCabecalho);

Ohhh! I almost forget to tell you guys what i got when i tried to set only the dataset name.

This is the error line:

iReport.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, false, "ExportedReport");

Here goes the error message:

Logon failed. Detais: crdb_adoplus:Object reference not set to an instance of an object.


Thanks! Big%20smile
Matheus.



Print Page | Close Window