Showing posts with label dataset. Show all posts
Showing posts with label dataset. Show all posts

Wednesday, March 28, 2012

Putting Data In Report Footer

Hi,
We have a field in our dataset which we want to appear in the footer
of each page in our report.
To do this, we have added a textbox to the body of the report and
reference this data in the footer using the following:
=ReportItems!site_code.Value
This works fine, except when the record overflows onto a second page.
When this happens, the value is printed as a blank on the second and
subsequent pages, until we come to print the next record.
Ideally, we'd like the value to be printed on each page of the report.
Does anyone know of a solution to this?No takers for this?
Seems like a limitation of the software.

Putting Data From DataTable/DataSet into SQL Server Table?

Hello,

I created this DataTable, add rows of data to it, and then display the data on to a form via a repeater.

Dim ds As DataSet = New DataSet
Dim dtTableName As DataTable = New DataTable("dtTableName")
dtTableName.Columns.Add("Description")
dtTableName.Columns.Add("ItemNumber")
dtTableName.Columns.Add("Quantity")
dtTableName.Columns.Add("Price")
ds.Tables.Add(dtTableName)

What I need to do now is create a table in SQL Server and update the database with the data I've collect in my dataset. How do I bind and update this data to a sql server table?

Thanks!
James

Check out this walkthrough (it uses a DataGrid and DataSet):
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbwlkWalkthroughUpdatingDataUsingDatabaseUpdateQueryInWebForms.asp

put delimited data in unconventional format in dataset

hi,

Im interfacing with an app that imports/exports data in a very specific hash-delimited format
like this:

#column1=Value1#column2=Value2#column3=Value3 etc.

How do i import this into a dataset so i can in my db.

Obviously ideal way would be to use the Jet text provider, but im not sure if the schema.ini can be setup to deal with this kind of data.

If anyone has ANY way of me getting this data into dataset please help.Have you can access to SQL DTS?

Tuesday, March 20, 2012

Pulling row values from a dataset using embedded code?

I am trying to figure out a way to pull the values of one of my report
columns once the report has been rendered to create a comma separated list of
those values to pass as a paramater to another report. I figure i will have
to do this in the code part of RS. Can anyone help me with the proper
functions and syntax to walk through the rows returned by my report and pull
the values from the column I need.
I imagine it would look like this
function GetItemList()
Dim rtnstr As String
Dim x As Interger
Set rtnstr = ""
for x = 0 to (RowNumber("DatasetName")-1)
rtnstr = rtnstr & DatasetName(x).ColumnName.Value & ","
next
return rtnstr
end function
What I am stuck on is how to pull the values from the column in the
particular dataset I need and also how to determine the Scope of the dataset
to know how long th loop needs to run for.
ThanksOut of the box, you can only base a report on the following data sources: SQL
Server, Oracle, OLE DB and ODBC. The data output by a report does not fall
into one of these categories; in other words, there is no data processing
extension that allows you to read data from one report into another report.
You should re-design your solution. What about writing a stored procedure
that writes the data to a second table, appending commas as required to
create the csv format you want? You could then report off this second table?
Charles Kangai, MCDBA, MCT
"jordang" wrote:
> I am trying to figure out a way to pull the values of one of my report
> columns once the report has been rendered to create a comma separated list of
> those values to pass as a paramater to another report. I figure i will have
> to do this in the code part of RS. Can anyone help me with the proper
> functions and syntax to walk through the rows returned by my report and pull
> the values from the column I need.
> I imagine it would look like this
> function GetItemList()
> Dim rtnstr As String
> Dim x As Interger
> Set rtnstr = ""
> for x = 0 to (RowNumber("DatasetName")-1)
> rtnstr = rtnstr & DatasetName(x).ColumnName.Value & ","
> next
> return rtnstr
> end function
> What I am stuck on is how to pull the values from the column in the
> particular dataset I need and also how to determine the Scope of the dataset
> to know how long th loop needs to run for.
> Thanks|||Hi Charles
My Report is already driven by a stored procedure, however, there are local
filters the user can apply to the report through the report viewer as well.
So As far as the stored proc generates the dataset, I'm good to handle those
results and create the list i need. The problem is when the user applies a
filter that is specific to that report and thus not sent back to the stored
proc. I was hoping there was a way I could avoid rewriting my stored proc to
include all my report parameters, or furthermore, writing another stored proc
to generate my list.
Thanks for your help.
"Charles Kangai" wrote:
> Out of the box, you can only base a report on the following data sources: SQL
> Server, Oracle, OLE DB and ODBC. The data output by a report does not fall
> into one of these categories; in other words, there is no data processing
> extension that allows you to read data from one report into another report.
> You should re-design your solution. What about writing a stored procedure
> that writes the data to a second table, appending commas as required to
> create the csv format you want? You could then report off this second table?
> Charles Kangai, MCDBA, MCT
>
> "jordang" wrote:
> > I am trying to figure out a way to pull the values of one of my report
> > columns once the report has been rendered to create a comma separated list of
> > those values to pass as a paramater to another report. I figure i will have
> > to do this in the code part of RS. Can anyone help me with the proper
> > functions and syntax to walk through the rows returned by my report and pull
> > the values from the column I need.
> >
> > I imagine it would look like this
> >
> > function GetItemList()
> > Dim rtnstr As String
> > Dim x As Interger
> > Set rtnstr = ""
> > for x = 0 to (RowNumber("DatasetName")-1)
> > rtnstr = rtnstr & DatasetName(x).ColumnName.Value & ","
> > next
> > return rtnstr
> > end function
> >
> > What I am stuck on is how to pull the values from the column in the
> > particular dataset I need and also how to determine the Scope of the dataset
> > to know how long th loop needs to run for.
> >
> > Thanks

