Showing posts with label total. Show all posts
Showing posts with label total. Show all posts

Thursday, March 29, 2012

Adding a step to CreateUserWizard

Hey all,

I'm working in Visual Web Developer 2005 Express. I'm a total newb so please bare with me. I'm trying to add a step to my CreateUserWizard that I put in using the automatic site administration utility. I've added a wizard step in between the "Sign up for your new account" step and the "complete" step. The purpose of the new step is to collect additional information about the user. I've added a FormView control and used an SQLDataSource to link it to a new table in the database established by the administration utility, and set up the templates to recieve the data.


The one kink in the process seems to be associating the UserID created in step one with the additional information submitted in step 2. I made a UserID column, of data type uniqueidetifier in my new table and set up a foreign key relationship with the UserID columns in the aspnet_Membership table and the aspnet_Users table. When I run it as is I get the following error after I try to insert the data entered in the second step (additional information) into my new database table:

Implicit conversion from data type sql_variant to uniqueidentifier is not allowed. Use the CONVERT function to run this query

I guess my question is:How do I take the UserID generated in step 1, and pass it into the new table and into the new row being created in step 2? If possible, I would like to do it without any code (haha probably not going to happen, but worth a shot) but any assistance anyone could offer would be greatly appreciated. Thanks everyone.

Matt Downey

You can grab the userID like this

Membership.GetUser(CreateUserWizard1.UserName).ProviderUserKey

where createuserwizard1 is the ID of the 1st step of your wizard.

Tuesday, March 20, 2012

adding 2 columns in a dataset as a single column in datagrid

hi,

i am having 2 columns in a table in a dataset.

i want to add those two columns and bind the resultant total as a single column to the datagrid.

is it possible.

if yes, how o acheive this?

please help me.

thanks in advance.

muppidi.

A lot of ways. One is to use a computed column in the dataset, then just bind to that. Another way is to use something like this in your page:

<%= Eval("column1")+Eval("column2") %>

added two more user parameters

I have a stored procedure that works fine in reporting services. It grabs the total of Yes's and No's by dates . But then i went ahead and added 2 more parameters to the proc, and now the totals are all wrong. I dont understand how that can mess everything up. Here is the previous stored proc, that gives the correct sum.

Code Snippet

ALTER PROCEDURE [dbo].[Testing_Questions_ALL_YESOrNO]

@.Question char(80)

AS

BEGIN

SELECT

Qry_Questions.Question

, Qry_Questions.Date

, Qry_Questions.response

, B.Total

FROM Qry_Questions

INNER JOIN Qry_Sales_Group

ON dbo.Qry_Questions.sales_person_code COLLATE SQL_Latin1_General_CP1_CI_AS = dbo.Qry_Sales_Group.SalesPerson_Purchaser_Code

INNER JOIN

( Select COUNT(qq.response)as Total, Question, Date, response

FROM Qry_Questions qq

Where qq.response in ('Yes','No')

GROUP by qq.[Question] , qq.Date,qq.response ) B

ON Qry_Questions.Date = B.Date AND

Qry_Questions.Question =B.Question and

Qry_Questions.response=B.response

WHERE Qry_Questions.[Response Type]='YesNo' and Qry_Questions.Question=@.Question

GROUP BY Qry_Questions.question,Qry_Questions.Date,Qry_questions.Response,B.Total

ORDER BY Qry_Questions.Question, Qry_Questions.Date

END

SET NOCOUNT OFF

Here is the edited version which only has two new parameters added to the proc. The edits are highlighted.

Code Snippet

ALTER PROCEDURE [dbo].[Testing_Questions_ALL_YESOrNO_Totals]

(@.Region_Key int=null,@.QuestionCode char(5),@.Question char(80))

AS

BEGIN

SELECT

Qry_Questions.Question

, Qry_Questions.Date

, Qry_Questions.response

, B.Total

FROM Qry_Questions

INNER JOIN Qry_Sales_Group

ON dbo.Qry_Questions.sales_person_code COLLATE SQL_Latin1_General_CP1_CI_AS = dbo.Qry_Sales_Group.SalesPerson_Purchaser_Code

INNER JOIN

