cancel
Showing results for 
Search instead for 
Did you mean: 

adding a second dataset to a report - fails

Former Member
0 Kudos

I'm using Visual Studio 2008. In Design mode I'm able to attach to datasets to a report and get a preview. Now I'm trying to attach the data in the code. The report ran ok with a single dataset. It won't run with the second one attached.

The code I've got to load the viewer is:

myODA = New OracleDataAdapter(sSql, myConn) ' set the query for the data

' set the adapter to host the dataset object and it's structure

myODA.Fill(myData, repVW)

' tell the source what report to use

myRepDoc.FileName = Server.MapPath(repFile)

' tell the source what data to use

myRepDoc.SetDataSource(myData)

If repNo = 81 Then ' the lag report chart dataset

repVW2 = Session("RepVW2")

sSql = Session("RepSQL2")

myODA2 = New OracleDataAdapter(sSql, myConn)

myODA2.Fill(myData2, repVW2)

myRepDoc.SetDataSource(myData2)

End If

-


I can't seem to find an ASP example for a second source.

The error is:

Logon failed. Details: crdb_adoplus : Object reference not set to an instance of an object. Error in File C:\DOCUME1\VAAACO1\LOCALS~1\Temp\crLagReport {7ED5D479-C8D6-4FD8-B017-85199BD6BB55}.rpt: Unable to connect: incorrect log on parameters.

-


Is it possible to include a second dataset in .NET?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Chris,

I have never seen any code with 2 datasets.

Anyway, please see here some [VB samples for .NET|https://smpdl.sap-ag.de/~sapidp/012002523100006252812008E/net_web_smpl.exe].

Maybe you can change this code to your needs.

[Please see here for more samples|https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/bobj_download/main.htm]

Best regards

Falk

Answers (2)

Answers (2)

Former Member
0 Kudos

Ludek left the best response for this situation, or at least the easiest for me, which was to create a subreport with it's own dataset. One dataset is used for a chart and the other is used for a tabular output.

former_member183750
Active Contributor
0 Kudos

I actually realized - after Adam set me straight with his post, that I was wrong (E.G.; there is a way to do it), so I had him delete the post :). Funny how that turned out to be better solution anyhow.

Ludek

Adam_Stone
Active Contributor
0 Kudos

Are you wanting to have a different dataset for each table in the report?

If this is what you are wanting, I would suggest passing the datasets to the table specifically, ie

reportDoc.Database.Tables[0].SetDatasource(dataset.tables[0])

Your other option is to combine the two datasets into one dataset.