I am running access 2013, with a linked view from SQL Server 2008 R2. I have two fields that I want to sum and data types are:
SQL Server 2008: Decimal(10,2)
Access: Number
They are being formatted in my query to currency using this syntax:
cf1: Format([calcfield1],"Currency")
cf2: Format([calcfield2],"Currency")
I have a report with both of these fields bound to text boxes and am adding a 3rd textbox to SUM() them. This is the control source syntax I input to SUM() the fields:
Name: SumOfFields
Control Source: =Sum([cf1]+[cf2])
Now when I attempt to view the access 2013 form, I get the error message displayed below. What do I need to change in order to perform this calculation on my report?
EDIT
If it makes a difference one cf1 is in the Serial Header section of my report, and the field cf2 is in the Details section of my report, and can have multiple entries. I want the SUM() that I am trying to add to be added to the Details section of the report like below:
Serial Header
$22.40
Details
$10.00
$13.40
$10.20
$56.00
Check out the link here it may help. A few things come to mind to check, but with the limited info this is the best I can do...
1) One of the fields is in a custom header which would mean that the total you are attempting to add needs to be in the custom footer
2) You need to place the total in the footer of the report
Link
I agree with #user2676140 - the total should appear in the group footer and should probably look something like:
=[cf1] + Sum([cf2])
If this doesn't work then I would try taking the Format wrapper off [cf1] and [cf2] and use the controls' properties to format them as Currency. Then maybe have the ControlSource for SumOfFields as
=[calcfield1] + Sum([calcfield2])
Again, use the properties of SumOfField to set the format.
Related
I'll do my best to describe my problem. I'm modifying a report in Access 2010. I have a text box in my detail section that displays the weight of a pallet with boxes on it.
=[PalletWeight].
The PalletWeight field is generated from a SQL query that grabs this information from our database. As it so happens in the database that field appears like so:
100.000000000. I don't know the data type for that field in the database because looking isn't as simple as opening SQL Server, but =CDbl([PalletWeight]) does work so unless someone tells me they need to know I didn't obtain that information for this question.
The pallets are grouped by item. So item 1 might need to be carried on 3 pallets, item 2 might need 4, etc...
As mentioned earlier, I used CDbl on the textbox to convert the value to appear as 100.00 on the actual report.
I need to add a text box that calculates percentage. For each item, the total weight of the pallets needed per item is a certain percentage of the grand total weight of all pallets produced.
When I attempted do something like the following I get the #Type! error.
=Format([PalletWeight / Sum(PalletWeight) * 100, "Percentage")
I've also tried to refer to the text box by name (name reference) to perform operations on its value instead of the value contained in the text box.
=Format([TextBox1] / [Textbox2] * 100), "Percentage").
This report has various grouping sections. I've tried using hidden text boxes to hold the values I want to manipulate and referencing those but it seems as soon as I use arithmetic I get the #type!.
I'm using the expression builder in the properties Control Source section. Any help would be greatly appreciated.
You either need to modify your query to add another calculated field
say dblPalletWeight =CDbl([PalletWeight])
and then use that in your formula
=Format(dblPalletWeight / Sum(dblPalletWeight) * 100, "Percentage")
Or modify your formula to do the conversion on the fly
=Format(CDbl([PalletWeight]) / Sum(CDbl([PalletWeight])) * 100, "Percentage")
Goal:
Display the text "All State-Province" instead of "All geographies" at the prompt list in SSRS
Problem:
I tried googling around and in the end I don't know how to solve it.
Information:
*Im using SQL server 2012
I don't use Report Server 2012, but in 2008 the following applies.
It depends on how you're populating your parameter,
If you're declaring the values in a list
Right click on the parameter, and change the label text.
or.....
If you're populating from a query then you need to ensure that the value you're using to populate the label returns "All State-Province" instead of "All geographies".
One way round this would be to set up a calculated field on the query used to populate the dataset
something like
=iif(Fields!LabelText.Value="All geographies","All State-Province",Fields!LabelText.Value)
Then use that field as the label.
I see your update..
What I believe you need to do, is set up a new calculated field on your GeographyStateProvince dataset
Call it NewLabelText.
Then use the expression
=iif(Trim(Ucase(Fields!ParameterCaptionIndented.Value))="ALL GEOGRAPHIES","All State-Province",Fields!ParameterCaptionIndented.Value)
Then as shown in my previous screen print, use the new calculated field instead of ParameterCaptionIndented
You can see your datasets on the left of this picture.
My report is containing some null value.
Report is generated through query
In my report I am calculating sum of every field for that I had written =iif((field name) is null,0,sum(field name))
Through this function I am getting result as 0 only if field contains some value as well
I agree with Remou, you should be using the footers for totals. However if you wanted to carry on with the way you are doing things then try replacing the IIF with NZ(MyField,0)
You should put that IIf statement in the query for that (or those) fields that you want to avoid nulls on. That way you can just put the Sum function in the details section of the report with impunity (assuming details section here).
I have a report created in SSRS in client mode, which is run disconnected: I create the data source in code and pass to the report as a DataView. It works ok.
But I need to be able to reference from the project to some objects (variables, whatever) from my application, as follows:
I need some totals that are not calculated based on data in report. e.g. the reports show total sales in a period, with own total, but I need to display a field in report footer - previous month total (actually they are about 10 other "previous" totals).
I need to have some columns show / hide based on some settings in the application (e.g. I have application option : Show Previous month sales)
Any thoughts on how to do this?
Thank you
Q1-> In order to use data in your reports, you need to specify the data inside of a Datasource object. You cannot simply use the variables if that is what your intentions were. So yes, you are doing this the right way. *** Sorry, you could theoretically used Report Parameters for this.
Q2-> This is the real reason to use Report Parameters. You can pass parameters to the report to do exactly this. If the HideColumn parameter (for example) is set to true, you could hide all the columns that need to be hidden.
http://msdn.microsoft.com/en-us/library/ms251750%28VS.80%29.aspx
For question 1 - the data - the easiest approach would be to create a DataTable in memory and add it as another dataset OR to add fields for your original dataview that contain these values.
Question 2 - To hide or show the columns based on settings make the column visibility an expression based on the value of a parameter, in your code behind set the parameter value to your application setting.
I am new to reporting services and have a reporting services 2005 report that I am working on to use as a base report template for our organization. I am trying to place the date that the report was last modified on the report server into the page header of the report. However, I keep getting a 'ParamX' parameter is missing a value error when I try to This is what I have done:
Set up a Parameter ReportName with a default value of Globals!ReportName. It is also hidden and internal.
Set up a Dataset ReportHeader that calls a stored procedure that returns the date the report was last updated or another date, if the report is not on the report server. It has a parameter #ReportName assigned to the Parameter!ReportName.Value. The Dataset returns values when run on the dataset tab in the BI tool.
Set up a Parameter ReportVersion that has a default value Query From based on the dataset ReportHeader and picking the ModDate column. It is the last parameter in the report parameters list.
I assign a textbox to the parameter.
When I preview, I get "The 'ReportVersion' parameter is missing a value whether I place it in the report body or page header (which is where I want it). I have deleted and added the parameter again, toyed with the hidden and internal settings on it.
What does this error really mean, what I am missing, and can I even do this with parameters?
Thanks In Advance
Jim
If I understand what you're doing, it sounds like you want to be using a field where you're implementing a parameter...
You are returning the ModDate from the data source, correct? If you're doing this, you can simply throw a text box in there, and use something like this: =Fields!modDate.Value to display it.
Parameters are values that go in to the query, fields are what it returns.
Hope this helps...
EDIT:: OK so are you trying to retrieve the mod-date column value from the reportserver db? If that's what we're talking about, you'll need to add a few things to the report. Add a datasource to report db, a dataset containing the date (query below), a list object in the report linked to the dataset, and a textbox in said list object to display the field. If you hit the report server with a query like this:
SELECT MAX(ModifiedDate) AS ModDate FROM catalog WHERE name='myReportName'
That will return your modifieddate from the ReportSErvices Database as a field that you can use.