Pulling info from the "current row" of one dataset into another

This is day 1 of me ever using RS so forgive ignorance of the topic.

Here's the basic scenario:

Input parameter from the user is an Account name.

For that account name I want to list Addresses of locations under the account, and then for each of those, I want to list received shipments from the address.

So Ideally the result is:

Account Name

Address 1

Shipment 1
Shipment 2
Shipment 3

Address 2

Shipment 1
Shipment 2

Address 3

Shipment 1

So, I am able to list the addresses just fine, but the next step is getting the stuff from the shipments table based on the currently running address? I'm probably saying that poorly. What I need to know is how do I structure the dataset/report to accomplish this. I suppose I could combine the query for the shipments with the query for the addresses, but that seems suboptimal to me.

TIA for the help.

Hello Scott,

If it is a one query i.e. one Dataset which gets al the AccountName, Address and Shipment then I would follow this.

1.) On the Toolbox, drag and drop the Table which is grid kinda structure.

2.) RightClick on the Table and add a Group and name it grpAccountName and from the dataset select the AccountName field in the field selection.

3.) On the first column of the grpAccountName drag and drop the AccountName field.

4.) Again RightClick on the Table and add a Group and name it grpAddress and from the dataset select the Address field in the field selection.

5.) On the First column of the grpAddress drag and drop the Address field from the dataset.

4.) Again RightClick on the Table and add a Group and name it grpShipment and from the dataset select the Shipment field in the field selection.

5.) On the Second column of the grpShipment drag and drop the Shipment field from the dataset

I think it should work. I have not tested it but I think this should solve your problem.

All the best.

Hope this helps...

--Deepak

Monday, February 20, 2012

Public DataTables in Busines Object

Good Day:

I have a business object with a set of public DataTables and Public Strongly Typed Dataset DataTable Types defined. When I add the business object class to the report as a datasource, only public System datatypes (int, string) show up. I added System.Data to the report properties Assemblies, with no change. Any ideas?

Thanks,

Omar

Hello:

I do not know if this is the best solution, but it worked for me. Anyway, I added the DataTable definition from the DAL to the report as a datasource. This gave me the visilibity for the fields. I was already loading the DataTables in the the business layer, so when the front end form call the report, I tie the binding source of the report form to the filled business object Data table present in BL. The result is a report with the field visibility I need and the data generated from the BL.

Thanks,

Omar