Using value from Dataset 2 in calculation in Dataset 1

Hello-

Bumping in to an exception that I cant seem to get around.  Report has
two datasets.  I need to use a value that dataset2 returns.  (Dataset
2 is just a stored proc that returns a single value.)  Dataset1 has a
calculated field that needs to reduce the value in a field by the
value that is returned from dataset2.

I think the way to do this is to reference the textbox.value that
holds the value from dataset2:

calculated field = field_from_dataset1.value - sum(ReportItems!
credit.value)
where ReportItems!credit.value is the textbox that has the value
returned from DS2.

however when I execute the report, it crashes VS.

any suggestions?
0
kbrennan
11/24/2009 2:02:45 PM
sqlserver.reportingsvcs 542 articles. 0 followers. Follow

1 Replies
792 Views

Similar Articles

[PageSpeed] 18

Here is a trick that works when you know that a dataset returns a single 
value. Use the First aggregate. The expression builder frequently does not 
include that but just replace a sum aggregate with the word First. In this 
case you know it returns only a single value to you get exactly what you 
want. You do not need to assign it to a textbox.

To try this out so you see how to do it have a report with the dataset. Put 
a single textbox on the report. Assign an expression to it. Use the 
expression builder. You will see aggregation choices like sum, min, max. If 
you don't see First then pick one of the others and change it to first. Then 
run the report.

-- 
Bruce Loehle-Conger
MVP SQL Server Reporting Services

"kbrennan" <kevin@afsi.net> wrote in message 
news:fded5073-54d0-43f2-bd38-ecadc373b3ed@g1g2000vbr.googlegroups.com...
> Hello-
>
> Bumping in to an exception that I cant seem to get around.  Report has
> two datasets.  I need to use a value that dataset2 returns.  (Dataset
> 2 is just a stored proc that returns a single value.)  Dataset1 has a
> calculated field that needs to reduce the value in a field by the
> value that is returned from dataset2.
>
> I think the way to do this is to reference the textbox.value that
> holds the value from dataset2:
>
> calculated field = field_from_dataset1.value - sum(ReportItems!
> credit.value)
> where ReportItems!credit.value is the textbox that has the value
> returned from DS2.
>
> however when I execute the report, it crashes VS.
>
> any suggestions? 

0
Bruce
11/24/2009 4:12:06 PM
Reply:

Similar Artilces:

getdlgitemtext #2
Hi, I meke code from example behind, and not working corectly, buffor "String1" they are no my text in IDC_EDIT1 it is a somthing wrong this bufor, may please send me good idea. void CDialogPASS::OnBnClickedButtonDp2() { CString String1; GetDlgItemText(IDC_EDIT1, String1); } mike 1010 Is IDC_EDIT1 an actual control? I've seen this fail when the control ID changes due to editing of the dialog. joe On Fri, 30 Jun 2006 17:44:33 +0200, "1010" <mig1010@wp.pl> wrote: >Hi, > >I meke code from example behind, and not working >corectly,...

missing buttons #2
I just installed the new Office 2003 edtion. I went into e-mails and my send button and now my paper clip button are missing. I've checked in where you can add buttons but they're not in their either. What can I do to find them. Are you using Word as your e-mail editor? -- Jocelyn Fiorello MVP - Outlook *** Messages sent to my e-mail address will NOT be answered -- please reply only to the newsgroup to preserve the message thread. *** In news:4E889BAD-E127-4AF8-BC98-7AB117D0B90B@microsoft.com, Sharon wrote: > I just installed the new Office 2003 edtion. I went into e-mail...

Disaster Recovery for CRM 1.2
Does anyone have any documentation on the steps to backing up CRM 1.2? We want to make sure we are backing CRM 1.2 up correctly if the server should go down. We were unable to find any documentation on Microsofts website for a step by step backup solution. Right now we are just backing the CRM databases using the scheduler in SQL; is this ALL that is required and if so do we backup ALL of the databases or just certain ones? The owners of the company want to make sure we can restore ALL of the data if needed. -- Thank You, Troy Hi Troy Microsoft have included details of backing...

2 Questions
Hi I run Win 2K with Excel 2K Question 1 I have some VB code in the "Sheet 1" module of my excel file. The code is as follows: Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Target.Column <> 12 Then Exit Sub On Error GoTo ErrHandler Application.EnableEvents = False Target.Formula = UCase(Target.Formula) ErrHandler: Application.EnableEvents = True End Sub I would like this code to run automatically whenever the file is opened. (I am assuming that this would remove the enable/disable dialog box option when opening the file) Can someone tell ...

forwarding in Exchange 2003 #2
I configured the server (Exchange 2003) to forward a user��s emails to test@xyz.com. It is very strange that all messages sent from xyz.com are rejected (please see the sample NDR below), there is not problem to other domains. test@xyz.com did not receive the message while the envelope recipient (admin@abc.com) did. Does anyone know how to solve this? Any help would be appreciated. Thanks. SC -------------------------------------------------------------------------------------------------------------------------------------------- Your message To: admin@abc.com S...

