Data source data can not used in another data source as a variable

Stimulsoft Reports.NET discussion
Post Reply
ngoptr
Posts: 2
Joined: Tue Jun 09, 2009 11:45 am

Data source data can not used in another data source as a variable

Post by ngoptr »

In the older version, I was able to use data from a data source in another data source, but use it as a variable. After I update/upgrade to the 2009 version, it keep saying "Object reference not set to an instance of an object." when I try to preview the report.

For example:
I have dsDataSet1, and dsDataSet2. In the query text of dsDataSet2, I have:
SELECT * FROM Table1 WHERE ColumnName = {dsDataSet1.ColumnName}

Any help is appreciated and thank you.
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Data source data can not used in another data source as a variable

Post by Jan »

Hello,

I think problem in order of datasources in report dictionary. If one datasource come in report dictionary before sedond you can't use field from second in first datasource, because second is not connected.

Thank you.
ngoptr
Posts: 2
Joined: Tue Jun 09, 2009 11:45 am

Data source data can not used in another data source as a variable

Post by ngoptr »

The order of the dataset is this: dsDataSet1 is first, then the dsDataSet2 come in second. It always top to bottom. I call the field that come before, not after.
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Data source data can not used in another data source as a variable

Post by Jan »

Hello,

Please set ConnectOnStart property of dsDataSet2 to false. In BeforePrintEvent of first page write following code:

Code: Select all

dsDataSet2.Connect();
Let me know about results.

Thank you.
Post Reply