Showing posts with label encountered. Show all posts
Showing posts with label encountered. Show all posts

Sunday, March 25, 2012

Datasets in Data regions

I have encountered a problem in one of my reports.
I use multiple datasets, and inside a List I have two matrices, one for my
'income' dataset and one from my 'cost' dataset. The List uses a field from
the 'income' dataset as it's 'Details Grouping'.
My problem is that even though i explicitly set the data source for the
second matrix to my 'cost' dataset, it still access the 'income' dataset. I
looked in the RDL-file and the <DataSetName> fields is correctly set as
'cost'.
Furthermore; when using the expression editor in a field in the cost-matrix,
I can only choose fields from the 'income' dataset...
Any clues as to what causes this?Your matrices are in the List data region. All items in the same data region
must use the same dataset. That is why you are getting this problem. You have
to change how you are doing this. Perhaps you need to use subreports inside
the list data region? Create a separate report for each of the matrix regions
that needs to have a different dataset. Each report must use a parameter if
you want to filter the data returned in the matrix. Add a subreport control
to the list data region and link to the report you just created, passing the
correct parameter(s) to return the data you need.
HTH
Charles Kangai, MCT, MCDBA
"Kristian Vinther" wrote:
> I have encountered a problem in one of my reports.
> I use multiple datasets, and inside a List I have two matrices, one for my
> 'income' dataset and one from my 'cost' dataset. The List uses a field from
> the 'income' dataset as it's 'Details Grouping'.
> My problem is that even though i explicitly set the data source for the
> second matrix to my 'cost' dataset, it still access the 'income' dataset. I
> looked in the RDL-file and the <DataSetName> fields is correctly set as
> 'cost'.
> Furthermore; when using the expression editor in a field in the cost-matrix,
> I can only choose fields from the 'income' dataset...
> Any clues as to what causes this?|||I combined my datasets into one, and instead used a Filter on my
matrix-rowgroups. That did the trick.
Thanks for your reply.
"Charles Kangai" wrote:
> Your matrices are in the List data region. All items in the same data region
> must use the same dataset. That is why you are getting this problem. You have
> to change how you are doing this. Perhaps you need to use subreports inside
> the list data region? Create a separate report for each of the matrix regions
> that needs to have a different dataset. Each report must use a parameter if
> you want to filter the data returned in the matrix. Add a subreport control
> to the list data region and link to the report you just created, passing the
> correct parameter(s) to return the data you need.
> HTH
> Charles Kangai, MCT, MCDBA
> "Kristian Vinther" wrote:
> > I have encountered a problem in one of my reports.
> >
> > I use multiple datasets, and inside a List I have two matrices, one for my
> > 'income' dataset and one from my 'cost' dataset. The List uses a field from
> > the 'income' dataset as it's 'Details Grouping'.
> >
> > My problem is that even though i explicitly set the data source for the
> > second matrix to my 'cost' dataset, it still access the 'income' dataset. I
> > looked in the RDL-file and the <DataSetName> fields is correctly set as
> > 'cost'.
> > Furthermore; when using the expression editor in a field in the cost-matrix,
> > I can only choose fields from the 'income' dataset...
> >
> > Any clues as to what causes this?

Thursday, March 22, 2012

Dataset limitation

I have encountered a really strange error regarding using Unions in my
datasets.
If i exceed the limit of 4 unions in my dataset, it ignores the data for
those 4 unions and only gives me the data from the 5th union and onwards
until it reaches the limit of again 4 unions, i.e. 8 for the second time
around.
Has anyone else encountered this kind of error/ limitation' Any suggestions
are welcome.
Thanks,
NatWhat type is the data source? SQL Server? What happens if you run the same
query in Query Analyzer?
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Nat" <Nat@.discussions.microsoft.com> wrote in message
news:288F50E7-DF2F-408E-B416-1E2C1558487E@.microsoft.com...
>I have encountered a really strange error regarding using Unions in my
> datasets.
> If i exceed the limit of 4 unions in my dataset, it ignores the data for
> those 4 unions and only gives me the data from the 5th union and onwards
> until it reaches the limit of again 4 unions, i.e. 8 for the second time
> around.
> Has anyone else encountered this kind of error/ limitation' Any
> suggestions
> are welcome.
> Thanks,
> Natsql

Wednesday, March 21, 2012

DataSet Bug?