( Select COUNT(qq.response)as Total, Question, Date, response

FROM Qry_Questions qq

Where qq.response in ('Yes','No')

GROUP by qq.[Question] , qq.Date,qq.response ) B

ON Qry_Questions.Date = B.Date AND

Qry_Questions.Question =B.Question and

Qry_Questions.response=B.response

WHERE Qry_Questions.[Response Type]='YesNo'

AND REGION_KEY=@.Region_Key

AND LEFT(Qry_Questions.[Question Code],2)IN (@.QuestionCode)

AND Qry_Questions.Question=@.Question

GROUP BY Qry_Questions.question,Qry_Questions.Date,Qry_questions.Response,B.Total

ORDER BY Qry_Questions.Question, Qry_Questions.Date

END

SET NOCOUNT OFF

Looks to me like when you're calling the SPROC, you're not passing in all of the Region_Key's or all of the possible Question_Code's. The SPROC syntax looks fine, assuming you're sure that the LEFT function is working correctly.

To find out exactly what's wrong, I would recommend isolating your changes one by one. Test the SPROC with only the Region_Key param and see what you get. If it's right, test with only the Question_Code param. Then try together. Problems like this are frequently caused by you not realizing that there are NULLs or blanks in your data, and so when you pass certain parameters, it will exclude other rows and therefore throw off your totals.

Hope that helps.
|||Just to add to above post, you have defined QuestionCode as char(5) in the param list, yet inside the proc you are doing left(question code, 2). You may be truncating some data and comparing with incorrect data.

|||

It's actually giving me a number way too big. A Sum way more then when i take the paramaters out. The Stored procedure works fine for another report i have with the same detail. But when i added these two additional parameters, for some reason it gives me a number way higher then if it didnt have any parameters at all.

|||Could you post the DDL and input params for the updated SP. I am hoping RegionKey is coming out of Qry_sales_Group and is it part of key or does it have multiple rows for the same value?
|||

I got it to work. I figured out that the sub query needed to be changed for this report because i was totaling based on region and question this time.

Code Snippet

INNER JOIN

( Select COUNT(qq.response)as Total, Question, Date, response

FROM Qry_Questions qq

INNER JOIN Qry_Sales_Group

ON Qry_Sales_Group.SalesPerson_Purchaser_Code = qq.sales_person_code COLLATE SQL_Latin1_General_CP1_CI_AS

Where qq.response in ('Yes','No')and Region_Key=@.Region_Key

GROUP by qq.[Question] , qq.Date,qq.response ) B

Thanks for the help. I went and piece every little piece til i relized it wasnt seperating them by regions.

Monday, March 19, 2012

add total row to file via script component

Hi, I have a flat file source going into a script component which manipulates some values and puts those values in a flat file destination. What I now need to do is total a column within the script component and add that value as a row to the destination. At the moment data from source looks something like

ABC, 3

DEF, 5

FGH, 6

I have a variable in script component holding the running total I now want to add that to destination as a row e.g.

ABC, 3

DEF, 5

FGH, 6

Total, 14

This is probably very easy but I don't now how to add the Total row via the component. At the moment all rows are manipulated in the ProcessInputRow sub of component and output column values are assigned here. How do I add the Total row as I need to do this once last input row is complete.

Thanks

You'll need to use an asynchronous output to accomplish this. You could add an async output in addition to the synchronous output you get by default, and just write the running total to it.

See this topic in Books Online:

"Creating an Asynchronous Transformation with the Script Component"

|||You could also just use a multicast and an Aggregate transform to accomplish the same thing.|||Great thanks, Asynchronous Transformation worked

add total row to file via script component

Hi, I have a flat file source going into a script component which manipulates some values and puts those values in a flat file destination. What I now need to do is total a column within the script component and add that value as a row to the destination. At the moment data from source looks something like

ABC, 3

DEF, 5

FGH, 6

I have a variable in script component holding the running total I now want to add that to destination as a row e.g.

ABC, 3

DEF, 5

FGH, 6

Total, 14

This is probably very easy but I don't now how to add the Total row via the component. At the moment all rows are manipulated in the ProcessInputRow sub of component and output column values are assigned here. How do I add the Total row as I need to do this once last input row is complete.

Thanks

