Showing posts with label parameter. Show all posts
Showing posts with label parameter. Show all posts

Wednesday, March 28, 2012

RSClientPrint Parameter Issues

Hi All

We're having a technical issue integrating the print reports into the portal. I'm hoping maybe some of your guys can help. We're using the RSClientPrint component to print the reports. The problem appears to be a conflict between the & in the URL and the & in the parameter value's cube reference. Below is an HTML code snippet. The 1st button works fine for us, it prints everything and has no & in the parameter's cube references. The second button references specific User and Employee values and therefore has & in the cube reference and generates an error. We tried encoding the & as & but it did not help. Thanks.

<html>
<body>


<OBJECT ID="RSClientPrint" CLASSID="CLSID:FA91DF8D-53AB-455D-AB20-F2F023E498D3"></OBJECT>

<script type="text/javascript">
function Print(ReportServer, ReportParameters, ReportTitle ) {
RSClientPrint.MarginLeft = .5 * 25.4;
RSClientPrint.MarginTop = .5 * 25.4;
RSClientPrint.MarginRight = .5 * 25.4;
RSClientPrint.MarginBottom = .5 * 25.4;
RSClientPrint.Culture = 1033;
RSClientPrint.UICulture = 1033;
RSClientPrint.PageWidth = 11 * 25.4;
RSClientPrint.PageHeight = 8.5 * 25.4;
RSClientPrint.Authenticate = false;
RSClientPrint.Print(ReportServer, ReportParameters, ReportTitle);
}

</script>


<button onclick="Print('http://localhost/reportserver', '/SA/SA.Report.6.Print&SessionSession=[Session].[Session].[All]&UserUser=[User].[User].[All]&TerritoryIdentifier=[Territory].[Identifier].[All]&EmployeeActiveFlag=[Employee].[Active Flag].[All]&EmployeeIdentifier=[Employee].[Identifier].[All]', 'SA.Report.6');"/>

<button onclick="Print('http://localhost/reportserver', '/SA/SA.Report.6.Print&SessionSession=[Session].[Session].&[1]&UserUser=[User].[User].&[1]&[1]&TerritoryIdentifier=[Territory].[Identifier].[All]&EmployeeActiveFlag=[Employee].[Active Flag].[All]&EmployeeIdentifier=[Employee].[Identifier].&[3356953]', 'SA.Report.6');"/>

</body>
</html>

Regards,

Nanda kumar R

&amp; is the encoding of & in xml, try using %26 which is the Url encoding of &.|||

Hi Daniel Reib,

Its working fine.

Thanks,

Regards,

Nanda kumar R

RSClientPrint Parameter Issues

Hi All

We're having a technical issue integrating the print reports into the portal. I'm hoping maybe some of your guys can help. We're using the RSClientPrint component to print the reports. The problem appears to be a conflict between the & in the URL and the & in the parameter value's cube reference. Below is an HTML code snippet. The 1st button works fine for us, it prints everything and has no & in the parameter's cube references. The second button references specific User and Employee values and therefore has & in the cube reference and generates an error. We tried encoding the & as &amp; but it did not help. Thanks.

<html>
<body>


<OBJECT ID="RSClientPrint" CLASSID="CLSID:FA91DF8D-53AB-455D-AB20-F2F023E498D3"></OBJECT>

<script type="text/javascript">
function Print(ReportServer, ReportParameters, ReportTitle ) {
RSClientPrint.MarginLeft = .5 * 25.4;
RSClientPrint.MarginTop = .5 * 25.4;
RSClientPrint.MarginRight = .5 * 25.4;
RSClientPrint.MarginBottom = .5 * 25.4;
RSClientPrint.Culture = 1033;
RSClientPrint.UICulture = 1033;
RSClientPrint.PageWidth = 11 * 25.4;
RSClientPrint.PageHeight = 8.5 * 25.4;
RSClientPrint.Authenticate = false;
RSClientPrint.Print(ReportServer, ReportParameters, ReportTitle);
}

</script>


<button onclick="Print('http://localhost/reportserver', '/SA/SA.Report.6.Print&SessionSession=[Session].[Session].[All]&UserUser=[User].[User].[All]&TerritoryIdentifier=[Territory].[Identifier].[All]&EmployeeActiveFlag=[Employee].[Active Flag].[All]&EmployeeIdentifier=[Employee].[Identifier].[All]', 'SA.Report.6');"/>

<button onclick="Print('http://localhost/reportserver', '/SA/SA.Report.6.Print&SessionSession=[Session].[Session].&[1]&UserUser=[User].[User].&[1]&[1]&TerritoryIdentifier=[Territory].[Identifier].[All]&EmployeeActiveFlag=[Employee].[Active Flag].[All]&EmployeeIdentifier=[Employee].[Identifier].&[3356953]', 'SA.Report.6');"/>

</body>
</html>

Regards,

Nanda kumar R

&amp; is the encoding of & in xml, try using %26 which is the Url encoding of &.|||

Hi Daniel Reib,

Its working fine.

Thanks,

Regards,

Nanda kumar R

sql

Friday, March 23, 2012

RS2005 Parameter value persists

I have a simple RS2005 report with 2 parameters, one with a default value
defined and one without.
When the report is viewed in designer "Preview" mode the second parameter
must be selected before "View Report" will run.
When deployed and viewed through Report Manager and IE6, the second
parameter comes up with the old value and the report fills automatically (I
can then select another value for the parameter and things work OK).
I've cleared temp files, restarted, etc. to no avail.
How can I get the deployed version to forget the default value?OK-I seem to have solved this.
Looking in SQL Server's Report Server database, table dbo.Catalog, in the
row for my report, in the Parameter field, I found the erroneous default
value stored. Changing the Default Value in the Report Parameters screen had
no effect on this SQL Server value. Only after removing the parameter,
re-deploying, adding the parameter back and deploying again could I remove
the erroneous default value.
"Paul" wrote:
> I have a simple RS2005 report with 2 parameters, one with a default value
> defined and one without.
> When the report is viewed in designer "Preview" mode the second parameter
> must be selected before "View Report" will run.
> When deployed and viewed through Report Manager and IE6, the second
> parameter comes up with the old value and the report fills automatically (I
> can then select another value for the parameter and things work OK).
> I've cleared temp files, restarted, etc. to no avail.
> How can I get the deployed version to forget the default value?

RS2005 Multi-Value Problem, urgent!

Dose RS 2005 Multi-Value parameter function can work?
Trying to use multi-value function of RS2005,
dataset named as "AdventureWorks and syntax as following:
SELECT Name, ProductCategoryID
FROM Production.ProductCategory
WHERE (ProductCategoryID = @.ID)
Properties: multi-value
Available values: From query
Dataset: dataset1
Value field: ProductCategoryID
Label field: Name
Dataset1's syntax:
SELECT Name, ProductCategoryID
FROM Production.ProductCategory
Preview report and choice Bikes, Clothing has error msg:
An error occurred during local report processing.
An error has occurred during report processing.
Query execution failed for data set 'AdventureWorks'.
Incorrect syntax near ','.
Dose anyone has the same problem?
In Beta the Multi-Value function is ok,
but in released enterprise version I have this problem?
What's happened?
Thanks for any advice!
AngiYou have to write
... WHERE ProductCategoryID IN (@.ID)
"Angi" <enchiw@.msn.com> schrieb im Newsbeitrag
news:uIw261SAGHA.3968@.TK2MSFTNGP10.phx.gbl...
> Dose RS 2005 Multi-Value parameter function can work?
> Trying to use multi-value function of RS2005,
> dataset named as "AdventureWorks and syntax as following:
> SELECT Name, ProductCategoryID
> FROM Production.ProductCategory
> WHERE (ProductCategoryID = @.ID)
> Properties: multi-value
> Available values: From query
> Dataset: dataset1
> Value field: ProductCategoryID
> Label field: Name
> Dataset1's syntax:
> SELECT Name, ProductCategoryID
> FROM Production.ProductCategory
> Preview report and choice Bikes, Clothing has error msg:
> An error occurred during local report processing.
> An error has occurred during report processing.
> Query execution failed for data set 'AdventureWorks'.
> Incorrect syntax near ','.
> Dose anyone has the same problem?
> In Beta the Multi-Value function is ok,
> but in released enterprise version I have this problem?
> What's happened?
> Thanks for any advice!
> Angi
>|||uh... Thanks Ralph...
Don't know what I think... ><
Make the funny mistake..
"Ralph Watermann" <We.Want@.NoSpam.de> ¼¶¼g©ó¶l¥ó·s»D:uizY49VAGHA.3928@.tk2msftngp13.phx.gbl...
> You have to write
> ... WHERE ProductCategoryID IN (@.ID)
>
> "Angi" <enchiw@.msn.com> schrieb im Newsbeitrag
> news:uIw261SAGHA.3968@.TK2MSFTNGP10.phx.gbl...
>> Dose RS 2005 Multi-Value parameter function can work?
>> Trying to use multi-value function of RS2005,
>> dataset named as "AdventureWorks and syntax as following:
>> SELECT Name, ProductCategoryID
>> FROM Production.ProductCategory
>> WHERE (ProductCategoryID = @.ID)
>> Properties: multi-value
>> Available values: From query
>> Dataset: dataset1
>> Value field: ProductCategoryID
>> Label field: Name
>> Dataset1's syntax:
>> SELECT Name, ProductCategoryID
>> FROM Production.ProductCategory
>> Preview report and choice Bikes, Clothing has error msg:
>> An error occurred during local report processing.
>> An error has occurred during report processing.
>> Query execution failed for data set 'AdventureWorks'.
>> Incorrect syntax near ','.
>> Dose anyone has the same problem?
>> In Beta the Multi-Value function is ok,
>> but in released enterprise version I have this problem?
>> What's happened?
>> Thanks for any advice!
>> Angi
>

