Change format of column in SSRS during export - reporting-services

I have some date columns in SSRS that, when our internal users view/review data, need to be shown in the usual mm/dd/yyyy format. The users also dump this report to Excel. In the export, I need to convert the date to a string and format it yyyymmdd.
Is it possible to change the output format of a column only during an export?
EDIT: (based on comments below)
I love the phrase "almost exactly" :)
The other question mentioned below was asking WHY dates appear a certain way in Excel AFTER exporting but I wanted to change the format BEFORE or AS the export happened. My question had NOTHING to do with regional settings as the question referred to below mentions.
What I needed was for the date to show on the report (at the report server, on-screen) as 8/13/2013, let's say, but when I export it to Excel I needed a format of 20130813.
To be helpful to those that read this, adding a parameter to the report header, allowing the user to change a selection to run the report in two separate "modes" worked for me.
What I did was add a reportMode param, give it two values, say ModeA and ModeB. I defaulted the param dropdown to ModeA. In the date column, I simply checked for how the param was set and changed format of the date, through an expression prior to the user running the report. This way the users can have ModeA to use when they are checking data but when they export this to excel for our external customers, who require the dates to be in the other format, they can choose ModeB, run the report again and then export.
Hope this helps somebody else.

Related

Crystal Report needs to eliminate page number when generate CSV only

I want to eliminate page number value from the report only when tries to generate CSV file. But also we need that page number display when tries to generate pdf. Can anyone help me through this.
Crystal Report Verion:13.0.2000.0
One option you could use to achieve this would be to create a parameter fields that asks the user if they want page numbers on the report each time the report is run. You can also include text that helps indicate not having page numbers is recommended for CSV file exports of the report.
The parameter field should provide an option for the user to choose Yes or No. You can default the answer to one of the two values to help speed up parameter value selection at run-time.
Then you use this parameter to control the Suppress property of the page number fields.
If you need help with setting up the parameter or the formula for the Suppress property, let me know in a comment and I can update this answer with more detail.

Microsoft Access: Text Importing as Time

I have an Access 2007 database of call center statistics that I maintain for work. I receive the raw data from our IT department in a CSV file, which I then import into the database into tables organized by year. All of the header information for the table columns are included in the CSV files, so I simply import the first month into a new table, then append the other months to this table as they come along.
This has worked fine for years, but suddenly one of the fields has started importing improperly. There's a field called "Duration", which is a string in the format of xx:xx:xx. When I create the table I specify that it is a text field, and January displays all of its data properly.
However, whenever I append data to it, the additional Duration fields get converted to a Time field (i.e. 00:01:36 -> 12:01:36 AM). The field is still a text field, and the field displays properly in the import wizard, but all new data gets converted to Time.
Thanks in advance for any help/pointers.
I don't think you have a problem. Open your table, select the design view and check what the Format property is. If there is nothing there, enter your desired format. That should display the data in the manner you desire.
I was able to resolve the problem. When importing the file (.csv) I simply removed the time delimiter by clicking "Advanced" for the delimiter indications. It's strange to me that it didn't delimit it in the other tables, but for the most recent ones did. Nonetheless this solved the problem. Thanks for your help!

SSRS Subscription File Name w/ Date

I have a series of reports that run at different schedules (hourly, daily, weekly, etc)
The reports are saved to a share \unc\reports\department\
report
report_1
report_2
report_3
As this is the only way to create a new version.
My question is if there is a way to append either execution time or even just the date so the end user can see the time the report was generated.
Currently it is done by looking at date modified properties, which is Ok, but not ideal.
You can capture the runtime with #timestamp variable and stamp it with your Report filename. Append #timestamp with your filename in the subcription manager as shown below.
yes, this is possible, you would need to use a data driven subscription. Here is a good how-to on it:
http://www.bidn.com/blogs/briankmcdonald/bidn-blog/1255/appending-date-to-end-of-report-name-in-reporting-services-subscription

SSRS change default DataSet

I have an SSRS report with a dataset from a certain database. I've gone to the trouble of creating a query that (hopefully) imports the data from a more accurate source. What I want to do is potentially delete the first source, and then use the second source. However the only thing I've found online tells me I must:
=First(Field!MyField.Value,"Better Source")
I really just want to try to switch everything out.
If you added a new/replaced the current DataSet with the new query, you can change the column names to match the ones in the current Tablix/Matrix (the same Aliases/names within the Query Designer).
That way, your fields will be within the DataSet and you will see Fields!Myfield.Value instead of First(Fields!Myfield.Value)
Let me know if that helps

SSRS - Is there a way to restrict date/time input parameters to date only? (Not report output field format.)

I am writing an SSRS report that has several parameters including a couple of date fields. I do not want the user to be able to enter time information in either date field, but SSRS only has the Date/Time data type. Is there a way to force these report parameters to act as date only, and can I set a specific format (e.g., dd/mm/yyyy)? I would like to keep the built-in date-picker-calendar functionality.
I do not want to write my own report parameter web page because if I did then this one report would be the odd one out given that all of our other reports (which don't use date parameters) work fine with the built-in SSRS parameter entry functionality.
Perhaps the answer is that you can't do it with the built-in options, but that seems crazy - how could something so obvious have been overlooked?
The Google and Stackoverflow searches I've done only gave me ways to set the format in the report output (actually there are a number of cases where people have asked a question similar to mine and only received answers about setting the output format).
The problem is that you are using parameters that get timestamp information.
For example, if you are using Now() in your expressions- you will be asking for the current date AND the current time. However, if you use Today()- you will only be asking for the current date.
=Today() 'returns date only
=Now() 'returns date and current timestamp
Useful references:
http://msdn.microsoft.com/en-us/library/ms157328(v=sql.90).aspx
http://msdn.microsoft.com/en-us/library/ms157328.aspx
To answer my own question based on research I've done since asking it: it seems it is not possible to control how SSRS handles user entry of date/time values in parameters. If there is a need to restrict to date (or time) only or do cross-field validation then you need to implement your own front-end - which unfortunately for my specific business case doesn't help.
In my experience it has only given me the date and time when the filed you are selecting from contains both date and time. I have found if I am selecting on a date only field then I only get the date in the parameter
There is a way, but it will require you to CAST your date as Varchar(10) in your parameter dataset.
Next,You'll have to choose "Data Type:" as Text under Parameters section.
Again, you'll have to make sure your SQL code re-converts it into date again. I do not prefer this way, but users really wanted to see date without time.
Let me know if you'd like screenshot or more detail.