Outlook 2003 forgets contacts after 1 day
Outlook 2003 is remembering contacts for a day and then automatically deleting them. I have spent the last hour searching and can't find the right setting to stop this from happening. Has anyone got any advice? Outlook does not automatically save Contacts ever. To what feature are you referring? Autocompletion? -- Russ Valentine "slycbod" <slycbod@discussions.microsoft.com> wrote in message news:36DBB238-7462-452F-85EB-15258BCD8B05@microsoft.com... > Outlook 2003 is remembering contacts for a day and then automatically > deleting them. I have spent th...

Multiple Outlook #2
I imported an Outlook 2000 pst file into Outlook 2003. Now when I open Outlook my Personal Folders appears 4 times in the left hand "All Mail Folders" When I close Outlook it gives me an error and msvbvm60.dll is mentioned. Any help on how to correct this issue would be greatly appreciated. Mick ...

queue stuck #2
HI... i ahve exchange 2003 and i am facing problem that i am getting lot junk email and all messagess are stuck in queue ..after that my server hang so i need to restart server and clear the queue before restart it does't allow me to clear the queue ... pls help me .. tejal ...

Trouble sending emails #2
I am recieving emails, but every time I try to send one I get an error message saying, "The server does not support the required HTTP methods. Ther server responded 'Not Implemented'." I have no idea wht that means or what I need to change. Help! On Thu, 30 Dec 2004 15:05:06 -0800, Tina wrote: > I am recieving emails, but every time I try to send one I get an error > message saying, "The server does not support the required HTTP methods. Ther > server responded 'Not Implemented'." I have no idea wht that means or what I > need to change. ...

hyperlinking to an item in Global Address List Options
I have had success linking via html from web page to opening a specific contact record from Microsoft Outlook. I have done it like this: outlook://Big%20Contacts/Contacts/~Peter%20Crawford However, my very large contact database also has people with basically the same name, like John Smith. In the current "Address Card" view inside Microsoft Outlook, one of the John Smith's is always sorted first. If I enter outlook://Big%20Contacts/Contacts/~John%20Smith the first John Smith in the sort order is always opened. However, I want to specify one of the other John Smith's....

Cannot open assigned task in Outlook 2003 #2
I am using Outlook 2003 on a XP Home PC. When a co-worker creates and assigns me a task, it comes into my Inbox and I can see it in my preview pane, but I cannot open it when I double-click it and I cannot accept or decline it thru the preview pane. My co-worker has Outlook 2003 on a XP Pro PC and has no problem opening and accepting tasks from me. By the way....when I attempt to open it, absolutely nothing happens that I can see....no error, no change of screens, nothing! I have ensured that when the co-worker sends the task, that they do NOT have "text only" set for me. THANKS...

display name #2
hi i have this problem: when i send a mail massage from an application by exchange 2003, in outlook i see the e-mail address (xx@mydomain .com) and not display name (Customer Care) how can i resolve it? Thanks An application should allow you to specify display name for sender. Does it send via SMTP or MAPI? Matrix_pd wrote: > hi > i have this problem: when i send a mail massage from an application by > exchange 2003, in outlook i see the e-mail address (xx@mydomain .com) and > not display name (Customer Care) > > how can i resolve it? > > Thanks -- Please re...

Money 2003 restoring a backup asking for a password that does't ex #2
I have microsoft money 2003 at my work and would like to have the same data there in my home. So i made a backup, put on a pendrive and brought it to home. Installed microsoft money 2003 in my home and tried to restore this backup. Money 2003 insists asking a password that does not exist in the original backup file. I already tried to use the repair tool and didn't work. So, what i have to do to make the backup work and does not ask a password that does not exists? Thankyou sorry about the spam, i was using the google chrome and it bugged, sorry again about the tripple post :( "...

double lookup #2
In Excel2000, I need help with the following formula: my data is arranged like this ( I can rearrange if needed).. joe pete sue rating 30 10 5 A 20 5 3 B 10 2 1 C I then have values for joe, pete, sue. I want to look up the name and then give me the rating. The numbers may not be exact. For example, I want the output to look like this ( with the formula looking up the rating) name amount rating (formula needed) joe 11 C pete 7 B sue 1 C Can someone please help me with the formula to fi...

Cannot log in using WindowsID (was able to before)
I just bought MS Money 2007 Deluxe yesterday. The install went smooth, without any issues. I registered a new WindowsID and was able to successfully log into MS Money. However, today when I tried to log into MS Money, the messge apeared that the "Money was not able to recognize your WindowsID" or something like it and that "You will still have access to some functions but will not be able to make online updates". Now I'm not able to make updates. Any idea what this could be? Is the authentication server for WindowsID down or something? See the post under Mon...

