on 08-07-2008 2:28 PM
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.