Thursday, March 29, 2012
Formula to view records
I am having a report which takes a parameter to view records based on the parameter value passed to it.
I need to check the length of the parameter, if the length of the parameter value is "4", it should compare the parameter value with one field value, if the length is more than 4, then it should compare the value with another field and shoe me the records.
I have made the formula, but it doesn't show records, where as there are records in the table.
how could i do that ? Is anybody there, who could help me in that?
Thanks in advance.
Regards
DeepakIf len(parameter)=4 then
--do some work
else
--do some other work
Do you want to do this from Front end application?
Formula for Graph Size
I have a report control in my report. But I want to expand graph depending on the selected number of months (Parameter) by users.
But there is no formula option for graph control. Is there any workaround?
You might be able to do something with padding. But that would not change the space your graph takes up in the page, you would just have more (or less) white space, depending on your current data.
>L<
sqlMonday, March 26, 2012
formatting using style sheet
How to include stylesheet files?
Let me know how to do it?
ThanksVV wrote:
> can style sheet classes be implemented in report parameter section?
> How to include stylesheet files?
> Let me know how to do it?
> Thanks
http://download.microsoft.com/download/7/f/b/7fb1a251-13ad-404c-a034-10d79ddaa510/SP1Readme_EN.htm
Friday, March 23, 2012
Formatting question
="PERIOD MINUS 1 YEAR: " & Parameters!startdate.Value & " to " &
Parameters!stopdate.ValueTry:
="PERIOD MINUS 1 YEAR: " &
System.DateTime.Parse(Parameters!startdate.Value).AddYears(-1).ToShortDateString()
& " to " &
System.DateTime.Parse(Parameters!stopdate.Value).AddYears(-1).ToShortDateString()
or something simular
"Chris Patten" <ChrisPatten@.discussions.microsoft.com> wrote in message
news:33AB832F-0620-4A7C-B2FC-5D38A36C7429@.microsoft.com...
>I want to show a parameter date minus 1 year, how can I do this?
> ="PERIOD MINUS 1 YEAR: " & Parameters!startdate.Value & " to " &
> Parameters!stopdate.Value|||That is the shizzle my fizzle!!
(or however that should sound, thanks!)
Chris
"Oleg Yevteyev" wrote:
> Try:
> ="PERIOD MINUS 1 YEAR: " &
> System.DateTime.Parse(Parameters!startdate.Value).AddYears(-1).ToShortDateString()
> & " to " &
> System.DateTime.Parse(Parameters!stopdate.Value).AddYears(-1).ToShortDateString()
> or something simular
> "Chris Patten" <ChrisPatten@.discussions.microsoft.com> wrote in message
> news:33AB832F-0620-4A7C-B2FC-5D38A36C7429@.microsoft.com...
> >I want to show a parameter date minus 1 year, how can I do this?
> >
> > ="PERIOD MINUS 1 YEAR: " & Parameters!startdate.Value & " to " &
> > Parameters!stopdate.Value
>
>sql
Formatting parameters
I would like to change date parameter from
4/30/2002 12:00:00 AM to 30.4.2002 in report.
How can parameters be formatted?
Thanks
Romanhi Bender,
Write this expression in the the textbox that you want to show you the date:
=format(Globals!ExecutionTime,"dd.MM.yyyy")
i hope it will help you.
"Bender" wrote:
> Hi!
> I would like to change date parameter from
> 4/30/2002 12:00:00 AM to 30.4.2002 in report.
> How can parameters be formatted?
> Thanks
> Roman
>
>|||For parameters, you must aplicate the function format to
Parameters!parameter_name.value (instead of Globals!ExecutionTime).
"Bender" wrote:
> Hi!
> I would like to change date parameter from
> 4/30/2002 12:00:00 AM to 30.4.2002 in report.
> How can parameters be formatted?
> Thanks
> Roman
>
>|||I'll try to explain again what I want to do :)
In the Report Parameters dialog I define my Parameter and set
Data Type to Datetime (there is not many options anyway).
When I run report I get 4/1/2002 12:00:00 AM in parameter box on
top of report (parameters section of report), which is correct.
But I want to format this to see and make input like
dd.MM.yyyy and without time part.
Any ideas.
Thanks
"Mirela" <Mirela@.discussions.microsoft.com> wrote in message
news:037EE286-0206-42A1-88C9-A6C3303EE254@.microsoft.com...
> For parameters, you must aplicate the function format to
> Parameters!parameter_name.value (instead of Globals!ExecutionTime).
> "Bender" wrote:
> > Hi!
> >
> > I would like to change date parameter from
> > 4/30/2002 12:00:00 AM to 30.4.2002 in report.
> >
> > How can parameters be formatted?
> >
> > Thanks
> > Roman
> >
> >
> >
Formatting Parameter Values
formatting a global fields e.g. Format(Globals.ExecutionTime, "D").
My parameter is returning XXXX 2006, but I only want the year part of
the parameter passed to the expression.
Can this be done.?If it's a date, then =Datepart(DateInterval.Year, Parameters!myParm.Value)
or you could do the following:
=DatePart(DateInterval.Year,
DateTime.Parse(Parameters!myParam.Value.ToString()))
You could also do this:
=Parameters!myParam.Value.ToString().SubString(4,4) /* assuming 0-based
strings */
"Andy" <andy.williams1971@.ntlworld.com> wrote in message
news:1152626782.474747.226720@.35g2000cwc.googlegroups.com...
>I want to enter part of a parameter value as an expression similar to
> formatting a global fields e.g. Format(Globals.ExecutionTime, "D").
> My parameter is returning XXXX 2006, but I only want the year part of
> the parameter passed to the expression.
> Can this be done.?
>|||This worked a treat!
Thanks
Tim Dot NoSpam wrote:
> If it's a date, then =Datepart(DateInterval.Year, Parameters!myParm.Value)
> or you could do the following:
> =DatePart(DateInterval.Year,
> DateTime.Parse(Parameters!myParam.Value.ToString()))
> You could also do this:
> =Parameters!myParam.Value.ToString().SubString(4,4) /* assuming 0-based
> strings */
> "Andy" <andy.williams1971@.ntlworld.com> wrote in message
> news:1152626782.474747.226720@.35g2000cwc.googlegroups.com...
> >I want to enter part of a parameter value as an expression similar to
> > formatting a global fields e.g. Format(Globals.ExecutionTime, "D").
> >
> > My parameter is returning XXXX 2006, but I only want the year part of
> > the parameter passed to the expression.
> >
> > Can this be done.?
> >|||No worries. Remember that [almost] whatever you can do in VB.NET, you can
do in RS...
-Tim
"Andy" <andy.williams1971@.ntlworld.com> wrote in message
news:1152630530.714237.206660@.h48g2000cwc.googlegroups.com...
> This worked a treat!
> Thanks
>
> Tim Dot NoSpam wrote:
>> If it's a date, then =Datepart(DateInterval.Year,
>> Parameters!myParm.Value)
>> or you could do the following:
>> =DatePart(DateInterval.Year,
>> DateTime.Parse(Parameters!myParam.Value.ToString()))
>> You could also do this:
>> =Parameters!myParam.Value.ToString().SubString(4,4) /* assuming 0-based
>> strings */
>> "Andy" <andy.williams1971@.ntlworld.com> wrote in message
>> news:1152626782.474747.226720@.35g2000cwc.googlegroups.com...
>> >I want to enter part of a parameter value as an expression similar to
>> > formatting a global fields e.g. Format(Globals.ExecutionTime, "D").
>> >
>> > My parameter is returning XXXX 2006, but I only want the year part of
>> > the parameter passed to the expression.
>> >
>> > Can this be done.?
>> >
>
Formatting Parameter and Field Dates
I'm new to Reporting Services so bear w/ me,
I'm having troubles with formatting the parameter and field dates. To resolve the Field dates I just formmated them in the query, but I still haven't found a way for the Parameter fields. The date parameters is passed as YYYYMMDD(oracle number data type), and I want to format and display it as MM/DD/YYYY.
Any help would be appreciated,
also would like how to know how this works for the field values as well,
Thanks,
Nick
If you want to change the format of the parameter (assuming that your referring to a date parameter) you can use this one:
=Format(Now(), "MM/dd/yyyy")
Click on the "Tools" then "Report Parameters". Under the Default Values, click on the Non-Queried option then place on the text field the formula above.
Hope this helps..
|||Thanks for the reply. I'm not sure if I did it the best way, but I ended up using
="From Date: " + Parameters!FromDate.Value.substring(4,2) + "/" + Parameters!FromDate.Value.substring(6,2) + "/" + Parameters!FromDate.Value.substring(0, 4).
Monday, March 19, 2012
Formatting a textbox
when I print the parameter entered it displays like this ##########. I
want to format it to look like ###-###-####. Does anyone have any
ideas for making it look like that?E,
RS has a Custom Formatting built in where you can type in ###-###-####
for the Format.
But for phone Numbers the DB probably returns it as a string. You must
first convert it to a Number... a LONG in this case.
So go to report Properties go to Custom Code and put this in there:
Public Function convertToIntegerNow(tempVar2 As String)
convertToIntegerNow= CLng(tempVar2)
End Function
in the cell type in
=Code.convertToIntegerNow(Fields!Phone_Field_name.Value)
Then right click on the cell go to properties, change the format of the
cell to ###-###-####
Hope this helps
regards,
Stas K.
Formatting a Text box
when I print the parameter it displays like this ##########.
I want to format it to look like ###-###-####.
It can't be done with SQL, it must be done in the VB of that textbox.
Does anyone have any ideas' It would save me from pulling my last
hair out!!Down and Dirty, but:
=Mid(Fields!homephone.Value,1,3) & "-" & Mid(Fields!homephone.Value,4,3) &
"-" & Mid(Fields!homephone.Value,7,4)
You can substitute the Parameter value as Parameters!PHNumber.Value in place
of Fields!homephone.Value if they are entering the phone number in the
parameter box.
Rodney Landrum
"E" <ericfreiman@.mtgsi.com> wrote in message
news:1144097404.116802.178020@.v46g2000cwv.googlegroups.com...
>I need to format a phone number parameter the user enters. Currently
> when I print the parameter it displays like this ##########.
> I want to format it to look like ###-###-####.
> It can't be done with SQL, it must be done in the VB of that textbox.
> Does anyone have any ideas' It would save me from pulling my last
> hair out!!
>|||Hi,
Just select the cell you want to display with format right click and click
properties and select Format tab on the format field select "..." and click
custom and type "###-####"
Amarnath
"E" wrote:
> I need to format a phone number parameter the user enters. Currently
> when I print the parameter it displays like this ##########.
> I want to format it to look like ###-###-####.
> It can't be done with SQL, it must be done in the VB of that textbox.
> Does anyone have any ideas' It would save me from pulling my last
> hair out!!
>
Monday, March 12, 2012
Formatted text in report parameter
Not out of the box. If you use SRS 2005, the ReportViewer controls (part of VS 2005) will allow you to show reports in any ASP.NET or Winforms application. Using the controls, you can hide the report parameters page and replace it with your own prompting logic. See www.gotreportviewer.com for more details.
If you use SRS 2000, you can achieve most of this by putting an iframe to the report server in your web page and include rc:Parameters=False to hide the parameters area. You web page would be responsible for parameters prompting and for feeding the values to the report server iframe. For ex: http://server/reportserver/?PathToTheReport&rc:Parameters=false&Param1=value1&Param2=Value2
Friday, March 9, 2012
Format the Report Manager Parameter headings
Hello,
I was wondering if it would be possible to change the font type and color of the parameter titles in Report Manager? Like can I change it in XML some sort of way...
<QueryParameters>
<QueryParameter Name="@.ProductLang">
<Value>=Parameters!ProductLang.Value</Value>
</QueryParameter>
Ex: @.StartDate is a parmeter, I'd like to change the text's font color and style to BLUE and Italics.
It is not possible to configure this in Report Manager.
You could write a custom ASP.NET page with your desired stylizations that will pass the parameters to the ReportServer.
-Chris
Format text in "parameter"
i've got a "parameter" that is of date type, but is there any way so that it
only shows the "short date" format -- don't want the time.
thanks,Maersa,
yeah, u can write a small function is custom code that takes string
as a parameter and return the same. in that function u can write
conversion functionality. and use this function is expresssion of
textbox or wherever u want.
textbox = Code.GetShortDate(Parameters!Name.Value)
and in custom code write a fuction with VB
Note: function declaration here might not be synteticaly correct.
Shared fuction GetShortDate(byval date a string) as String
write code here to convert date to DateTime and back to string
return shortdate
end function
hope this helps.
Thanks,
mahesh|||thanks mahesh,
how would i write a .NET assembly and then use it within my report ?
thanks,
"Mahesh" <gaware@.gmail.com> wrote in message
news:1121998689.809184.145380@.f14g2000cwb.googlegroups.com...
> Maersa,
> yeah, u can write a small function is custom code that takes string
> as a parameter and return the same. in that function u can write
> conversion functionality. and use this function is expresssion of
> textbox or wherever u want.
> textbox = Code.GetShortDate(Parameters!Name.Value)
> and in custom code write a fuction with VB
> Note: function declaration here might not be synteticaly correct.
> Shared fuction GetShortDate(byval date a string) as String
> write code here to convert date to DateTime and back to string
> return shortdate
> end function
> hope this helps.
> Thanks,
> mahesh
>|||There is no way you can do this. You can use the data format elsewhere and
strip the time as the other posting was saying but you cannot have report
manager change how it functions. What you can do is to use string parameter
type instead of date parameter type. That is what I do when I don't want the
time. Of course, then they could put in something that is not a date.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"maersa" <masa_iwasa@.hotmail.com> wrote in message
news:OqI9PGmjFHA.3164@.TK2MSFTNGP15.phx.gbl...
> hi,
> i've got a "parameter" that is of date type, but is there any way so that
> it only shows the "short date" format -- don't want the time.
> thanks,
>|||The code he is talking about can exist in the report itself with no outside
dependencies... Go to Report->Code from the top menu item and add your
functions there...I also have a example that does not use a code function
( if I remember correctly) at www.msbicentral.com
--
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
(Please respond only to the newsgroup.)
I support the Professional Association for SQL Server ( PASS) and it's
community of SQL Professionals.
"maersa" <masa_iwasa@.hotmail.com> wrote in message
news:OqI9PGmjFHA.3164@.TK2MSFTNGP15.phx.gbl...
> hi,
> i've got a "parameter" that is of date type, but is there any way so that
> it only shows the "short date" format -- don't want the time.
> thanks,
>|||I have a report that i did in visual studio that calls a stored procedure.
the @.AsOfDate is of datetime format in the procedure. In visual studio, i
made it a string. I even defaulted a string value of 12/31/2007. When i
deploy it in reporting services, it shows up as string, which is correct, but
it has a default of 12/31/2007 12:00:00 AM. Is there anyway i can get rid of
the time?
"Bruce L-C [MVP]" wrote:
> There is no way you can do this. You can use the data format elsewhere and
> strip the time as the other posting was saying but you cannot have report
> manager change how it functions. What you can do is to use string parameter
> type instead of date parameter type. That is what I do when I don't want the
> time. Of course, then they could put in something that is not a date.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "maersa" <masa_iwasa@.hotmail.com> wrote in message
> news:OqI9PGmjFHA.3164@.TK2MSFTNGP15.phx.gbl...
> > hi,
> >
> > i've got a "parameter" that is of date type, but is there any way so that
> > it only shows the "short date" format -- don't want the time.
> >
> > thanks,
> >
> >
>
>|||Can't you just use FieldName.Value.ToShortDateString ?
--
"Everyone knows something you don't know"
"Wayne Snyder" wrote:
> The code he is talking about can exist in the report itself with no outside
> dependencies... Go to Report->Code from the top menu item and add your
> functions there...I also have a example that does not use a code function
> ( if I remember correctly) at www.msbicentral.com
> --
> Wayne Snyder MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> (Please respond only to the newsgroup.)
> I support the Professional Association for SQL Server ( PASS) and it's
> community of SQL Professionals.
> "maersa" <masa_iwasa@.hotmail.com> wrote in message
> news:OqI9PGmjFHA.3164@.TK2MSFTNGP15.phx.gbl...
> > hi,
> >
> > i've got a "parameter" that is of date type, but is there any way so that
> > it only shows the "short date" format -- don't want the time.
> >
> > thanks,
> >
> >
>
>|||Where are you making it a string? Click somewhere blank on your report.
Menu->Report->Report Parameters. Click on the parameter and change the data
type to string.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"deniseamat" <deniseamat@.discussions.microsoft.com> wrote in message
news:296463D8-01F3-4906-BB0B-C0F0DAFB9490@.microsoft.com...
>I have a report that i did in visual studio that calls a stored procedure.
> the @.AsOfDate is of datetime format in the procedure. In visual studio, i
> made it a string. I even defaulted a string value of 12/31/2007. When i
> deploy it in reporting services, it shows up as string, which is correct,
> but
> it has a default of 12/31/2007 12:00:00 AM. Is there anyway i can get rid
> of
> the time?
> "Bruce L-C [MVP]" wrote:
>> There is no way you can do this. You can use the data format elsewhere
>> and
>> strip the time as the other posting was saying but you cannot have report
>> manager change how it functions. What you can do is to use string
>> parameter
>> type instead of date parameter type. That is what I do when I don't want
>> the
>> time. Of course, then they could put in something that is not a date.
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "maersa" <masa_iwasa@.hotmail.com> wrote in message
>> news:OqI9PGmjFHA.3164@.TK2MSFTNGP15.phx.gbl...
>> > hi,
>> >
>> > i've got a "parameter" that is of date type, but is there any way so
>> > that
>> > it only shows the "short date" format -- don't want the time.
>> >
>> > thanks,
>> >
>> >
>>
Wednesday, March 7, 2012
Format Parameter Error
Hi all, i am a newbie to reporting services. Hope someone can help me with this date problem.
I have a parameter date which i declared as type string in the report manager. when i entered the date as eg) "31/12/2003" and clicked on the 'preview' tab in the report manager, it gives me error saying that 'Cast from string "31/12/2003" to type 'Date' is not valid.'
So i use the cultureinfo function to set the date to 'en-US' format.... something like the one below:
CStr( Format(DateTime.Parse( Parameters!strDateTo.Value , New System.Globalization.CultureInfo("en-US")), "dd-MMM-yyyy"))
This works perfectly in my preview tab. But when i deployed to the server and when viewed on IE, it gives me an error msg -> "#Error" instead. Why is that so?
I have also checked my pc regional settings . It's set to United States and the date format is also "dd/MM/yyyy". Have also checked the settings in the server and it's also set to the same format. But i am still getting this error.
By the way... i am using windows 2003 with SRS 2000 SP2.
Any help will be appreciated. Thks !
First, why did you create a string parameter and not a date parameter? Second, the interpretation of the input is based on the language specified by the browser, which is why you got something different in the designer vs. when you deployed. Finally, if you want to evaluate strings based on a specific locale, you can just set the locale of the report (report property) to "en-US". You don't need to use a CultureInfo object.Format parameter date string
yyyy/mm/dd, I have added reporting filters (Parameters from-Date and to-Date
with datatype date to show calendar) for this date which is showing the
selected date in the format mm/dd/yyyy. How can I "format the parameter
values" or "write the expression" or "update MDX" so that the report shows
data within the filter dates?
Thanks and Regards
SridharFYI: I am using SQL Server 2005 and web-based reports using reporting
services.
--
Sridhar
>I have a Analysis services dimension which is returning a date in the
>format yyyy/mm/dd, I have added reporting filters (Parameters from-Date and
>to-Date with datatype date to show calendar) for this date which is showing
>the selected date in the format mm/dd/yyyy. How can I "format the parameter
>values" or "write the expression" or "update MDX" so that the report shows
>data within the filter dates?
>
> Thanks and Regards
> Sridhar
>
format parameter date
Hi,
I know how to format report items (dd/MM/yyyy) but how can i format a parameter in the format dd/MM/yyyy?
The current format is MM/dd/yyyy.
Thanks
Dim dt as String= "21/11/2007"
dim dtdate asa date
dim s() as string=dt.Split("/")
dtdate = s(1) & "/" & s(0) & "/" & s(2)
msgbox(dtdate)
Urs,
|||Thanks for the response. I am not sure where to put the code in the reporting services. I have parameters in the report but i am not sending any parameters to the report from aspx.
|||
Scroll down to Figure 17 on this pagehttp://www.eggheadcafe.com/articles/20040823.asp
Orhttp://msdn2.microsoft.com/en-us/library/ms157328.aspx
|||Hi,
What I need to format is the report parameter date (the value of the prompt) and not an actual textbox. In the prompt value the default dates appear in the format MM/dd/yyyy and i need the dates to appear as dd/MM/yyyy.
from_date 10/30/2007 to_date 12/30/2007 view report
Format parameter date
Hello
My problem is with parmater format date, when i input for example the date format yyyy/mm/dd and then press in boton view report this foramt change to dd/mm/yyyy, this succed in all machines with all configuration in the regional configuration.
When i change this format in th configuration of reporting services.
Thank you
In your query add a convert to your parameter field.
convert(datetime, @.parameter, 111)
|||Thank you for your request, but the problem isn't the database, i thnik the problem is the configuration of Reporting Services, because this software function with date format mm/dd/yyyy and i don't know when change this format. For example when i type in the paramater of the report 2006/08/06 (6 august 2006) and press the boton "show report" the screen refresh and then show 08/06/2006 (8 june 2006) and this i don't know why show. This is y problem.
Thank you
|||The interpretation of the value typed in for a date in the report parameters area is based on the client browser locale. The display of the date within the body of the report is based on the language property of the report (which can be bound to the client language if the report developer wants it to).
|||Are you setting the various lanuage settings for Reporting Services? These settings are very configurable. See the following link for more information.International Considerations for Reporting Services:
http://msdn2.microsoft.com/en-us/library/ms156493.aspx
Format parameter comboboxes shown before report execution
is there a way to control the parameter comboboxes shown before report
execution? I do not like that the comboboxes show different length and I want
to change it.
I know that I can add and drop parameters in the report --> report
parameters menu, but I did not find a way how to control the format.
Regards,
MarcHi Marc,
Thank you for using MSDN Managed Newsgroup Support.
From your description, my understanding of this issue is: You want to
change the length of the parameter textbox of the Report Layout. If I
misunderstood your concern, please feel free to let me know.
Based on my scope, you could not change the length of the textbox. Thank
you for taking the time to provide feedback on this product. We are very
interested in your thoughts and opinions for improvements that we can make
to provide the features and functionality you and your customers would like
to see.
To provide your feedback directly to the product groups:
http://lab.msdn.microsoft.com/productfeedback/default.aspx
Thanks a lot!
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Wei Lu wrote:
> Hi Marc,
> Thank you for using MSDN Managed Newsgroup Support.
> From your description, my understanding of this issue is: You want to
> change the length of the parameter textbox of the Report Layout. If I
> misunderstood your concern, please feel free to let me know.
> Based on my scope, you could not change the length of the textbox. Thank
> you for taking the time to provide feedback on this product. We are very
> interested in your thoughts and opinions for improvements that we can make
> to provide the features and functionality you and your customers would like
> to see.
>
> To provide your feedback directly to the product groups:
> http://lab.msdn.microsoft.com/productfeedback/default.aspx
> Thanks a lot!
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================> This posting is provided "AS IS" with no warranties, and confers no rights.
Hi,
we did a big effort to get additional buttons into the parameter frame
that links to our own parameter windows as calendar in RS2000 as well
as a complete portfolio tree. The result will be written back into the
standard parameter combox.
It would be very helpful, if the WEBReportViewerControl of SSRS2005
would offer an .net programmable interface the add other parameter,
buttons, styles etc. - especially for the PARAMETER Frame (that in
RS2005 seems to be integrated in the WebReportViewControl).
That would make RS2005 more or less perfect. :-)
regards
BB|||Hi Bruce,
Thank you for your great suggestion.
You could provide your feedback to our product team directly.
http://lab.msdn.microsoft.com/productfeedback/default.aspx
Thank you for taking the time to provide feedback on this product.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Hello Wei, Hello Bruce
Thanks for your feedback - I placed this issue in Microsoft Connect -
Microsoft consider this feature to implement in a future release.
Best Regards
Marc|||Hi Marc,
Thank you for your feedback. If you have any questions or concerns, please
feel free to let me know!
Have a nice day!
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.
Sunday, February 26, 2012
Format for Parameters
example and run the report, after the data is displayed, the parameter
displays "12/1/2004 12:00:00AM". Is there any way to pass the typical date
format like "MM/dd/yyyy" to the parameter so that it formats the date only?
thanks
billHi Bill,
Based on my knowledge, we are unable to format the
parameters. But I would like to perform further research
to confirm if this is possible. I will update you once I
have more information.
BTW: If you display the date in a text box in the Report
body, you can set the format via the text box Properties
dialog box.
Sincerely,
William Wang
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
This posting is provided "AS IS" with no warranties, and
confers no rights.
--
>Reply-To: <sutphinwb@.nospam.nospam>
>From: <sutphinwb@.nospam.nospam>
>Subject: Format for Parameters
>Date: Wed, 2 Feb 2005 00:37:39 -0500
>Lines: 10
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
>X-RFC2646: Format=Flowed; Original
>Message-ID: <es9bQlOCFHA.1424@.TK2MSFTNGP09.phx.gbl>
>Newsgroups: microsoft.public.sqlserver.reportingsvcs
>NNTP-Posting-Host: ip24-250-32-203.ri.ri.cox.net
24.250.32.203
>Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.p
hx.gbl!TK2MSFTNGP09.phx.gbl
>Xref: cpmsftngxa10.phx.gbl
microsoft.public.sqlserver.reportingsvcs:41614
>X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
>Simple question - I have a date as a parameter. When I
enter 12/1/2004 for
>example and run the report, after the data is
displayed, the parameter
>displays "12/1/2004 12:00:00AM". Is there any way to
pass the typical date
>format like "MM/dd/yyyy" to the parameter so that it
formats the date only?
>thanks
>bill
>
>|||William is correct to the best of my knowledge as well... If you need pretty
formatting either use a string, check that it is a valid date, and format it
as you wish... You could also use an HTML page as a front end to the report,
formating date strings etc using html techniques, then passing the params to
the URL... ( I prefer the simpler string method if possible.)
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
<sutphinwb@.nospam.nospam> wrote in message
news:es9bQlOCFHA.1424@.TK2MSFTNGP09.phx.gbl...
> Simple question - I have a date as a parameter. When I enter 12/1/2004
for
> example and run the report, after the data is displayed, the parameter
> displays "12/1/2004 12:00:00AM". Is there any way to pass the typical
date
> format like "MM/dd/yyyy" to the parameter so that it formats the date
only?
> thanks
> bill
>|||You can use a stored procedure to retrieve the data from the database. And
then you can format the parameter inside the stored procedure.
"Wayne Snyder" wrote:
> William is correct to the best of my knowledge as well... If you need pretty
> formatting either use a string, check that it is a valid date, and format it
> as you wish... You could also use an HTML page as a front end to the report,
> formating date strings etc using html techniques, then passing the params to
> the URL... ( I prefer the simpler string method if possible.)
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> <sutphinwb@.nospam.nospam> wrote in message
> news:es9bQlOCFHA.1424@.TK2MSFTNGP09.phx.gbl...
> > Simple question - I have a date as a parameter. When I enter 12/1/2004
> for
> > example and run the report, after the data is displayed, the parameter
> > displays "12/1/2004 12:00:00AM". Is there any way to pass the typical
> date
> > format like "MM/dd/yyyy" to the parameter so that it formats the date
> only?
> >
> > thanks
> >
> > bill
> >
> >
>
>
Format for a bigint parameter in Raiserror
Having a small problem with RAISERROR that I've isolated to a small code sample:
The objective is to have the message string in Raiserror correctly report the value of a parameter that is a bigint. The following extract shows the problem:
ALTER PROCEDURE [dbo].[pr_Test]
@.SomeNumber bigint
AS
BEGIN
SET NOCOUNT ON;
RAISERROR('Test Error Number: %d.',16,1,@.SomeNumber)
END
As written, when the procedure is executed with the value 1 passed in the @.SomeNumber parameter, the result is:
Msg 2786, Level 16, State 1, Procedure pr_Test, Line 19
The data type of substitution parameter 1 does not match the expected type of the format specification.
If the datatype for @.SomeNumber is changed to int, then the procedure executes correctly and reports 'Test Error Number: 1'. Any suggestions on how to fix this problem?
Regards,
Flavelle
There seems to a limitation with the numeric data type while using the Raiserror statement.
My suggestion is to cast the bigint to a varchar Here is the modified code block
alter PROCEDURE [dbo].[pr_Test]
@.SomeNumber BIGINT
AS
BEGIN
DECLARE @.NewNumber VARCHAR(1000)
SET @.NewNumber=CAST(@.SomeNumber AS VARCHAR(100))
SET NOCOUNT ON;
RAISERROR('Test Error Number: %s',16,1, @.NewNumber)
END
|||Have you looked at the definition for RAISERROR in Books Online? It says bigint is not a valid datatype for that parameter.
argument
Is the parameters used in the substitution for variables defined in msg_str or the message corresponding to msg_id. There can be 0 or more substitution parameters; however, the total number of substitution parameters cannot exceed 20. Each substitution parameter can be a local variable or any of these data types: int1, int2, int4, char, varchar, binary, or varbinary. No other data types are supported.
|||yes, i misread your post, and yes, casting/converting to a varchar datatype is a simple fix/workaround.|||
My thanks to you both - brokenrulz for the solution to the problem and Greg for reminding me that I have to remember to read the ENTIRE help file. Your reference to the supported datatypes for the parameters is deeply buried within the help topic.
Regards,
Flavelle
|||Hello,
Help files have been updated on July 2006 (http://msdn2.microsoft.com/en-us/library/ms178592.aspx) and it says "To convert a value to the Transact-SQL bigint data type, specify %I64d" (the letter before 64 begin a capital i).
Not need to cast the bigint into an nvarchar. I tested under SQL 2005 + SP (version 9.00.3054.00) and it works great.
Laurent
|||I was facing the same problem and your suggestion saved the day for me. A big thanks.Format for a bigint parameter in Raiserror
Having a small problem with RAISERROR that I've isolated to a small code sample:
The objective is to have the message string in Raiserror correctly report the value of a parameter that is a bigint. The following extract shows the problem:
ALTER PROCEDURE [dbo].[pr_Test]
@.SomeNumber bigint
AS
BEGIN
SET NOCOUNT ON;
RAISERROR('Test Error Number: %d.',16,1,@.SomeNumber)
END
As written, when the procedure is executed with the value 1 passed in the @.SomeNumber parameter, the result is:
Msg 2786, Level 16, State 1, Procedure pr_Test, Line 19
The data type of substitution parameter 1 does not match the expected type of the format specification.
If the datatype for @.SomeNumber is changed to int, then the procedure executes correctly and reports 'Test Error Number: 1'. Any suggestions on how to fix this problem?
Regards,
Flavelle
There seems to a limitation with the numeric data type while using the Raiserror statement.
My suggestion is to cast the bigint to a varchar Here is the modified code block
alter PROCEDURE [dbo].[pr_Test]
@.SomeNumber BIGINT
AS
BEGIN
DECLARE @.NewNumber VARCHAR(1000)
SET @.NewNumber=CAST(@.SomeNumber AS VARCHAR(100))
SET NOCOUNT ON;
RAISERROR('Test Error Number: %s',16,1, @.NewNumber)
END
|||Have you looked at the definition for RAISERROR in Books Online? It says bigint is not a valid datatype for that parameter.
argument
Is the parameters used in the substitution for variables defined in msg_str or the message corresponding to msg_id. There can be 0 or more substitution parameters; however, the total number of substitution parameters cannot exceed 20. Each substitution parameter can be a local variable or any of these data types: int1, int2, int4, char, varchar, binary, or varbinary. No other data types are supported.
|||yes, i misread your post, and yes, casting/converting to a varchar datatype is a simple fix/workaround.|||
My thanks to you both - brokenrulz for the solution to the problem and Greg for reminding me that I have to remember to read the ENTIRE help file. Your reference to the supported datatypes for the parameters is deeply buried within the help topic.
Regards,
Flavelle
|||Hello,
Help files have been updated on July 2006 (http://msdn2.microsoft.com/en-us/library/ms178592.aspx) and it says "To convert a value to the Transact-SQL bigint data type, specify %I64d" (the letter before 64 begin a capital i).
Not need to cast the bigint into an nvarchar. I tested under SQL 2005 + SP (version 9.00.3054.00) and it works great.
Laurent
|||I was facing the same problem and your suggestion saved the day for me. A big thanks.