How do i display from and to date from parameter? - reporting-services

Currently, I have text box that asks for a date. However, I would like to get date format like 9/13/2013 to 10/30/2013 from parameter. How can I add to date and from date to text box?

I believe you want a single text box to display the From and to dates. You can do this by referencing the parameters directly from your text box.
With the cursor flashing indicating you can type in the text box, right click it and select Create Placeholder
In the popup that appears click the fx button
Set the value to be the FromDate parameter
Set the format of the expression by clicking the Number tab of the popup, and selecting the date format you want, as shown
Then back in the text box carrying on writing in normal text "to"
Repeat steps 1 to 4 for the ToDate
The result should look something like this in design mode...
...and like this in preview mode
Hopefully this is the output you were imagining. If not, please let me know and I shall try to help further.

As far as I understand your question, you want something like this:
<span>To:</span><input type="date" id="toDate"/><span>From:</span><input type="date" id="fromDate"/>
In this case, the resulting page will have a textbox for a "to" date and a "from" date, both with a mm/dd/yyyy template built in. From here, you could then get the text box using document.getElementById, or jQuery, then get the value, and use subtract the dates. For date wrangling, I highly recommend moment.js, by the way.

Related

How to get the Month and Year to show up together in SSRS

I am having some trouble with trying to get the year to show up alongside the month name in SSRS 2012.
I have tried changing the number to date and select different options but none seem to be working. I have also tried changing the number to date in the Text Box Properties and in the Placeholder Properties but no luck. Any ideas?
Picture of the issue
Providing that the field is in a date format, select text box properties, select number,select date category, select "January 2000" from the Type list box.
Select text box, go to the properties window (F4) and type MMMM yyyy into the Format section

How to use Like and another function or field from a form in Access?

I have a drop-down menu in a form where you choose the year from pre-entered values. That field is used in different queries to display different data depending on the year you've chosen from the drop down menu ([Field]).
I would like to use this field in a query with the Like operator an a Wild card character.
I have the form open and the value of the [Form]![SubForm]![Field] equals for example 2018. If I try Like "*2018" it works fine.
I tried this but it doesn't work: Like "*[Form]![SubForm]![Field]"
Any ideas on how I could achieve this?
Your original code is taking the text as is.
Like "*[Form]![SubForm]![Field]" is searching for text that is like [Form]![SubForm]![Field].
You need to look for text that is like the contents of the control, not the reference to the control:
Like "*" & [Form]![SubForm]![Field]
The code above concatenates * with the value held in the control.

Creating a percentage in an expression

Would like to have some text in my report like the following where the percentage is based on an expression. I would like to know how to work out the percentage.
60% of letters were sent with a first class stamp
This is an example of the figures I'm working with
First Class 300
Second Class 150
Other 50
The fields used are 'StampType' and 'RefNo'. The totals are gathered by a count on the 'RefNo'
To do this, do the following steps.
First, add a new Text Box to the report. Click inside the text box so the cursor shows inside. Right-click and choose Create Placeholder.... Enter the following expression for the Value field.
=Lookup("First Class", Fields!StampType.Value, Fields!RefNo.Value, "ReportMain") / Sum(Fields!RefNo.Value, "ReportMain")
This assumes the dataset name that is returning your data is named ReportMain. Change this if needed.
This looks up the First Class RefNo value from the dataset, and then divides that by the total of the RefNo in the dataset.
Go to the Number section of the dialog, change the Category to Percentage. Adjust the Decimal places to your liking. Click OK.
Type the text you want to follow that value after the placeholder (not in the placeholder) in the text box. Like this:
Preview the report, and you should have what you need.

Microsoft Report Designer Line Through Text when value not Empty

Has anyone used LineThrough text on Microsoft Report Designer within the expression value?
Example:
=Switch(Fields!a.Value is Nothing, "text here".LineThrough, Not(Fields!a.Value is Nothing), CStr(Fields!a.Value))
I need the "text here" to be strikethrough if a.Value is nothing.
You need to use an expression to show the value you want and then Harry's answer to set the LineThrough.
You can simplify your SWITCH statement for the value like this..
=SWITCH(
Fields!a.Value Is Nothing, "Text Here",
True, Fields!a.Value)
or if the expression will not get any more complex than you have then use IIF
=IIF(Fields!a.Value Is Nothing, "Text Here", Fields!a.Value)
If you need only part of the textbox then the easiest way is to use placeholders. These act almost the same way as a textbox but you can have several placeholders in a single cell/textbox each with it's own properties.
To add a placeholder click the cell/textbox first to get focus then right-click before or after any existing text/placeholders. Select Insert placeholder and set the expression as you wish, you can also format the placeholders font/color/decoration etc.
As an example I've got a small dataset with country names. If the country contains the word "Island" then I show different text and change the text decoration on one of the place holders. In the design you can see there are 3 placeholders, some text then a field then some more text.
When I run this I get the following output.
I've set strike thru on the countrydesc field placeholder but you can do the same on a text placeholder. You still have to do it in two parts, and expression to set the text value and an expression in the placeholders font properties to set LineThrough
You can set the condition on the Font/ TextDecoration on the selected report Item. There is an option for LineThrough.
For Example
=iif(reportitems!Textbox7.Value = "Cartons","LineThrough","Default")

Input Field with text already populated on page load

I have a custom Visual Force page that on load has a name field that is supposed to have {Auto} printed inside the input text box that the user can delete or leave or not. I have been using a html-placeholder however the text just disappears and is gray.
My VF inputfield:
<apex:inputfield required="true"
value="{!EventPackageRevenueBreakdown__c.Name}" html-placeholder="{!Auto}"></apex:inputfield>
What it looks like with that code:
What I need it to look like (notice the cursor is after the closing scope)
Thanks in advance I'm still very new to this!
I suggest you to set Name field in controller with '{Auto}' value.
The placeholder attribute will disappear when there is a value in the field, what you want is to actually set the VALUE of the field to {Auto}.
Try this:
If you want it to automatically clear the field if a user clicks into it, you could add some javascript to handle that.