RS2005 multi-select parameter

How do I use the mult-select parameter option on a report and pass it
to the stored procedure?
ie. if I have a multi-select list of employees and I pass in the
employeeid to the proc
would I?
create procedure show_employees(@.empid int)
as
select * from employees where empid in (@.empid)
would that work?
Regards,
Tom OlthoffNope. The stored procedure won't work (note that SQL will work in RS).
Why it doesn't work has nothing really to do with RS but has to do with
Stored Procedures in SQL Server. You cannot do the following in a stored
procedure. Let's say you have a Parameter called @.MyParams Now you can map
that parameter to a multi-value parameter but if in your stored procedure
you try to do this:
select * from sometable where somefield in (@.MyParams)
It won't work. Try it. Create a stored procedure and try to pass a
multi-value parameter to the stored procedure. It won't work.What you can do
is to have a string parameter that is passed as a multivalue parameter and
then change the string into a table.
This technique was told to me by SQL Server MVP, Erland Sommarskog
For example I have done this
inner join charlist_to_table(@.STO,Default)f on b.sto = f.str
So note this is NOT an issue with RS, it is strictly a stored procedure
issue.
Here is the function:
CREATE FUNCTION charlist_to_table
(@.list ntext,
@.delimiter nchar(1) = N',')
RETURNS @.tbl TABLE (listpos int IDENTITY(1, 1) NOT NULL,
str varchar(4000),
nstr nvarchar(2000)) AS
BEGIN
DECLARE @.pos int,
@.textpos int,
@.chunklen smallint,
@.tmpstr nvarchar(4000),
@.leftover nvarchar(4000),
@.tmpval nvarchar(4000)
SET @.textpos = 1
SET @.leftover = ''
WHILE @.textpos <= datalength(@.list) / 2
BEGIN
SET @.chunklen = 4000 - datalength(@.leftover) / 2
SET @.tmpstr = @.leftover + substring(@.list, @.textpos, @.chunklen)
SET @.textpos = @.textpos + @.chunklen
SET @.pos = charindex(@.delimiter, @.tmpstr)
WHILE @.pos > 0
BEGIN
SET @.tmpval = ltrim(rtrim(left(@.tmpstr, @.pos - 1)))
INSERT @.tbl (str, nstr) VALUES(@.tmpval, @.tmpval)
SET @.tmpstr = substring(@.tmpstr, @.pos + 1, len(@.tmpstr))
SET @.pos = charindex(@.delimiter, @.tmpstr)
END
SET @.leftover = @.tmpstr
END
INSERT @.tbl(str, nstr) VALUES (ltrim(rtrim(@.leftover)),
ltrim(rtrim(@.leftover)))
RETURN
END
GO
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<OTSolutions@.shaw.ca> wrote in message
news:1144854681.805431.214920@.i40g2000cwc.googlegroups.com...
> How do I use the mult-select parameter option on a report and pass it
> to the stored procedure?
> ie. if I have a multi-select list of employees and I pass in the
> employeeid to the proc
> would I?
> create procedure show_employees(@.empid int)
> as
> select * from employees where empid in (@.empid)
> would that work?
> Regards,
> Tom Olthoff
>|||You can do this using XML I believe.
Pass an XML string that looks like this:
<root>
<param1>
<multiParam>value1</multiParam>
<multiParam>value2</multiParam>
<multiParam>value3</multiParam>
</param1>
</root>
And then use SQL's readXML function to read multiple values from the
XML.|||The one problem with that approach is its not really a list of
parameters its one paramter that is a string of XML.
regards,
Stas K.|||You can read about this approach with the sp_XML_PrepareDocument
function:
http://msdn2.microsoft.com/en-us/library/ms187367(SQL.90).aspx
as for the actual access to the xml:
OPENXML( @.XMLString, N'/root/param1/multiparam/*')
http://msdn2.microsoft.com/en-us/library/ms186918(SQL.90).aspx
regards,
Stas K.

RS2005 Multiple Parameters

Hi

I'm new to RS, I've got SQL2005 installed and I'm trying to use the multiple select report parameter. I'm using a report filter to = database.field IN =Parameter.value(0) etc and even though I'm select more than one in the drop down it's only returning values for one of the options!

Helps what else do I need to do?

Thanks!Fixed, I removed the (0) from the .value filter expressions and it worked.

RS2005 MDX report parameters

With a report is created against a cube, the data designer generates
the mdx. If a field is checked as a parameter, the mdx will include
something like this:
SELECT ( STRTOSET(@.ProductDimCatgLabel, CONSTRAINED)
As a default when the report is run, a dropdown presents all possible
values.
Behind the scenes, RS takes the friendly value presented in the
dropdown and formulates the correct syntax.
For example, in my case a value of 'abc' might be presented in the
dropdown, but if I have a textbox in the report that shows the value of
the parameter, it shows '[Product Dim].[Catg Label].&[abc]'
Ok, the problem is, what do I do if I want to imbed the report in an
application, as opposed to using the RS website presentation. This
means I don't want a prompt for the parameter, I want to feed the value
myself.
If I use 'abc' I get a syntax error. If I use '[Product Dim].[Catg
Label].&[abc]' I get 'The restrictions imposed by the CONSTRAINED flag
in the STRTOSET function were violated'.
So I'm continuing to experiment, but I'm very constricted by what RS is
doing with MDX under the covers.
TIA,
JimOr put another way, if I make the parameter Non-queried, how to I pass
the value?|||Umm, I think I'm getting it. I definitely have to pass the extended
version as a parameter.

Wednesday, March 21, 2012

RS2005 drops parameter mapping in data tab

I have been creating some reports with RS2005, and encountered an odd problem:
Going into the data tab, I can edit my data set, and see that my parameters
are properly mapped. Leaving 'edit', I click on 'Refresh Fields', and
instead of being prompted for the 4 parameters I expect to see, there is only
one. I fill that one out and continue, and receive multiple "Must declare
the scalar variable '@.variablename' " errors. Going back into the data set
edit, all of my parameter mapping is gone.
The approach I've taken (on new reports when this happens) is to declare the
parameters as variables, long enough to get a successful 'refresh fields',
then delete the variables, and map them as parameters. As long as I get back
on the layout tab immediately and save changes, the parameter mapping
survives.
If I select 'Run' on the data tab, I lose the same three parameters as with
'Refresh Fields', but upon going back into edit of the data set, the
parameter mapping is still intact.
If this were just me, or just my PC, I'd consider reinstalling, etc., but
I've got a co-worker who is having the same problem on his PC.
Any thoughts, suggestions, me-too stories?
Thanks,
BruceThis has happened to me just recently - I had to repopulate the Fields
all over! ><|||I've had this happen with ODBC (unnamed parameters) but not with SQL Server.
Is this to a stored procedure or with just straight SQL?
What I did (your way was not an option) is I would view the code and change
the query in the rdl file. If you do this make a copy first.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"MrGrumpy" <MrGrumpy@.discussions.microsoft.com> wrote in message
news:18FE993D-0A47-4CA4-A183-BE7F8766900A@.microsoft.com...
>I have been creating some reports with RS2005, and encountered an odd
>problem:
> Going into the data tab, I can edit my data set, and see that my
> parameters
> are properly mapped. Leaving 'edit', I click on 'Refresh Fields', and
> instead of being prompted for the 4 parameters I expect to see, there is
> only
> one. I fill that one out and continue, and receive multiple "Must declare
> the scalar variable '@.variablename' " errors. Going back into the data
> set
> edit, all of my parameter mapping is gone.
> The approach I've taken (on new reports when this happens) is to declare
> the
> parameters as variables, long enough to get a successful 'refresh fields',
> then delete the variables, and map them as parameters. As long as I get
> back
> on the layout tab immediately and save changes, the parameter mapping
> survives.
> If I select 'Run' on the data tab, I lose the same three parameters as
> with
> 'Refresh Fields', but upon going back into edit of the data set, the
> parameter mapping is still intact.
> If this were just me, or just my PC, I'd consider reinstalling, etc., but
> I've got a co-worker who is having the same problem on his PC.
> Any thoughts, suggestions, me-too stories?
> Thanks,
> Bruce
>|||The code initially was a stored procedure, but I had to bring it into the
report directly when I realized that I couldn't use a multi-valued parameter
with a stored procedure.
My co-worker has gone with editing the XML directly, which sounds like what
you're suggesting (although it seems really risky to me)
- Bruce
"Bruce L-C [MVP]" wrote:
> I've had this happen with ODBC (unnamed parameters) but not with SQL Server.
> Is this to a stored procedure or with just straight SQL?
> What I did (your way was not an option) is I would view the code and change
> the query in the rdl file. If you do this make a copy first.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "MrGrumpy" <MrGrumpy@.discussions.microsoft.com> wrote in message
> news:18FE993D-0A47-4CA4-A183-BE7F8766900A@.microsoft.com...
> >I have been creating some reports with RS2005, and encountered an odd
> >problem:
> >
> > Going into the data tab, I can edit my data set, and see that my
> > parameters
> > are properly mapped. Leaving 'edit', I click on 'Refresh Fields', and
> > instead of being prompted for the 4 parameters I expect to see, there is
> > only
> > one. I fill that one out and continue, and receive multiple "Must declare
> > the scalar variable '@.variablename' " errors. Going back into the data
> > set
> > edit, all of my parameter mapping is gone.
> >
> > The approach I've taken (on new reports when this happens) is to declare
> > the
> > parameters as variables, long enough to get a successful 'refresh fields',
> > then delete the variables, and map them as parameters. As long as I get
> > back
> > on the layout tab immediately and save changes, the parameter mapping
> > survives.
> >
> > If I select 'Run' on the data tab, I lose the same three parameters as
> > with
> > 'Refresh Fields', but upon going back into edit of the data set, the
> > parameter mapping is still intact.
> >
> > If this were just me, or just my PC, I'd consider reinstalling, etc., but
> > I've got a co-worker who is having the same problem on his PC.
> >
> > Any thoughts, suggestions, me-too stories?
> >
> > Thanks,
> > Bruce
> >
>
>