You'll need to use an asynchronous output to accomplish this. You could add an async output in addition to the synchronous output you get by default, and just write the running total to it.

See this topic in Books Online:

"Creating an Asynchronous Transformation with the Script Component"

|||You could also just use a multicast and an Aggregate transform to accomplish the same thing.|||Great thanks, Asynchronous Transformation worked

Tuesday, March 6, 2012

add MatrixRow for total and subtotal

Hi,
How could I add MAtrixRow for total and subtotal?
Or is any other way can do total and subtotal on Matrix?
I see the FoodmartSales.rdl of Reporting Service Example..
How could the Example add a MatrixRow for total and subtotal?
Thanks!
AngiIf you right click in a matrix row or column group cell you will find an
option to add a subtotal.
Note the green triangle in the upper right corner of the subtotal cell. If
you click this properties window will display the style properties for the
subtotal.
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"angi" <angi@.microsoft.com> wrote in message
news:uX8%23Y4NZEHA.3432@.TK2MSFTNGP10.phx.gbl...
> Hi,
> How could I add MAtrixRow for total and subtotal?
> Or is any other way can do total and subtotal on Matrix?
> I see the FoodmartSales.rdl of Reporting Service Example..
> How could the Example add a MatrixRow for total and subtotal?
> Thanks!
> Angi
>|||Thanks!
"Bruce Johnson [MSFT]" <brucejoh@.online.microsoft.com> ¼¶¼g©ó¶l¥ó·s»D
:#1wfURSZEHA.3596@.tk2msftngp13.phx.gbl...
> If you right click in a matrix row or column group cell you will find an
> option to add a subtotal.
> Note the green triangle in the upper right corner of the subtotal cell. If
> you click this properties window will display the style properties for the
> subtotal.
> --
> Bruce Johnson [MSFT]
> Microsoft SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "angi" <angi@.microsoft.com> wrote in message
> news:uX8%23Y4NZEHA.3432@.TK2MSFTNGP10.phx.gbl...
> > Hi,
> >
> > How could I add MAtrixRow for total and subtotal?
> > Or is any other way can do total and subtotal on Matrix?
> > I see the FoodmartSales.rdl of Reporting Service Example..
> > How could the Example add a MatrixRow for total and subtotal?
> >
> > Thanks!
> > Angi
> >
> >
>|||No. However this is on the feature wish list.
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Laura" <Laura@.discussions.microsoft.com> wrote in message
news:026DFC5F-574E-462A-B41D-DAA671ED55D7@.microsoft.com...
> Hi Bruce,
> Is there a way to edit the expression on this Subtotal? Thanks.
> "angi" wrote:
> > Thanks!
> >
> > "Bruce Johnson [MSFT]" <brucejoh@.online.microsoft.com> ¼¶¼g©ó¶l¥ó·s»D
> > :#1wfURSZEHA.3596@.tk2msftngp13.phx.gbl...
> > > If you right click in a matrix row or column group cell you will find
an
> > > option to add a subtotal.
> > > Note the green triangle in the upper right corner of the subtotal
cell. If
> > > you click this properties window will display the style properties for
the
> > > subtotal.
> > >
> > > --
> > > Bruce Johnson [MSFT]
> > > Microsoft SQL Server Reporting Services
> > >
> > > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> > >
> > >
> > > "angi" <angi@.microsoft.com> wrote in message
> > > news:uX8%23Y4NZEHA.3432@.TK2MSFTNGP10.phx.gbl...
> > > > Hi,
> > > >
> > > > How could I add MAtrixRow for total and subtotal?
> > > > Or is any other way can do total and subtotal on Matrix?
> > > > I see the FoodmartSales.rdl of Reporting Service Example..
> > > > How could the Example add a MatrixRow for total and subtotal?
> > > >
> > > > Thanks!
> > > > Angi
> > > >
> > > >
> > >
> > >
> >
> >
> >

Add Line for Series Group Total to chart

