Showing posts with label format. Show all posts
Showing posts with label format. Show all posts

Friday, March 23, 2012

Passing Date as String

I have a report that returns date in the format 'YYYY-MM-DD'. This report
has no parameters, but I am drilling to another report that accepts date as a
parameter. So, I select the textbox I want to drill from and select "Jump to
Report". I select the report to be drilled to and define the parameters that
are to be passed.
Parameter Parameter Value
date =Fields!date.Value
Next, I go to the report that is to be drilled to and add date as a
parameter. Parameter name "date", parameter data type "string". Now, when
the drill report passes the date to the drilled report, the date parameter is
filled in as:
MM/DD/YYYY 00:00:00
Why is RS converting my strings and what is the best way to either make it
stop or work around this problem.
Thanks for any help!Sprinkle liberally with:
=Format(Convert.ToDateTime(Fields!date.Value), "yyyy-MM-dd")
Cheers,
"asnewbie+rs=argh" wrote:
> I have a report that returns date in the format 'YYYY-MM-DD'. This report
> has no parameters, but I am drilling to another report that accepts date as a
> parameter. So, I select the textbox I want to drill from and select "Jump to
> Report". I select the report to be drilled to and define the parameters that
> are to be passed.
> Parameter Parameter Value
> date =Fields!date.Value
> Next, I go to the report that is to be drilled to and add date as a
> parameter. Parameter name "date", parameter data type "string". Now, when
> the drill report passes the date to the drilled report, the date parameter is
> filled in as:
> MM/DD/YYYY 00:00:00
> Why is RS converting my strings and what is the best way to either make it
> stop or work around this problem.
> Thanks for any help!
>

Passing Date as aparameter to linked report from Parent report and then Dates format is Au

Hi
I need one urgent help.
When Passing Date as aparameter to linked report from Parent report,
the format of date is Automatically changing from dd/mm/yy to mm/dd/
yy. How to restrict it?
What is the solution for it in SP or rdl?
TIA.
PuneetPuneet,
Maybe you can also pass a parameter with the desired format, like "dd/mm/yy"
(this can be kept as a parameter in your application or database, so you can
change it dynamically).
Then, in the subreport, use formatting to display the date using the desired
format.
Andrei.
"appu" <ajmera.puneet@.gmail.com> wrote in message
news:1192120804.765315.73850@.o80g2000hse.googlegroups.com...
> Hi
> I need one urgent help.
> When Passing Date as aparameter to linked report from Parent report,
> the format of date is Automatically changing from dd/mm/yy to mm/dd/
> yy. How to restrict it?
> What is the solution for it in SP or rdl?
> TIA.
> Puneet
>

Tuesday, March 20, 2012

Passing a SQL Query / MDX Query to RDL

Has anybody passed a SQL Query or an MDX Query as a source to an RDL file?
This is what I am trying to do:
I have a Report whose format is exactly the same but I need to use it
for creating different reports.
For Example) The Report prints Employee name and address and I want to use
the same RDL to print Customer Name and Address.
I am redefining the query so, that column names are same
Ex) EMP_NAME as NAME and EMP_ADDRESS as ADDRESS
ThanksOn Jul 13, 11:36 am, jvn <sha...@.online.nospam> wrote:
> Has anybody passed a SQL Query or an MDX Query as a source to an RDL file?
> This is what I am trying to do:
> I have a Report whose format is exactly the same but I need to use it
> for creating different reports.
> For Example) The Report prints Employee name and address and I want to use
> the same RDL to print Customer Name and Address.
> I am redefining the query so, that column names are same
> Ex) EMP_NAME as NAME and EMP_ADDRESS as ADDRESS
> Thanks
You should be able to do this if you are dynamically creating the RDL
file in a custom application. You will want to change the query found
in this location: <DataSets><DataSet><Query><CommandText>...</
CommandText></Query></DataSet></DataSets>
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||I'm relatively new to Reporting Services. I'm working with SSRS 2000,
perhaps you are working with SSRS 2005.
I'm reading the book 'Hitchikers Guide to SQL Server 2000 Reporting
Services'.
The suggested approach in this book is to add a report parameter (e.g.
ReportSubject) with the values 'employees' and 'customers'.
Create a new dataset, select command type 'Text'. Manually add the
field names referring tot database field names NAME and ADRESS.
Enter the following expression:
= IIF(Parameters!ReportSubject.Value = 'employees', "SELECT EMP_NAME
as NAME, EMP_ADDRESS as ADDRESS FROM ...", "SELECT CUST_NAME as
NAME, CUST_ADDRESS as ADDRESS FROM ...")
This may become rather complex when you also want to use the report
for other purposes (nested IFF statements). But in that case you could
create a custom code function in VB so you can you CASE-statements
etc. This is not as complex as you might think.
Regards,
Willy