RS2005 Date parameter - JScript error

I have a RS2005 report that was deployed to a ReportServer and has been running for over 1 month. I personally have not run this report in the past month, however, today when I tried to run it I got an error trying to select a date parameter. I can't paste samples of the windows displayed, so I'll do my best to explain. When I click on the report, it goes to the View window and displays 2 date parameter fields. When I click the icon next to one of the parameter fields, I get an error window that says

A Runtime Error has occurred.

Do you wish to Debug?

Line: 383

Error: 'resultfield.id' is null or not an object

I click Yes and get a VS Just-in-Time Debugger window, where I choose New instance of VS 2005. When VS2005 opens, then I get this error:

Microsoft JScript runtime error: 'resultfield.id' is null or not an object

The Continue option just keeps displaying this error, when I click Break it shows me the code below and has highlighted the line I show in BOLD:

function ClickDay(date)

{

var win = document.parentWindow;

if (!win) win = document.contentWindow;

if (!win) win = document.defaultView;

if (!win) return true;

var ifrm=win.frameElement;

if (ifrm==null)

{

return MoveToDate(date, false);

}

var eltValidator=win.parent.document.getElementById(ifrm.resultfield.id+g_strDatePickerRangeValidatorID);

if (eltValidator !=null)

{

eltValidator.style.display="none";

}

var OnSelectDateCallback=ifrm.OnSelectDateCallback;

OnSelectDateCallback(ifrm.resultfield, date);

var resultfunc=ifrm.resultfunc;

resultfunc(ifrm.resultfield);

return true;

}

To make this more confusing, after I get this error a few times, eventually it lets me choose a date and run the report. Another quirk of my PC is that I often get runtime errors that ask me if I want to Debug when I'm in IExplorer.

Any idea what is going on and how to fix it?

Thanks in advance!Hi! I have the same problem!!
Do you have fix it?
Thanks in advance!|||Unfortunately, no. Not long after I posted this, I got pulled to another project. I will probably start working on this project again some time next week, so if I figure out how to fix this I will post it. Good luck!|||thanks!
If I find the solution I'll post it!|||

I also have this error when two date controls are in use, it seems to be a timing issue. When I click the calendar icon for one date, and it is posting back, if I manage to click the 2nd calendar icon during the postback I get the error.

Not sure if there is any possible solution for this ?

|||

I was experiencing the same problem with the calendar controls until I figured out that it was my McAfee "on access" scanner causing the problems. Once I disabled the scanner, everything worked fine. Enable it, and the problem returns. You can also wait about 5 seconds after the page loads and the controls should work. It makes since, because these "on access" scans always increase page loading times. For once, it's not a Microsoft problem. I know...shocking, isn't it?

Hope this helps with your prob.

Later....

|||Definitely sounds like a possible solution, we do have McAfee and the 'wait about 5 seconds' explains why I was able to get it to work later. I haven't deployed this to too many users yet, so maybe I'll feel more comfortable deploying it now if it looks like this is the problem. Thanks for the response!

RS2005 Date parameter - JScript error

I have a RS2005 report that was deployed to a ReportServer and has been running for over 1 month. I personally have not run this report in the past month, however, today when I tried to run it I got an error trying to select a date parameter. I can't paste samples of the windows displayed, so I'll do my best to explain. When I click on the report, it goes to the View window and displays 2 date parameter fields. When I click the icon next to one of the parameter fields, I get an error window that says

A Runtime Error has occurred.

Do you wish to Debug?

Line: 383

Error: 'resultfield.id' is null or not an object

I click Yes and get a VS Just-in-Time Debugger window, where I choose New instance of VS 2005. When VS2005 opens, then I get this error:

Microsoft JScript runtime error: 'resultfield.id' is null or not an object

The Continue option just keeps displaying this error, when I click Break it shows me the code below and has highlighted the line I show in BOLD:

function ClickDay(date)

{

var win = document.parentWindow;

if (!win) win = document.contentWindow;

if (!win) win = document.defaultView;

if (!win) return true;

var ifrm=win.frameElement;

if (ifrm==null)

{

return MoveToDate(date, false);

}

var eltValidator=win.parent.document.getElementById(ifrm.resultfield.id+g_strDatePickerRangeValidatorID);

if (eltValidator !=null)

{

eltValidator.style.display="none";

}

var OnSelectDateCallback=ifrm.OnSelectDateCallback;

OnSelectDateCallback(ifrm.resultfield, date);

var resultfunc=ifrm.resultfunc;

resultfunc(ifrm.resultfield);

return true;

}

To make this more confusing, after I get this error a few times, eventually it lets me choose a date and run the report. Another quirk of my PC is that I often get runtime errors that ask me if I want to Debug when I'm in IExplorer.

Any idea what is going on and how to fix it?

Thanks in advance!Hi! I have the same problem!!
Do you have fix it?
Thanks in advance!
|||Unfortunately, no. Not long after I posted this, I got pulled to another project. I will probably start working on this project again some time next week, so if I figure out how to fix this I will post it. Good luck!|||thanks!
If I find the solution I'll post it!
|||

I also have this error when two date controls are in use, it seems to be a timing issue. When I click the calendar icon for one date, and it is posting back, if I manage to click the 2nd calendar icon during the postback I get the error.

Not sure if there is any possible solution for this ?

|||

I was experiencing the same problem with the calendar controls until I figured out that it was my McAfee "on access" scanner causing the problems. Once I disabled the scanner, everything worked fine. Enable it, and the problem returns. You can also wait about 5 seconds after the page loads and the controls should work. It makes since, because these "on access" scans always increase page loading times. For once, it's not a Microsoft problem. I know...shocking, isn't it?

Hope this helps with your prob.

Later....

|||Definitely sounds like a possible solution, we do have McAfee and the 'wait about 5 seconds' explains why I was able to get it to work later. I haven't deployed this to too many users yet, so maybe I'll feel more comfortable deploying it now if it looks like this is the problem. Thanks for the response!sql

RS2005 Date parameter - JScript error

I have a RS2005 report that was deployed to a ReportServer and has been running for over 1 month. I personally have not run this report in the past month, however, today when I tried to run it I got an error trying to select a date parameter. I can't paste samples of the windows displayed, so I'll do my best to explain. When I click on the report, it goes to the View window and displays 2 date parameter fields. When I click the icon next to one of the parameter fields, I get an error window that says

A Runtime Error has occurred.

Do you wish to Debug?

Line: 383

Error: 'resultfield.id' is null or not an object

I click Yes and get a VS Just-in-Time Debugger window, where I choose New instance of VS 2005. When VS2005 opens, then I get this error:

Microsoft JScript runtime error: 'resultfield.id' is null or not an object

The Continue option just keeps displaying this error, when I click Break it shows me the code below and has highlighted the line I show in BOLD:

function ClickDay(date)

{

var win = document.parentWindow;

if (!win) win = document.contentWindow;

if (!win) win = document.defaultView;

if (!win) return true;

var ifrm=win.frameElement;

if (ifrm==null)

{

return MoveToDate(date, false);

}

var eltValidator=win.parent.document.getElementById(ifrm.resultfield.id+g_strDatePickerRangeValidatorID);

if (eltValidator !=null)

{

eltValidator.style.display="none";

}

var OnSelectDateCallback=ifrm.OnSelectDateCallback;

OnSelectDateCallback(ifrm.resultfield, date);

var resultfunc=ifrm.resultfunc;

resultfunc(ifrm.resultfield);

return true;

}

To make this more confusing, after I get this error a few times, eventually it lets me choose a date and run the report. Another quirk of my PC is that I often get runtime errors that ask me if I want to Debug when I'm in IExplorer.

Any idea what is going on and how to fix it?

Thanks in advance!Hi! I have the same problem!!
Do you have fix it?
Thanks in advance!
|||Unfortunately, no. Not long after I posted this, I got pulled to another project. I will probably start working on this project again some time next week, so if I figure out how to fix this I will post it. Good luck!|||thanks!
If I find the solution I'll post it!
|||

I also have this error when two date controls are in use, it seems to be a timing issue. When I click the calendar icon for one date, and it is posting back, if I manage to click the 2nd calendar icon during the postback I get the error.

Not sure if there is any possible solution for this ?

|||

I was experiencing the same problem with the calendar controls until I figured out that it was my McAfee "on access" scanner causing the problems. Once I disabled the scanner, everything worked fine. Enable it, and the problem returns. You can also wait about 5 seconds after the page loads and the controls should work. It makes since, because these "on access" scans always increase page loading times. For once, it's not a Microsoft problem. I know...shocking, isn't it?

Hope this helps with your prob.

Later....

|||Definitely sounds like a possible solution, we do have McAfee and the 'wait about 5 seconds' explains why I was able to get it to work later. I haven't deployed this to too many users yet, so maybe I'll feel more comfortable deploying it now if it looks like this is the problem. Thanks for the response!

