
Signature
This posting is provided "AS IS" with no warranties, and confers no rights.
Charles,
> Was ds1 full of your required data after the Fill method was called?
No it fails with error.
> As far
> as I know, a dataset object itself does not provide such function.
Note that I am trying to run the fill agains the tableAdapter not the
dataSet
ds1.TempReportData.Fill();
In Windows Forms a fill looks like this:
this.taPhase.Fill(this.dsHipAdmin.Phase);
But then in windows Forms there is a componet tray where a tableAdapter is
put which is referencing the TableAdapter in the XSD, ut there is no
corresponding functionality in web forms. Yes youcan open a Component
Designer for the page (aspx) and drag a DataSet and BindingSoucrce to it but
not a TableAdapter.
> To fill
> a dataset from your database, you need to use some method like
> SqlDataAdapter.Fill().
This is the same as my statement
ds1.TempReportData.Fill();
ds1 is where the table adapter is and
TempReportData is my table adapter
This is all contained in my XSD.
Am I missing something?
> An empty dataset object can directly merge a table,
> so if you only had a SqlDataSource, you can directly get the DataView
> object by using the following code:
I am very happy to use a SqlDataSource but I do not know who to fill it.
When I try the SqlDataSource1.Fill it is unrecognized by intelisense and not
contained within the intellisense selection.
> You said that you had got a full set of data,
I had not had to use a fill method. It is when page or the view where the
ReportViewer resides is made active that sometiow the SqlDataSource or the
ObjectDataSource on which it depends is automatically filled. However I
cannont find any specific code which performs that command.
> Regarding the dataset name, a RDLC must have a dataset, otherwise how did
> you design your report?
The report was designed winthin Reporting services and then imported into
the web project. RDL files contain a dataset, but RDLC files do not
(qualifier RDLC files which are made from RDL files do but that part of the
XML is not used.) RDLC files must have a data source assigned to them. The
dataSource is assigned to the RDLC file through the ReportViewer.
If you associate a SqlDataSource with the ReportViewer along with the RDLC
file then the SqlDataSource is configured with a connection string, a table
or a stored procedure with the parameters wired to the source of the
parameters. One does not usually have any direct access to that
SqlDataSource - it is dedicated to the ReportViewerer or what ever data
consumer one is useing.
If you associate an ObjectDataSource with the ReportViewer along with the
RDLC, it is the ObjectDataSource that references the TableAdapter inside the
XSD file.
I don't know of any other way to supply data to the Report than via the
ReportViewer. Why you assign a DataSource to a report thorugh code you are
still doing it thorugh the ReportViewer.
>You can open your .rdlc file with XML Editor and
> then click Ctrl+F to find "DataSet", and then you can find the dataset
> name
> for your .RDLC. After that set it to rptds.Name.
Yes you *may* find a dataset there - only if it began its lilfe as an RDL
file. But as an RDLC that DataSet is not used.
See - http://msdn2.microsoft.com/en-us/library/ms252109(VS.80).aspx about
how the RDLC DataSet is not used.
So it seems the two unanswered questions
1.) If I need a name for the ReportDataSource or if it matters what the name
is
2.) How to fill a SqlDataSource or How to fill a tableAdapter inside my XSD
DataSet.
Thanks,
Doug
Charles,
I was speaking with someone today that told me that the data I am expecting
to filter will not be available between post backs. I said I thought it
could be stored locally. He said that a compete dataset for a large report
would be too much to transmitt and too much to store. He referred to
runat=server and said no it is stored on the server and if too many
individuals store it there it will be too much to store.
Please address the discussion of the dataset not being available after
postback. The web environment is relatively new to me as is the postback
concept..
Thanks,
Doug
Charles Wang [MSFT] - 15 Jul 2008 10:10 GMT
Hi Doug,
Yes, he is right. By default, if you directly use the dataset in your
webpage, after a post back, the original dataset will not be there, however
there are many ways can help you store your dataset in your web server,
such as global static variable, or using Session or Cache. In this case,
the data will be stored in your server memory until you explicitly clear
it. You can directly reference it even after many post backs :).
For example:
if(Session["MyReportDataSource"] ==null)
Session["MyReportDataSource"] = theDataSet;
To get the value from the session, you can use the code like the following:
DataSet ds = Session["MyReportDataSource"] as DataSet;
Please note that if you store a large dataset in your server, there would
be much memory consumed. Before you adapt the solution, ensure that you do
not encounter memory pressure.
Hope this helps. Please feel free to let me know if you have any other
questions or concerns. Have a nice day!
Best regards,
Charles Wang
Microsoft Online Community Support
=========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msdnmg@microsoft.com.
=========================================================

Signature
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================