How to use structured reference (ListColumns) in VBA
I want to do something simple...loop through a range retrieving values one at time and taking action on that value. This range is an Excel 2007 table column. Easy enough...BUT I want to use structured references to a table column by NAME, not numbers. I don't want to define new names, just use the table column headings. I've found ways of doing it with quotes, but that's not structured....the names in quotes do not change if the table heading is changed by the user. The formulas change if the table column heading is changed, but I want it to change in VBA to...

Save As using contents of Cell in Name
Can someone help with code that changes the "save As" file name to combination of the original File Name + the contents of a cell, an saves file in same folder as the original. E.G. Original File Name= Timesheet Cells B1= Location Cell C1 = Date in format 3-5-2004 Cell A1 = concatenate(B1,C1) Fle Name will therefore be "Timesheet Location 3-5-2004" The other problem is with the date. When concatenating, how do I forma the date to avoid it looking like "Location 38051" Any help much appreciated Nic -- Message posted from http://www.ExcelForum.com Hi for c...

Attachment Size #2
Hi ! Is it possible to block the adding of attachments in an=20 outlook client ? Or block the adding for attachments that=20 are bigger than 2 MB for example ? Can i get an error=20 Message or something ? (I think about an GPO or Registry=20 change or something else....) I have Users around here with Pop3 Outlook 2000 and=20 Outlook 2003 Clients. The Problem is that some of them are=20 trying to send Mails with Attachments with 300 (three=20 hundred!!) MB or something else like that.... Because they=20 don=B4t look an the size of their attachments. So the Mail is going through our WAN over ...

Can't use Merge feature
If I have a postcard file I've already made on the screen, when I try to pull up the "Merge" feature under Tools, it is shaded grey and I can't open it. It insists that I either form a new database list of addresses or edit the one that I want to merge. I don't want to edit the one I want to merge. I just want to MERGE it. If, however, I have just a postcard template on the screen (without it having been made into anything), I CAN pull up the "merge" feature under Tools. It is not shaded out. How do I un-shade the "merge" feature? To merg...

Restore Exchange 5.5 on 2000 using ArcServe
I've got - Windows NT 4 Server SP6 - Exchange 5.5 SP3 - ArcServeIT 6.61 with Exchange Agent I'm trying to restore the Exchange information (database, mailbox... everything) on another computer. That computer has - Windows 2000 Server SP4 - Exchange 2000 - Brighstore ArcServe 9 (build 2020) with Exchange Agent ------------------- Now the situation: I need to verify that the backup was made correctly (entirely) in order to confirm the total validity of the backup (to validate my disaster recovery plan) and to update to SP4. I tried to find documentation with both Microsoft (for Ex...

Covert v. 2000 -> v. 2.0
Heelo All after serious cooruption we recover dmb file with Ontrac tools to v. 2000 but application are for v 2.0 are is possible conversion to v. 2.0 thanks Ervins ...

Using Excel spreadsheet as input to Access
Hello, I posted this in the New Users forum but only got one answer, so thought I'd try here as well. Like so many others, I am an Excel newbie. I was a mainframe COBO programmer in another life, but that was a few years back My manager would like me to write an app that will take tracking dat from an existing Excel spreadsheet (generated by our system) but onl use a select handful of columns as input to a new Access database tha I will create. I'm guessing that I can either a) create a new edited spreadsheet to b used as input to the Access database or b) use the Import wiza...

Default value of combo box based on another that uses DLookUp
Hi, I have a problem I'm trying to overcome regarding just one form which gets its data from 1 table. I'm trying to set the default value of a combo box to be the same as another combo box on the same form. The scenario is: I have a form for entering info about financial planning Statements Of Advice. Each client has a Plan Writer prepare their plan. To find the plan writer that last prepared the plan for a client I have a combo box with a DLookUp as its Control Source. =DLookUp("Plan_Writer","qryDefault_Planwriter","[Client]=Form![Client]") I'm usin...

Using subtotals as single data entries
Sorry about the subject--I couldn't figure out how to describe it simply. I have a large file (16,000 records) of amounts billed by roughly 10,000 service providers. A number of these providers have multiple office locations, so each record is unique to a specific office location. In other words, a provider who billed from 3 different office locations will have 3 entries. Each provider has a unique provider ID number, which stays the same regardless of which office location he is billing from. I want to be able to subtotal the amount billed by each provider for all their office locations...

Using Risk+ with MSP 2007
We use Risk+ as a risk simulation tool. We have discovered that it works approximately 20 times SLOWER in MSP 2007 than MSP 2003. Has anyone else run into this problem. If so, is there a remedy? My hunch this not a generic issue, but surely best that you consult with the Risk+ people on this. --rms www.rmschneider.com On 02/03/10 18:08, Tom Mc wrote: > We use Risk+ as a risk simulation tool. We have discovered that it works > approximately 20 times SLOWER in MSP 2007 than MSP 2003. Has anyone else run > into this problem. If so, is there a remedy? W...