RS2005 Date parameter - JScript error

I have a RS2005 report that was deployed to a ReportServer and has been running for over 1 month. I personally have not run this report in the past month, however, today when I tried to run it I got an error trying to select a date parameter. I can't paste samples of the windows displayed, so I'll do my best to explain. When I click on the report, it goes to the View window and displays 2 date parameter fields. When I click the icon next to one of the parameter fields, I get an error window that says

A Runtime Error has occurred.

Do you wish to Debug?

Line: 383

Error: 'resultfield.id' is null or not an object

I click Yes and get a VS Just-in-Time Debugger window, where I choose New instance of VS 2005. When VS2005 opens, then I get this error:

Microsoft JScript runtime error: 'resultfield.id' is null or not an object

The Continue option just keeps displaying this error, when I click Break it shows me the code below and has highlighted the line I show in BOLD:

function ClickDay(date)

{

var win = document.parentWindow;

if (!win) win = document.contentWindow;

if (!win) win = document.defaultView;

if (!win) return true;

var ifrm=win.frameElement;

if (ifrm==null)

{

return MoveToDate(date, false);

}

var eltValidator=win.parent.document.getElementById(ifrm.resultfield.id+g_strDatePickerRangeValidatorID);

if (eltValidator !=null)

{

eltValidator.style.display="none";

}

var OnSelectDateCallback=ifrm.OnSelectDateCallback;

OnSelectDateCallback(ifrm.resultfield, date);

var resultfunc=ifrm.resultfunc;

resultfunc(ifrm.resultfield);

return true;

}

To make this more confusing, after I get this error a few times, eventually it lets me choose a date and run the report. Another quirk of my PC is that I often get runtime errors that ask me if I want to Debug when I'm in IExplorer.

Any idea what is going on and how to fix it?

Thanks in advance!Hi! I have the same problem!!
Do you have fix it?
Thanks in advance!|||Unfortunately, no. Not long after I posted this, I got pulled to another project. I will probably start working on this project again some time next week, so if I figure out how to fix this I will post it. Good luck!|||thanks!
If I find the solution I'll post it!|||

I also have this error when two date controls are in use, it seems to be a timing issue. When I click the calendar icon for one date, and it is posting back, if I manage to click the 2nd calendar icon during the postback I get the error.

Not sure if there is any possible solution for this ?

|||

I was experiencing the same problem with the calendar controls until I figured out that it was my McAfee "on access" scanner causing the problems. Once I disabled the scanner, everything worked fine. Enable it, and the problem returns. You can also wait about 5 seconds after the page loads and the controls should work. It makes since, because these "on access" scans always increase page loading times. For once, it's not a Microsoft problem. I know...shocking, isn't it?

Hope this helps with your prob.

Later....

|||Definitely sounds like a possible solution, we do have McAfee and the 'wait about 5 seconds' explains why I was able to get it to work later. I haven't deployed this to too many users yet, so maybe I'll feel more comfortable deploying it now if it looks like this is the problem. Thanks for the response!

Tuesday, March 20, 2012

rs:ParameterLanguage URL access parameter

We tried setting rs:ParameterLanguage=en-US in the URL so international
users dates would stay in the MM/DD/YYYY format but it isn't working. We
have SP1 installed. Has anyone used this parameter successfully and if so
do you have any suggestions? Please help, our customers in the UK would
like to be able to view their reports. Thanks!Hi,
You can test this online on internet:
http://128.171.208.112/ReportServer?/Product%20Line%20Sales&rs:Command=Render&rc:zoom=100&rc:Parameters=True&rs:ParameterLanguage=en-us
Just add a new end date as parameter and press View.
Regards,
Marco Groeneveld
www.gmsbv.nl - your partner for MS Analyses and Reporting Services in
Europe !
"Jessica C" <jesscobbe@.hotmail.com> wrote in message news:<#JDcgRneEHA.2560@.TK2MSFTNGP09.phx.gbl>...
> We tried setting rs:ParameterLanguage=en-US in the URL so international
> users dates would stay in the MM/DD/YYYY format but it isn't working. We
> have SP1 installed. Has anyone used this parameter successfully and if so
> do you have any suggestions? Please help, our customers in the UK would
> like to be able to view their reports. Thanks!|||I'm having the same problem. I used the URL Access Parameter
"rs:ParameterLanguage=en-us" and the dates aren't coming out right. If I
select August 24, 2004 - instead of 8/24/2004 (how it should be), it
displays as 24/8/2004 which causes an error. I have SP1 installed, using
datetime for the parameter data type, using the ParameterLanguage parameter,
and it's still showing up backwards. Have you found a solution to this?
"Jessica C" <jesscobbe@.hotmail.com> wrote in message
news:#JDcgRneEHA.2560@.TK2MSFTNGP09.phx.gbl...
> We tried setting rs:ParameterLanguage=en-US in the URL so international
> users dates would stay in the MM/DD/YYYY format but it isn't working. We
> have SP1 installed. Has anyone used this parameter successfully and if so
> do you have any suggestions? Please help, our customers in the UK would
> like to be able to view their reports. Thanks!
>

rs:ClearSession not working

the report data does not refresh even though i added the rs:ClearSession parameter to the URL..i have to click the refresh button to get the latest data..

the URL i use:

http://localhost/Alcon/Reports.aspx?rs:ClearSession=true&distCd=DPI&SOSummary=true

any ideas on how to solve this problem?

What is Reports.aspx? Is that your custom application?|||

yes, thr Reports.aspx is the pageviewer actually..

i already solve the problem... but the solution was a bit weird... i have to add the rs:ClearSession to the parameter of the report and not on the URL.

rs:about the Scope parameter of a aggregate function

A valid scope is the name of a grouping, dataset, or data region. Only groupings or data regions valid scope is the name of a grouping, dataset, or data region. Only groupings or data regions .
the meaning of data region? for example?See my response on the public RS newsgroup:

A data region is a list, matrix, table, or chart.
Please check Reporting Services BOL for more information, e.g.:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rscreate/htm/rcr_creating_structure_objects_v1_8epf.asp

-- Robert

rs:about the Scope parameter of a aggregate function

A valid scope is the name of a grouping, dataset, or data region. Only
groupings or data regions valid scope is the name of a grouping, dataset, or
data region. Only groupings or data regions .
the meaning of data region? for example?A data region is a list, matrix, table, or chart.
Please check Reporting Services BOL for more information, e.g.:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rscreate/htm/rcr_creating_structure_objects_v1_8epf.asp
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"aoeabc" <aoeabc@.discussions.microsoft.com> wrote in message
news:72ABECDD-41BB-427E-8CD8-AEC0776BF9F6@.microsoft.com...
>A valid scope is the name of a grouping, dataset, or data region. Only
> groupings or data regions valid scope is the name of a grouping, dataset,
> or
> data region. Only groupings or data regions .
> the meaning of data region? for example?|||Tell me an idea how to do this:
I have three records like this:
Type: 1
Amount: 100
Type 2
Amount: 200
Type 2
Amount: 100
The types of 1 must be negative and the 2 positive, so when I sum must be
-100+300 = 200 positive. I want to make a conditional sum. Now I made it
making the type 1 * -1 and then when I want to print the value amount *
iif(type = 1, -1, 1), so its very tired.
Any idea?
"Robert Bruckner [MSFT]" wrote:
> A data region is a list, matrix, table, or chart.
> Please check Reporting Services BOL for more information, e.g.:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rscreate/htm/rcr_creating_structure_objects_v1_8epf.asp
> -- Robert
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "aoeabc" <aoeabc@.discussions.microsoft.com> wrote in message
> news:72ABECDD-41BB-427E-8CD8-AEC0776BF9F6@.microsoft.com...
> >A valid scope is the name of a grouping, dataset, or data region. Only
> > groupings or data regions valid scope is the name of a grouping, dataset,
> > or
> > data region. Only groupings or data regions .
> > the meaning of data region? for example?
>
>

RS/MDX - Column Parameter / Field name in dataset problem