Hi,
###Problem 1###
I've encountered serveral times on this problem Every time when I used store
procedure to create a datatset. In the store procedure, it cannot have more
then 2 select statement even though the first select state is only shown when
a flag is turned on. For example :
...
set @.debug=0
if @.debug=1
select * from ABC
Select X, Y, Z from WWW
...
The dataset will shows the 1st select statement instead of the 2nd. I've to
deleted the those unwanted lines before my dataset is correct. Is this a bug?
###Problem 2###
Currently, I'm facing another problem with DataSet ...:(
This time when i wrote a intensive coding in the store procedure with
consists of quite a number of insert Temp tables. When I run the store
procedure using the Query Analyzer, my dataset is correct. However when I
used Reporting Services, I'm unable to get the correct dataset. Why is this
so?
Any help is definitely appreciated... ThanksPls ignore the 2nd problem. I've found the root cause. my Applogies...;P
But the 1st problem, i've encountered several times.
"Samie" wrote:
> Hi,
> ###Problem 1###
> I've encountered serveral times on this problem Every time when I used store
> procedure to create a datatset. In the store procedure, it cannot have more
> then 2 select statement even though the first select state is only shown when
> a flag is turned on. For example :
> ...
> set @.debug=0
> if @.debug=1
> select * from ABC
> Select X, Y, Z from WWW
> ...
> The dataset will shows the 1st select statement instead of the 2nd. I've to
> deleted the those unwanted lines before my dataset is correct. Is this a bug?
>
> ###Problem 2###
> Currently, I'm facing another problem with DataSet ...:(
> This time when i wrote a intensive coding in the store procedure with
> consists of quite a number of insert Temp tables. When I run the store
> procedure using the Query Analyzer, my dataset is correct. However when I
> used Reporting Services, I'm unable to get the correct dataset. Why is this
> so?
> Any help is definitely appreciated... Thanks

Sunday, February 19, 2012

database....help?

i got new project again similar to my previous project but i never encountered doing it b4.

hmmmm the scenario is:

i have a drobdownlist for a office_name and a text box for "date"(2007/11/03). after choosing a name from a drop down and writing a date in the textbox when i press the button (ok) a datagrid will appear with its data.

"office_name" field is in table (TM0011) and "year.month.date" is in table (TT0001).

In the gridview.i need to show the time_in,time_out and the name of the employee.

"time in" and "time_out" fields are in the table (TT0001) and syain_name field is in table(TM0001).the only connection they have is the "syain_id".coz both table have "syain_id" as key.

I have two option in my code.. which do u think will most likely work? the inner join or union?

here is my code:

Protected Sub Button_date_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button_date.Click

GridView_info.Visible = True

'////////// option 1 //////////////////
Dim MyConn As New SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("MS_PKG01ConnectionString").ConnectionString)
MyConn.Open()
Dim stringQuery As String = "select TT0001.*,TM0001.*,TM0011.* from TT0001 inner join TM0001 on TT0001.syain_id = TM0001.syain_id " '+ Request.requerystring("syain_id")
Dim sqldataadapter As New SqlClient.SqlDataAdapter(stringQuery, MyConn)

Dim ds As New DataSet()
sqldataadapter.Fill(ds, "TT0001")
GridView_info.DataSourceID = ""
GridView_info.DataSource = ds
GridView_info.DataBind()
MyConn.Close()

'/////////option 2 ///////////////////
'Dim MyConn As New SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("MS_PKG01ConnectionString").ConnectionString)
'MyConn.Open()

'Dim stringQuery As String = " select TT0001.syain_id,TT0001.year,TT0001.month,TT0001.day,TT0001.in_hh,TT0001in_mi,TT0001out_hh,TT0001out_mi From TT0001 Where TT0001.syain_id = TM0001.syain_id and TT0001.syain_id = " + Session("syain_id") + " Union Select TM0001.syain_id,TM0001.syain_name From TM0001 Where TM0001.syain_name = TTM0001.syain_name and TM0001.syain_id = " + Session("syain_id") + " "
'Dim stringQuery2 As String = "SELECT * from tempo_db"

'Dim SQLcommand1 As New SqlClient.SqlCommand("Drop table tempo_db", MyConn)
'SQLcommand1.ExecuteNonQuery()

'Dim SQLcommand2 As New SqlClient.SqlCommand("Create table tempo_db ( year char(4), month(2), day char(2), in_hh(2),in_mi(2), out_hh(2),out_mi(2) )", MyConn)
'SQLcommand2.ExecuteNonQuery()

'Dim sqldataadapter As New SqlClient.SqlDataAdapter(stringQuery, MyConn)
'Dim ds As New DataSet()
'Dim foundrow, temprow As DataRow

'Dim ds2 As New DataSet
'Dim temp_data_table As New DataTable
'sqldataadapter.Fill(ds, "TT0001")

'Dim sqldataadapter2 As New SqlClient.SqlDataAdapter(stringQuery2, MyConn)
'sqldataadapter2.Fill(ds2, "tempo_db")

'Dim date_ctr As Integer
'date_ctr = 1
'GridView_info.DataSourceID = ""
'GridView_info.DataSource = ds
'GridView_info.DataBind()
'MyConn.Close()

End Sub

thank you...

From your description I think JOIN is the proper solution. BTW, you may need Parameterized Query to prevent SQL Injection.

Pose again if you have any other problem on this.|||

hi thank you... the problem was just solved awhile ago... but thanks...

btw, are u familiar with hyperlink? coz i dont know how to put hyperlink ...

coz all the data's being shown in my gridview are generated automatically...

how can i put hyperlink on one of the columns if its not coded in html?