Have trend chart with lines for monthly costs for individual assets. I need
to add another line for the total each month. When I add a new Value to sum
the costs, I get duplicate lines on the chart. What am I doing wrong?
TIA
DeanIn your new Value set the following value:
= sum(Fields!Yourfield.Value, "DATASETNAME")
Hope this helps.
"Dean" <deanl144@.hotmail.com.nospam> escribió en el mensaje
news:uv2uapZEIHA.3548@.TK2MSFTNGP06.phx.gbl...
> Have trend chart with lines for monthly costs for individual assets. I
> need to add another line for the total each month. When I add a new Value
> to sum the costs, I get duplicate lines on the chart. What am I doing
> wrong?
> TIA
> Dean
>

Friday, February 24, 2012

Add Column Values To the Bottom Of the Row By Condition

Hi
I am getting some results from stored procedure.
Name Value1 Value2 Value3 Total
North 1 2 3 6
North 4 5 6 15
South 5 6 7 18
Footer (North) 5 7 9 21
Footer(South) 5 6 7 18
I displaying footer for each group and i want to display Total value of
the column for that respective group Name.Is therea way to add all
column value depending up on the condition.
For North add only 2 rows.
Can any one help on this issue.
Thankstry sum in the group
=Sum(field!abc.value, "group1") you can have scope in the sum.
Amarnath
"vamsi" wrote:
> Hi
> I am getting some results from stored procedure.
> Name Value1 Value2 Value3 Total
> North 1 2 3 6
> North 4 5 6 15
> South 5 6 7 18
> Footer (North) 5 7 9 21
> Footer(South) 5 6 7 18
>
> I displaying footer for each group and i want to display Total value of
> the column for that respective group Name.Is therea way to add all
> column value depending up on the condition.
> For North add only 2 rows.
> Can any one help on this issue.
> Thanks
>

Thursday, February 16, 2012

Add a total column to matrix?

Surely there is a way to add a total column to a matrix? When I add a
column, that column repeats for each of the column data series. Help!R-click on the column or row field, and select "subtotal"
Mike G.
"Becker" <Becker@.discussions.microsoft.com> wrote in message
news:35C262CF-F1A3-4D02-8352-5F026CC5A3D3@.microsoft.com...
> Surely there is a way to add a total column to a matrix? When I add a
> column, that column repeats for each of the column data series. Help!
>

Monday, February 13, 2012

Add /3GB to Server 4GB

I have SQL Server 2000 cluster this is Active/Active.
The server has total 4GB of RAM with Windows 2000 Advanced Server.
Should the /3GB be applied to the both Active/Active nodes?
I would like the primary node to get 2.8 GB and the secondary node to get
1.2 GB of RAM.
Please help me with this problem.
Thank You,
The /3GB switch affects the VIRTUAL memory, not necessarily the physical RAM
and is for each process, each of which gets their own respective address
space. So, in short, yes, set it on each node of the cluster.
Next, you need to account for the OS and any additional processes that will
be running. Since you do not have sufficient memory to make good use of AWE
memory, do not enable that option.
There are two ways to control how much memory SQL Server uses: the MAX
SERVER MEMORY configuration option and the -g startup parameter. By
default, -g is set for 0.5 MB x number of worker threads (128 MB by default)
+ 256 MB = 384 MB. The -g parameter controls the amount of MEM TO LEAVE in
addition to the worker thread memory reservation and each SQL Server
instance has a separate one.
Since you will not be using AWE, as long as you do not set the WORKING SET
SIZE configuration option, memory allocation will be dynamic. I would keep
the MAX SERVER MEMORY set to Total Physical + 1/2 of the Page file. If both
instances were to failover to the same node, each SQL Server instance would
acquire and release memory as needed.
You could set the MIN SERVER MEMORY configuration option in an attempt to
specify the smallest each instance memory allocation would be in order to
keep either from totally controlling the entire physical allocation.
Something like 500 MB would be sufficient.
Sincerely,
Anthony Thomas

"Joe K." <JoeK@.discussions.microsoft.com> wrote in message
news:F6DB31B3-053D-46E5-B2D6-7592C831952D@.microsoft.com...
> I have SQL Server 2000 cluster this is Active/Active.
> The server has total 4GB of RAM with Windows 2000 Advanced Server.
> Should the /3GB be applied to the both Active/Active nodes?
> I would like the primary node to get 2.8 GB and the secondary node to get
> 1.2 GB of RAM.
> Please help me with this problem.
> Thank You,
>
>