In creating a dataset with MDX, the field names (column captions) for
my dataset always resolve to the actual member name in the AS cube.
For example, if i use the following query as the datasource
With Set [GenericMeasureName] as '{[Measures].[Quantity]}'
SELECT {[GenericMeasureName]} ON COLUMNS, .... etc
The field name in the dataset still appears as [Measures].[Quantity]
instead of [GenericMeasureName] .
Why is this a problem? I need to parameterize Measures... If I build
the report with a field name of [Measures].[Quantity] and the user
selects [Measures].[Revenue] then the report no-worky.
I cannot put measures as rows, or page, or a slicer dimension or
anything like that...those are parameterized also. The users need to
filter on all dimensions for this (and many other) report.
I also tried to "Edit Data Set" and change the field name on the
"Fields" tab (edit dataset dialog) and same behavior.
I've been searching BOL, etc for a day now with no luck. It seems like
the answer should be a quick click on a setting somewhere... what am I
missing? thanks in advance.
JoelNot sure if this is exactly what you need, but I'll tell you how I've solved
a similar problem, based on cascading and dynamic parameters.
My report has 2 sets of parameters:
1) What dimension to slice on
2) Values in that dimension
My report is built so that I can put any of my parameters as my WHERE clause
in my MDX statement. The trick is to use the Uniquename of a member.
The first parameter is called Selection. I've hard coded a list of
dimensions, with a sort of Friendly name as the Label and the actual name of
the dimension as Value.
The next parameter is called SelectionSelected, and is based on an mdx query
building a list of parametrs based on the dimension selected previously.
Dataset is called ListDimensions and the mdx looks like this:
="WITH set [Listrows] as 'descendants([" & Parameters!Selection.Value &
"].defaultmember,1,self)'
MEMBER [MEASURES].[List_Qualified_Name] AS '[" & Parameters!Selection.Value
& "].CurrentMember.UniqueName'
MEMBER [MEASURES].[List_Report_Name] AS '[" & Parameters!Selection.Value &
"].CurrentMember.Name'
SELECT non empty {[MEASURES].[List_Report_Name],
[MEASURES].[List_Qualified_Name]} ON AXIS(0), non empty {[Listrows]} ON
AXIS(1) FROM [MyCube]"
The set will still keep the name of whatever dimensionname I used to get the
fields. But you don't need to use the name of this set for anything. You
need to use the member fields, and these will still be called
Measures_List_Qualified_Name and Measures_List_Report_Name.
In your report parameters, the parameter SelectionSelected should be tied to
your ListDimensions dataset, with Measures_List_Qualified_Name as your Value
field and Measures_List_Report_Name as the Label field. The unique name
(Measures_List_Qualified_Name) will be in the form of
[Dimension].[MemberLevel1].[MemberLevel2], while the
Report_Name will be the usual name (Like Store1).
So, in your report dataset, you use your basic mdx query, but in the WHERE
clause, you add Parameters!SelectionSelected.Value.
="Select {[Measures].[Totalt amount} on columns,
non empty descendants([Clients].defaultmember, 0, self_and_after) on rows
from [MyCube]
where (" & Parameters!SelectionSelected.Value & ")"
Now, the trick is that you can't really use the same dimension on more than
one axis, but that would be a problem anyway. You may have to tweak your mdx
a bit to make it work, but using Dimension.Currentmember.Uniquename should
be usefull for you.
Kaisa M. Lindahl
"JoelBarish" <stacijon@.gmail.com> wrote in message
news:1136572195.653007.143290@.z14g2000cwz.googlegroups.com...
> In creating a dataset with MDX, the field names (column captions) for
> my dataset always resolve to the actual member name in the AS cube.
> For example, if i use the following query as the datasource
> With Set [GenericMeasureName] as '{[Measures].[Quantity]}'
> SELECT {[GenericMeasureName]} ON COLUMNS, .... etc
> The field name in the dataset still appears as [Measures].[Quantity]
> instead of [GenericMeasureName] .
> Why is this a problem? I need to parameterize Measures... If I build
> the report with a field name of [Measures].[Quantity] and the user
> selects [Measures].[Revenue] then the report no-worky.
> I cannot put measures as rows, or page, or a slicer dimension or
> anything like that...those are parameterized also. The users need to
> filter on all dimensions for this (and many other) report.
> I also tried to "Edit Data Set" and change the field name on the
> "Fields" tab (edit dataset dialog) and same behavior.
> I've been searching BOL, etc for a day now with no luck. It seems like
> the answer should be a quick click on a setting somewhere... what am I
> missing? thanks in advance.
> Joel
>|||Kaisa -
This is wonderful. I have used a version of this technique before, but
your solution is even more dynamic with the introduction of the
parameter to select the dimension. Many Thanks and I know this will be
useful to me many many times.
I still can't figure out a way to make this work for the measures
dimension however, though it makes great sense for all other
dimensions.
The trick is using measure names the rows AND the columns (as you
mentioned) and I can't figure out how to twist the axis's correctly for
this result.
I'm thinking of creating a fake dimension with one member and use that
for the column header. Then couple this with your solution. Not sure
if this will work...keeping my fingers crossed
thanks again for the code!
Kaisa M. Lindahl wrote:
> Not sure if this is exactly what you need, but I'll tell you how I've solved
> a similar problem, based on cascading and dynamic parameters.
> My report has 2 sets of parameters:
> 1) What dimension to slice on
> 2) Values in that dimension
> My report is built so that I can put any of my parameters as my WHERE clause
> in my MDX statement. The trick is to use the Uniquename of a member.
> The first parameter is called Selection. I've hard coded a list of
> dimensions, with a sort of Friendly name as the Label and the actual name of
> the dimension as Value.
> The next parameter is called SelectionSelected, and is based on an mdx query
> building a list of parametrs based on the dimension selected previously.
> Dataset is called ListDimensions and the mdx looks like this:
> ="WITH set [Listrows] as 'descendants([" & Parameters!Selection.Value &
> "].defaultmember,1,self)'
> MEMBER [MEASURES].[List_Qualified_Name] AS '[" & Parameters!Selection.Value
> & "].CurrentMember.UniqueName'
> MEMBER [MEASURES].[List_Report_Name] AS '[" & Parameters!Selection.Value &
> "].CurrentMember.Name'
> SELECT non empty {[MEASURES].[List_Report_Name],
> [MEASURES].[List_Qualified_Name]} ON AXIS(0), non empty {[Listrows]} ON
> AXIS(1) FROM [MyCube]"
> The set will still keep the name of whatever dimensionname I used to get the
> fields. But you don't need to use the name of this set for anything. You
> need to use the member fields, and these will still be called
> Measures_List_Qualified_Name and Measures_List_Report_Name.
> In your report parameters, the parameter SelectionSelected should be tied to
> your ListDimensions dataset, with Measures_List_Qualified_Name as your Value
> field and Measures_List_Report_Name as the Label field. The unique name
> (Measures_List_Qualified_Name) will be in the form of
> [Dimension].[MemberLevel1].[MemberLevel2], while the
> Report_Name will be the usual name (Like Store1).
> So, in your report dataset, you use your basic mdx query, but in the WHERE
> clause, you add Parameters!SelectionSelected.Value.
> ="Select {[Measures].[Totalt amount} on columns,
> non empty descendants([Clients].defaultmember, 0, self_and_after) on rows
> from [MyCube]
> where (" & Parameters!SelectionSelected.Value & ")"
> Now, the trick is that you can't really use the same dimension on more than
> one axis, but that would be a problem anyway. You may have to tweak your mdx
> a bit to make it work, but using Dimension.Currentmember.Uniquename should
> be usefull for you.
> Kaisa M. Lindahl
> "JoelBarish" <stacijon@.gmail.com> wrote in message
> news:1136572195.653007.143290@.z14g2000cwz.googlegroups.com...
> > In creating a dataset with MDX, the field names (column captions) for
> > my dataset always resolve to the actual member name in the AS cube.
> >
> > For example, if i use the following query as the datasource
> > With Set [GenericMeasureName] as '{[Measures].[Quantity]}'
> > SELECT {[GenericMeasureName]} ON COLUMNS, .... etc
> >
> > The field name in the dataset still appears as [Measures].[Quantity]
> > instead of [GenericMeasureName] .
> >
> > Why is this a problem? I need to parameterize Measures... If I build
> > the report with a field name of [Measures].[Quantity] and the user
> > selects [Measures].[Revenue] then the report no-worky.
> >
> > I cannot put measures as rows, or page, or a slicer dimension or
> > anything like that...those are parameterized also. The users need to
> > filter on all dimensions for this (and many other) report.
> >
> > I also tried to "Edit Data Set" and change the field name on the
> > "Fields" tab (edit dataset dialog) and same behavior.
> >
> > I've been searching BOL, etc for a day now with no luck. It seems like
> > the answer should be a quick click on a setting somewhere... what am I
> > missing? thanks in advance.
> >
> > Joel
> >|||Glad to help, I've been pretty satisfied with that solution myself. ;)
Anyway, what are you trying to do with the measures? Creating a query "where
[Measures].[Totalamount] > 0" or something?
You could try asking for help in the Olap-newsgroup,
microsoft.public.sqlserver.olap, as you may get around the problem by
rewriting your mdx somewhat.
Kaisa
"JoelBarish" <stacijon@.gmail.com> wrote in message
news:1136821283.237700.90330@.g47g2000cwa.googlegroups.com...
> Kaisa -
> This is wonderful. I have used a version of this technique before, but
> your solution is even more dynamic with the introduction of the
> parameter to select the dimension. Many Thanks and I know this will be
> useful to me many many times.
> I still can't figure out a way to make this work for the measures
> dimension however, though it makes great sense for all other
> dimensions.
> The trick is using measure names the rows AND the columns (as you
> mentioned) and I can't figure out how to twist the axis's correctly for
> this result.
> I'm thinking of creating a fake dimension with one member and use that
> for the column header. Then couple this with your solution. Not sure
> if this will work...keeping my fingers crossed
> thanks again for the code!
>
>
> Kaisa M. Lindahl wrote:
>> Not sure if this is exactly what you need, but I'll tell you how I've
>> solved
>> a similar problem, based on cascading and dynamic parameters.
>> My report has 2 sets of parameters:
>> 1) What dimension to slice on
>> 2) Values in that dimension
>> My report is built so that I can put any of my parameters as my WHERE
>> clause
>> in my MDX statement. The trick is to use the Uniquename of a member.
>> The first parameter is called Selection. I've hard coded a list of
>> dimensions, with a sort of Friendly name as the Label and the actual name
>> of
>> the dimension as Value.
>> The next parameter is called SelectionSelected, and is based on an mdx
>> query
>> building a list of parametrs based on the dimension selected previously.
>> Dataset is called ListDimensions and the mdx looks like this:
>> ="WITH set [Listrows] as 'descendants([" & Parameters!Selection.Value &
>> "].defaultmember,1,self)'
>> MEMBER [MEASURES].[List_Qualified_Name] AS '[" &
>> Parameters!Selection.Value
>> & "].CurrentMember.UniqueName'
>> MEMBER [MEASURES].[List_Report_Name] AS '[" & Parameters!Selection.Value
>> &
>> "].CurrentMember.Name'
>> SELECT non empty {[MEASURES].[List_Report_Name],
>> [MEASURES].[List_Qualified_Name]} ON AXIS(0), non empty {[Listrows]} ON
>> AXIS(1) FROM [MyCube]"
>> The set will still keep the name of whatever dimensionname I used to get
>> the
>> fields. But you don't need to use the name of this set for anything. You
>> need to use the member fields, and these will still be called
>> Measures_List_Qualified_Name and Measures_List_Report_Name.
>> In your report parameters, the parameter SelectionSelected should be tied
>> to
>> your ListDimensions dataset, with Measures_List_Qualified_Name as your
>> Value
>> field and Measures_List_Report_Name as the Label field. The unique name
>> (Measures_List_Qualified_Name) will be in the form of
>> [Dimension].[MemberLevel1].[MemberLevel2], while the
>> Report_Name will be the usual name (Like Store1).
>> So, in your report dataset, you use your basic mdx query, but in the
>> WHERE
>> clause, you add Parameters!SelectionSelected.Value.
>> ="Select {[Measures].[Totalt amount} on columns,
>> non empty descendants([Clients].defaultmember, 0, self_and_after) on rows
>> from [MyCube]
>> where (" & Parameters!SelectionSelected.Value & ")"
>> Now, the trick is that you can't really use the same dimension on more
>> than
>> one axis, but that would be a problem anyway. You may have to tweak your
>> mdx
>> a bit to make it work, but using Dimension.Currentmember.Uniquename
>> should
>> be usefull for you.
>> Kaisa M. Lindahl
>> "JoelBarish" <stacijon@.gmail.com> wrote in message
>> news:1136572195.653007.143290@.z14g2000cwz.googlegroups.com...
>> > In creating a dataset with MDX, the field names (column captions) for
>> > my dataset always resolve to the actual member name in the AS cube.
>> >
>> > For example, if i use the following query as the datasource
>> > With Set [GenericMeasureName] as '{[Measures].[Quantity]}'
>> > SELECT {[GenericMeasureName]} ON COLUMNS, .... etc
>> >
>> > The field name in the dataset still appears as [Measures].[Quantity]
>> > instead of [GenericMeasureName] .
>> >
>> > Why is this a problem? I need to parameterize Measures... If I build
>> > the report with a field name of [Measures].[Quantity] and the user
>> > selects [Measures].[Revenue] then the report no-worky.
>> >
>> > I cannot put measures as rows, or page, or a slicer dimension or
>> > anything like that...those are parameterized also. The users need to
>> > filter on all dimensions for this (and many other) report.
>> >
>> > I also tried to "Edit Data Set" and change the field name on the
>> > "Fields" tab (edit dataset dialog) and same behavior.
>> >
>> > I've been searching BOL, etc for a day now with no luck. It seems like
>> > the answer should be a quick click on a setting somewhere... what am I
>> > missing? thanks in advance.
>> >
>> > Joel
>> >
>|||Hi Kaisa -
The users want a report that includes only one measure and they want to
choose the measure. They want EITHER Revenue OR Quantity OR Cost OR
Discount on the report, but not all of these. I tried to convince them
to have all these on the report and only look at the one they want, but
they won't accept that... they have some downstream procedures that
will be impacted or similar...
This isn't necessarily a problem, I could put the measure in the WHERE
if I had to. However, I then encounter the same problem with whatever
dimension I move to the columns. For example, I can't use the Time
dimension in the column because users want to select Time from a
parameter (result: changing column name problem for Time dimension).
Users also want a parameter for Line Of Business, etc. (all fields are
parameters therefore all fields have changing column/field names).
What I have done for now is create a calculated field in the dataset:
(Psuedo code): Iif(parameter=revenue,
revenue.value,(iif(parameter=quantity,quantity.value,(iif(parameter=cost,
...etc.) ... then reference the calculated field in the report
definition.
(I've read on this forum that CASE statements are not allowed in
expressions.)
I don't like this solution because I don't like hardcoding this much
into a report. And... there are a very large number of reports that
require this same type of coding.
I will post the mdx question on the OLAP forum. meanwhile, if you
happen to think of a different/better way to skin this cat, let me
know... you seem to have some creative solutions up your sleeve.
gracias, joel b
--i like MSAS a lot (i've worked with three other major OLAP vendors
and the development environment in MSAS is tops). I am new to
Reporting Services but so far it seems it could be enhanced to interact
with MSAS better. I continue to run into problems that don't fit well
into MSRS and they are all specific to sourcing from a cube.|||As Reporting Services isn't all that dynamic, I guess some hard coding has
to be done for each report. But you still might be able to do some tricks.
Even if the users only want to see one measure, you can still make the
report query find numbers for all the measures they can choose from. And
then do some visibility checks on the actual columns in your report. You
probably shouldn't have too much of a difference in the query time, even if
you get numbers for both Revenue AND quantity.
And if you want a super generic report that can't be grouped too much, you
can do something like this:
with member [Measures].[MyMeasure] as '[Store].currentmember.name'
member [Measures].[MyMeasure2] as '[Store].currentmember.Level.Name'
member [Measures].[MyMeasure3] as '[Store].currentmember.UniqueName'
select
{[Measures].[Unit Sales],[Measures].[Store Cost],[Measures].[Store
Sales],
[Measures].[MyMeasure],[Measures].[MyMeasure2],[Measures].[MyMeasure3]} on
columns,
{filter([Store].members,[Measures].[Unit Sales] > 100) } on rows
from [Sales]
The first calculated member will give you the store names in a column, the
second will give you that member's level, the third the unique name in the
form of [Store].[All Stores].[USA] etc. You can then group on Measure3, but
you might want to do some visibility checks to not dump out all the rows a
lot of times. Set all columns and rows to Visibility - Hidden = True, and
make it visible if the data you want to show equals ... something.
All calculated members will be called by the name you give it, contrary to
sets. So you can change the query to something like this, and all your
column names will controllable:
with member [Measures].[MyMeasure] as '[Store].currentmember.name'
member [Measures].[MyMeasure2] as '[Store].currentmember.Level.Name'
member [Measures].[MyMeasure3] as '[Store].currentmember.UniqueName'
member [Measures].[MyMeasure4] as '[Measures].[Unit Sales]'
member [Measures].[MyMeasure5] as '[Measures].[Store Cost]'
member [Measures].[MyMeasure5] as '[Measures].[Store Sales]'
select
{[Measures].[MyMeasure],[Measures].[MyMeasure2],[Measures].[MyMeasure3],[Measures].[MyMeasure4],[Measures].[MyMeasure5],[Measures].[MyMeasure6]}
on columns,
{filter([Store].members,[Measures].[Unit Sales] > 100) } on rows
from [Sales]
Your dimension used on rows and the first three measures needs to be the
same. And you need to filter on what ever measure you want to filter on, but
you can use [MyMeasure4] instead of [Unit Sales]. But you don't use the
row-based dimensions on your report rows, you use the measure. On the other
hand, there will be some differences from report to report, or else you
could create one huge generic report and just leave work for the day. ;)
Kaisa M. Lindahl
"JoelBarish" <stacijon@.gmail.com> wrote in message
news:1136829966.359151.155080@.g14g2000cwa.googlegroups.com...
> Hi Kaisa -
> The users want a report that includes only one measure and they want to
> choose the measure. They want EITHER Revenue OR Quantity OR Cost OR
> Discount on the report, but not all of these. I tried to convince them
> to have all these on the report and only look at the one they want, but
> they won't accept that... they have some downstream procedures that
> will be impacted or similar...
> This isn't necessarily a problem, I could put the measure in the WHERE
> if I had to. However, I then encounter the same problem with whatever
> dimension I move to the columns. For example, I can't use the Time
> dimension in the column because users want to select Time from a
> parameter (result: changing column name problem for Time dimension).
> Users also want a parameter for Line Of Business, etc. (all fields are
> parameters therefore all fields have changing column/field names).
> What I have done for now is create a calculated field in the dataset:
> (Psuedo code): Iif(parameter=revenue,
> revenue.value,(iif(parameter=quantity,quantity.value,(iif(parameter=cost,
> ...etc.) ... then reference the calculated field in the report
> definition.
> (I've read on this forum that CASE statements are not allowed in
> expressions.)
> I don't like this solution because I don't like hardcoding this much
> into a report. And... there are a very large number of reports that
> require this same type of coding.
> I will post the mdx question on the OLAP forum. meanwhile, if you
> happen to think of a different/better way to skin this cat, let me
> know... you seem to have some creative solutions up your sleeve.
> gracias, joel b
>
> --i like MSAS a lot (i've worked with three other major OLAP vendors
> and the development environment in MSAS is tops). I am new to
> Reporting Services but so far it seems it could be enhanced to interact
> with MSAS better. I continue to run into problems that don't fit well
> into MSRS and they are all specific to sourcing from a cube.
>|||I created this report, based on data from the Foodmart 2000- cube.
Most of it can be edited from Notepad, if you want to add a dimension or
change what a column is showing. If you want to add more columns, then you
have to do it in VS.
Kaisa
<?xml version="1.0" encoding="utf-8"?>
<Report
xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefinition"
xmlns:rd="">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<rd:GridSpacing>0.25cm</rd:GridSpacing>
<RightMargin>2.5cm</RightMargin>
<Body>
<ReportItems>
<Textbox Name="textbox4">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>1</ZIndex>
<Top>0.25cm</Top>
<rd:DefaultName>textbox4</rd:DefaultName>
<Height>0.63492cm</Height>
<Width>13.25cm</Width>
<CanGrow>true</CanGrow>
<Value>="Generic report based on " & Parameters!Dimension.Value</Value>
</Textbox>
<Table Name="table1">
<Height>1.90476cm</Height>
<Style />
<Header>
<TableRows>
<TableRow>
<Height>0.63492cm</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox1">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderStyle>
<Bottom>Solid</Bottom>
<Top>Solid</Top>
<Left>Solid</Left>
</BorderStyle>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>11</ZIndex>
<rd:DefaultName>textbox1</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>= Parameters!Dimension.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox2">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderStyle>
<Bottom>Solid</Bottom>
<Top>Solid</Top>
<Right>Solid</Right>
</BorderStyle>
<TextAlign>Right</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>10</ZIndex>
<rd:DefaultName>textbox2</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>Unit sales</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox3">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderStyle>
<Bottom>Solid</Bottom>
<Top>Solid</Top>
<Right>Solid</Right>
</BorderStyle>
<TextAlign>Right</extAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>9</ZIndex>
<rd:DefaultName>textbox3</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>Store Cost</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox10">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderStyle>
<Bottom>Solid</Bottom>
<Top>Solid</Top>
<Right>Solid</Right>
</BorderStyle>
<TextAlign>Right</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FntWeight>
</Style>
<ZIndex>8</ZIndex>
<rd:DefaultName>textbox10</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>Store Sales</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
<RepeatOnNewPage>true</RepeatOnNewPage>
</Header>
<Details>
<TableRows>
<TableRow>
<Height>0.63492cm</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="Measures_MyMeasure">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BackgroundColor>=IIF(Fields!Measures_MyMeasure2.Value = "0", "LightBlue",
IIF(Fields!Measures_MyMeasure2.Value = "2", "LightGreen",
IIF(Fields!Measures_MyMeasure2.Value = "3", "LightYellow",
"White")))</BackgroundColor>
<BorderStyle>
<Left>Solid</Left>
</BorderStyle>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>3</ZIndex>
<rd:DefaultName>Measures_MyMeasure</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!Measures_MyMeasure.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="Measures_MyMeasure4">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<Format>N0</Format>
<BackgroundColor>=IIF(Fields!Measures_MyMeasure2.Value = "0", "LightBlue",
IIF(Fields!Measures_MyMeasure2.Value = "2", "LightGreen",
IIF(Fields!Measures_MyMeasure2.Value = "3", "LightYellow",
"White")))</BackgroundColor>
<BorderStyle>
<Right>Solid</Right>
</BorderStyle>
<TextAlign>Right</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>2</ZIndex>
<rd:DefaultName>Measures_MyMeasure4</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!Measures_MyMeasure4.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="Measures_MyMeasure5">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<Format>N0</Format>
<BackgroundColor>=IIF(Fields!Measures_MyMeasure2.Value = "0", "LightBlue",
IIF(Fields!Measures_MyMeasure2.Value = "2", "LightGreen",
IIF(Fields!Measures_MyMeasure2.Value = "3", "LightYellow",
"White")))</BackgroundColor>
<BorderStyle>
<Right>Solid</Right>
</BorderStyle>
<TextAlign>Right</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>1</ZIndex>
<rd:DefaultName>Measures_MyMeasure5</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!Measures_MyMeasure5.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="Measures_MyMeasure6">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<Format>N0</Format>
<BackgroundColor>=IIF(Fields!Measures_MyMeasure2.Value = "0", "LightBlue",
IIF(Fields!Measures_MyMeasure2.Value = "2", "LightGreen",
IIF(Fields!Measures_MyMeasure2.Value = "3", "LightYellow",
"White")))</BackgroundColor>
<BorderStyle>
<Right>Solid</Right>
</BorderStyle>
<TextAlign>Right</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<rd:DefaultName>Measures_MyMeasure6</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!Measures_MyMeasure6.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
<Grouping Name="table1_Details_Group">
<GroupExpressions>
<GroupExpression>=Fields!Measures_MyMeasure3.Value</GroupExpression>
</GroupExpressions>
</Grouping>
</Details>
<DataSetName>DataSet1</DataSetName>
<Top>1.25cm</Top>
<Width>13.63624cm</Width>
<Footer>
<TableRows>
<TableRow>
<Height>0.63492cm</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox7">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderStyle>
<Top>Solid</Top>
</BorderStyle>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>7</ZIndex>
<rd:DefaultName>textbox7</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox8">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderStyle>
<Top>Solid</Top>
</BorderStyle>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>6</ZIndex>
<rd:DefaultName>textbox8</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox9">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderStyle>
<Top>Solid</Top>
</BorderStyle>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>5</ZIndex>
<rd:DefaultName>textbox9</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox12">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BorderStyle>
<Top>Solid</Top>
</BorderStyle>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>4</ZIndex>
<rd:DefaultName>textbox12</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
<RepeatOnNewPage>true</RepeatOnNewPage>
</Footer>
<TableColumns>
<TableColumn>
<Width>5.33333cm</Width>
</TableColumn>
<TableColumn>
<Width>2.75cm</Width>
<Visibility>
<Hidden>=IIF( Parameters!ShowAll.Value = False, IIF(Parameters!Measure.Label
= "Unit Sales", False, True), False)</Hidden>
</Visibility>
</TableColumn>
<TableColumn>
<Width>2.77645cm</Width>
<Visibility>
<Hidden>=IIF( Parameters!ShowAll.Value = False, IIF(Parameters!Measure.Label
= "Store Cost", False, True), False)</Hidden>
</Visibility>
</TableColumn>
<TableColumn>
<Width>2.77646cm</Width>
<Visibility>
<Hidden>=IIF( Parameters!ShowAll.Value = False, IIF(Parameters!Measure.Label
= "Store Sales", False, True), False)</Hidden>
</Visibility>
</TableColumn>
</TableColumns>
</Table>
</ReportItems>
<Style />
<Height>15cm</Height>
<ColumnSpacing>1cm</ColumnSpacing>
</Body>
<TopMargin>2.5cm</TopMargin>
<DataSources>
<DataSource Name="Foodmart">
<rd:DataSourceID>124dab9d-708f-4c42-88b0-429857870478</rd:DataSourceID>
<DataSourceReference>Foodmart</DataSourceReference>
</DataSource>
</DataSources>
<Width>16cm</Width>
<DataSets>
<DataSet Name="DataSet1">
<Fields>
<Field Name="Store_Store_Country">
<DataField>[Store].[Store Country].[MEMBER_CAPTION]</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Store_Store_State">
<DataField>[Store].[Store State].[MEMBER_CAPTION]</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Store_Store_City">
<DataField>[Store].[Store City].[MEMBER_CAPTION]</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Store_Store_Name">
<DataField>[Store].[Store Name].[MEMBER_CAPTION]</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Measures_MyMeasure">
<DataField>[Measures].[MyMeasure]</DataField>
<rd:TypeName>System.Object</rd:TypeName>
</Field>
<Field Name="Measures_MyMeasure2">
<DataField>[Measures].[MyMeasure2]</DataField>
<rd:TypeName>System.Object</rd:TypeName>
</Field>
<Field Name="Measures_MyMeasure3">
<DataField>[Measures].[MyMeasure3]</DataField>
<rd:TypeName>System.Object</rd:TypeName>
</Field>
<Field Name="Measures_MyMeasure4">
<DataField>[Measures].[MyMeasure4]</DataField>
<rd:TypeName>System.Object</rd:TypeName>
</Field>
<Field Name="Measures_MyMeasure5">
<DataField>[Measures].[MyMeasure5]</DataField>
<rd:TypeName>System.Object</rd:TypeName>
</Field>
<Field Name="Measures_MyMeasure6">
<DataField>[Measures].[MyMeasure6]</DataField>
<rd:TypeName>System.Object</rd:TypeName>
</Field>
</Fields>
<Query>
<DataSourceName>Foodmart</DataSourceName>
<CommandText>="with member [Measures].[MyMeasure] as '[" &
Parameters!Dimension.Value & "].currentmember.name'member
[Measures].[MyMeasure2] as '[" & Parameters!Dimension.Value &
"].currentmember.Level.Ordinal' member [Measures].[MyMeasure3] as '[" &
Parameters!Dimension.Value & "].currentmember.UniqueName' member
[Measures].[MyMeasure4] as '[Measures].[Unit Sales]' member
[Measures].[MyMeasure5] as '[Measures].[Store Cost]' member
[Measures].[MyMeasure6] as '[Measures].[Store Sales]' select
{[Measures].[MyMeasure], [Measures].[MyMeasure2], [Measures].[MyMeasure3],
[Measures].[MyMeasure4], [Measures].[MyMeasure5], [Measures].[MyMeasure6]}
on columns, {filter([" & Parameters!Dimension.Value & "].members,"
& Parameters!Measure.Value & " > " & Parameters!Amount.Value
& ") } on rows from [Sales]"</CommandText>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
</Query>
</DataSet>
</DataSets>
<LeftMargin>2.5cm</LeftMargin>
<rd:SnapToGrid>true</rd:SnapToGrid>
<PageHeight>29.7cm</PageHeight>
<rd:DrawGrid>true</rd:DrawGrid>
<PageWidth>21cm</PageWidth>
<rd:ReportID>247133a5-6ff9-4041-b398-bb2f76911f3e</rd:ReportID>
<BottomMargin>2.5cm</BottomMargin>
<ReportParameters>
<ReportParameter Name="Dimension">
<DataType>String</DataType>
<Prompt>Choose dimension</Prompt>
<ValidValues>
<ParameterValues>
<ParameterValue>
<Value>Store</Value>
</ParameterValue>
<ParameterValue>
<Value>Store Type</Value>
</ParameterValue>
<ParameterValue>
<Value>Store Size in SQFT</Value>
</ParameterValue>
<ParameterValue>
<Value>Time</Value>
</ParameterValue>
<ParameterValue>
<Value>Product</Value>
</ParameterValue>
<ParameterValue>
<Value>Gender</Value>
</ParameterValue>
<ParameterValue>
<Value>Promotions</Value>
</ParameterValue>
</ParameterValues>
</ValidValues>
</ReportParameter>
<ReportParameter Name="Measure">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>="[Measures].[Unit Sales]"</Value>
</Values>
</DefaultValue>
<Prompt>Choose measure</Prompt>
<ValidValues>
<ParameterValues>
<ParameterValue>
<Value>[Measures].[Unit Sales]</Value>
<Label>Unit Sales</Label>
</ParameterValue>
<ParameterValue>
<Value>[Measures].[Store Cost]</Value>
<Label>Store Cost</Label>
</ParameterValue>
<ParameterValue>
<Value>[Measures].[Store Sales]</Value>
<Label>Store Sales</Label>
</ParameterValue>
</ParameterValues>
</ValidValues>
</ReportParameter>
<ReportParameter Name="Amount">
<DataType>Integer</DataType>
<DefaultValue>
<Values>
<Value>0</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>More than</Prompt>
</ReportParameter>
<ReportParameter Name="ShowAll">
<DataType>Boolean</DataType>
<DefaultValue>
<Values>
<Value>true</Value>
</Values>
</DefaultValue>
<AllowBlank>true</AllowBlank>
<Prompt>Show all</Prompt>
</ReportParameter>
</ReportParameters>
<Language>nb-NO</Language>
</Report>
"Kaisa M. Lindahl" <kaisaml@.hotmail.com> wrote in message
news:%23vOCcGpFGHA.2708@.TK2MSFTNGP11.phx.gbl...
> As Reporting Services isn't all that dynamic, I guess some hard coding has
> to be done for each report. But you still might be able to do some tricks.
> Even if the users only want to see one measure, you can still make the
> report query find numbers for all the measures they can choose from. And
> then do some visibility checks on the actual columns in your report. You
> probably shouldn't have too much of a difference in the query time, even
> if you get numbers for both Revenue AND quantity.
> And if you want a super generic report that can't be grouped too much, you
> can do something like this:
> with member [Measures].[MyMeasure] as '[Store].currentmember.name'
> member [Measures].[MyMeasure2] as '[Store].currentmember.Level.Name'
> member [Measures].[MyMeasure3] as '[Store].currentmember.UniqueName'
> select
> {[Measures].[Unit Sales],[Measures].[Store Cost],[Measures].[Store
> Sales],
> [Measures].[MyMeasure],[Measures].[MyMeasure2],[Measures].[MyMeasure3]} on
> columns,
> {filter([Store].members,[Measures].[Unit Sales] > 100) } on rows
> from [Sales]
> The first calculated member will give you the store names in a column, the
> second will give you that member's level, the third the unique name in the
> form of [Store].[All Stores].[USA] etc. You can then group on Measure3,
> but you might want to do some visibility checks to not dump out all the
> rows a lot of times. Set all columns and rows to Visibility - Hidden => True, and make it visible if the data you want to show equals ...
> something.
> All calculated members will be called by the name you give it, contrary to
> sets. So you can change the query to something like this, and all your
> column names will controllable:
> with member [Measures].[MyMeasure] as '[Store].currentmember.name'
> member [Measures].[MyMeasure2] as '[Store].currentmember.Level.Name'
> member [Measures].[MyMeasure3] as '[Store].currentmember.UniqueName'
> member [Measures].[MyMeasure4] as '[Measures].[Unit Sales]'
> member [Measures].[MyMeasure5] as '[Measures].[Store Cost]'
> member [Measures].[MyMeasure5] as '[Measures].[Store Sales]'
> select
> {[Measures].[MyMeasure],[Measures].[MyMeasure2],[Measures].[MyMeasure3],[Measures].[MyMeasure4],[Measures].[MyMeasure5],[Measures].[MyMeasure6]}
> on columns,
> {filter([Store].members,[Measures].[Unit Sales] > 100) } on rows
> from [Sales]
> Your dimension used on rows and the first three measures needs to be the
> same. And you need to filter on what ever measure you want to filter on,
> but you can use [MyMeasure4] instead of [Unit Sales]. But you don't use
> the row-based dimensions on your report rows, you use the measure. On the
> other hand, there will be some differences from report to report, or else
> you could create one huge generic report and just leave work for the day.
> ;)
> Kaisa M. Lindahl
>

RS.exe and date-type parameter.

Hi All,

I have a report with 4 parameters, 2 of them are date-type parameter. I intend to run this report via RS.exe by passing different parameters for different scenario. The issue that I have at the moment is passing date-type parameter via the VB Script file.

In my report I use "dd-mm-yy" format. I tried many ways to assign date value to my parameters, but I am always getting the following error:

"Unhandled exception: Default value or value provided for the report parameter 'myParam' is not a valid value".

Syntax that I use:

myParam = "01-01-1900"

myParam = DateTime.Parse("01-01-1900")

myParam = DateTime.Parse("#01-01-1900#")

All of them didn't work.

My question: how to assign date value to the parameter?

Many Thanks,

Man

Can you post your script?|||

Hi,

Thanks for your reply. However I solved the issue by changing the date format to US format (mm/dd/yy).

Cheers,

XL

Monday, March 12, 2012

RS wishlist

Hi,
I would like to add one more item to RS wishlist:
- ability to dynamically switching parameter prompts
Example:
when userid = Person1 then Parameter1 prompt is ON
when userid = Person2 then Parameter1 prompt is OFF
TIA,
KamelThanks, this is on our wishlist as well.
--
Brian Welcker
Group Program Manager
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"kamel" <kwiciak@.gmail.com> wrote in message
news:1114775390.305089.6510@.l41g2000cwc.googlegroups.com...
> Hi,
> I would like to add one more item to RS wishlist:
> - ability to dynamically switching parameter prompts
> Example:
> when userid = Person1 then Parameter1 prompt is ON
> when userid = Person2 then Parameter1 prompt is OFF
> TIA,
> Kamel
>

RS utility parameters

I'm trying to use the rs utility on the command line, but all the examples I've found use only 1 parameter. I want to use multiple parameters and have not been able to get it working. Can anyone advise if this is possible, and if so, how to do it.

Thanks in advance

Jez

Hi,

following the script (rss) file definition that accepts the datasource from the rs command line stmt.

myfile.rss

Dim definition As [Byte]() = Nothing
Dim warnings As Warning() = Nothing
Dim parentFolder As String = "MyReports"
Dim parentPath As String = "/" + parentFolder
Dim filePath As String = "C:\Reports\"

Public Sub Main()

rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim name As String

'Create the parent folder
Try
rs.CreateFolder(parentFolder, "/", Nothing)
Console.WriteLine("Parent folder created: {0}", parentFolder)
Catch e As Exception
Console.WriteLine(e.Message)
End Try

'Create the WOS shared data source
CreateDataSource()

'Publish the reports
PublishReport("Report1")
PublishReport("Report2")

End Sub

Public Sub CreateDataSource()
Dim name As String = "AFES_DB"
Dim parent As String = "/" + parentFolder

'Define the data source definition.
Dim definition As New DataSourceDefinition()
definition.CredentialRetrieval = CredentialRetrievalEnum.Store
definition.ConnectString = "data source=" & datasource & ";initial catalog=NorthWind"
definition.Enabled = True
definition.EnabledSpecified = True
definition.Extension = "SQL"
definition.ImpersonateUser = False
definition.ImpersonateUserSpecified = True
'Use the default prompt string.
definition.Prompt = Nothing
definition.WindowsCredentials = False
definition.UserName = "sa"
definition.Password = ""

Try
rs.CreateDataSource(name, parent, True, definition, Nothing)

Catch e As Exception
Console.WriteLine(e.Message)
End Try

End Sub

Public Sub PublishReport(ByVal reportName As String)
Try
Dim stream As FileStream = File.OpenRead(filePath + "\" + reportName + ".rdl")
definition = New [Byte](stream.Length) {}
stream.Read(definition, 0, CInt(stream.Length))
stream.Close()

Catch e As IOException
Console.WriteLine(e.Message)
End Try

Try
warnings = rs.CreateReport(reportName, parentPath, True, definition, Nothing)

If Not (warnings Is Nothing) Then
Dim warning As Warning
For Each warning In warnings
Console.WriteLine(warning.Message)
Next warning

Else
Console.WriteLine("Report: {0} published successfully with no warnings", reportName)
End If

Catch e As Exception
Console.WriteLine(e.Message)
End Try
End Sub

the rs command should be as follows

rs -i myfile.rss -s http://localhost/reportserver -v datasource=cpc2

u can also send the ParentFolder name from the command line. all u need to do is remove the statement Dim parentFolder As String = "MyReports" in the above rss file and add the value in the command line as follows

rs -i myfile.rss -s http://localhost/reportserver -v datasource=cpc2 -v parentFolder=myReports

if u wanna add few more parameters just use the -v switch followed by name and value.

|||

Thanks - I got it working

|||

Hi Chakra,

Your post is very useful for me too. But I have another issue. How to pass date-type parameter?

I am having trouble passing date type parameter into my report and always getting "Default value or value provided for the report parameter 'myParam' is not a valid value".

Thanks in advance,

Man