Tuesday, March 20, 2012
ParametersUsed Always Polulated after calling ReportingService.Ren
the ParametersUsed output parameter should only be populated only if the
report being rendered is a report history snapshot. I'm invoking the Render
method with a null HistoryId as follows, so I would expect the ParametersUsed
output parameter not to get populated.
results = m_RptService.Render(m_RptCatalogItem.Path /*Report*/,
m_Format /*Format*/,
null /*HistoryID*/,
null /*DeviceInfo*/,
m_RptParameters /*Parameters*/,
null /*Credentials*/,
null /*ShowHideToggle*/,
out encoding /*Encoding*/,
out mimeType /*MimeType*/,
out historyParms /*ParametersUsed*/,
out warnings /*Warnings*/,
out streamIDs /*StreamIds*/);
The call generates the following HTTP traffic. As you can see the HistoryId
is not sent in the request yet ParametersUsed is populated in the result. If
I'm interpreting the documentation correctly this value should not be
populated in the response. I really don't what ParametersUsed to be
populated in the response. Is this the correct behavior?
POST /ReportServer/ReportService.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction:
"http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices/Render"
Content-Length: 524
Expect: 100-continue
Host: localhost
Cookie: sqlAuthCookie=****; UsrTkn=>****; AppTkn=>****
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><Render
xmlns="http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices"><Report>/ReportServerStatistics/PTest</Report><Format>HTML4.0</Format><Parameters><ParameterValue><Name>p1</Name><Value>2/11/2007
7:32:50
PM</Value></ParameterValue></Parameters></Render></soap:Body></soap:Envelope>
HTTP/1.1 200 OK
Date: Mon, 12 Feb 2007 00:32:50 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 9021
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><ServerInfoHeader
xmlns="http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices"><ReportServerVersionNumber>Microsoft
SQL Server Reporting Services Version
8.00.1038.00</ReportServerVersionNumber><ReportServerEdition>Enterprise</ReportServerEdition></ServerInfoHeader><SessionHeader
xmlns="http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices"><SessionId>glbci3rl3utt1iqmon253t45</SessionId><IsNewExecution>true</IsNewExecution><ExecutionDateTime>2007-02-11T19:32:50</ExecutionDateTime><ExpirationDateTime>2007-02-11T19:32:50</ExpirationDateTime></SessionHeader></soap:Header><soap:Body><RenderResponse
xmlns="http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices"><Result>
Base 64 Encoded response removed to shorten post
</Result><Encoding>Unicode
(UTF-8)</Encoding><MimeType>text/html</MimeType><ParametersUsed><ParameterValue><Name>p1</Name><Value>2/11/2007
7:32:50 PM</Value></ParameterValue></ParametersUsed><StreamIds
/></RenderResponse></soap:Body></soap:Envelope>Reporting Services 2005 exhibits the same behavior. The following
application produces the following output "Length: 3" indicating that the
ParametersUsed output parameter was populated even though no histryid was
provided. Is this the correct behavior? If so how do I turn it off?
According to the following documentation this does not seem like the correct
behavior (http://msdn2.microsoft.com/en-us/library/aa258532(SQL.80).aspx).
Notice that the description for ParametersUsed states that the output
parameter is only populated of a history snapshot is being rendered. This
causes fairly significant performance issues for me because in some cases I
am passing large parameters. Instead of these parameters just being in the
request, they are in both the request and the response causing the response
to be much larger than I desire.
using System;
using System.Collections.Generic;
using System.Text;
using ConsoleApplication9.rs;
namespace ConsoleApplication9
{
class Program
{
static void Main(string[] args)
{
string encoding, mimeType;
ParameterValue[] pout;
Warning[] w;
string[] s;
ReportingService rs = new ReportingService();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
ParameterValue[] pin = new ParameterValue[3];
pin[0] = new ParameterValue();
pin[0].Name = "stdt";
pin[0].Value = "2/19/2007";
pin[1] = new ParameterValue();
pin[1].Name = "enddt";
pin[1].Value = "2/20/2007";
pin[2] = new ParameterValue();
pin[2].Name = "sopco";
pin[2].Value = "A";
rs.Render("/VRU Reports/VRUAppSuccessPercent" /*Report*/,
"PDF" /*Format*/,
null /*HistoryID*/,
null /*DeviceInfo*/,
pin /*Parameters*/,
null /*Credentials*/,
null /*ShowHideToggle*/,
out encoding /*Encoding*/,
out mimeType /*MimeType*/,
out pout /*ParametersUsed*/,
out w /*Warnings*/,
out s /*StreamIds*/);
Console.WriteLine("Length: " + pout.Length);
Console.ReadLine();
}
}
}
"Jerry" wrote:
> In SSRS 2000 SP2 the documentation for ReportingService.Render states that
> the ParametersUsed output parameter should only be populated only if the
> report being rendered is a report history snapshot. I'm invoking the Render
> method with a null HistoryId as follows, so I would expect the ParametersUsed
> output parameter not to get populated.
> results = m_RptService.Render(m_RptCatalogItem.Path /*Report*/,
> m_Format /*Format*/,
> null /*HistoryID*/,
> null /*DeviceInfo*/,
> m_RptParameters /*Parameters*/,
> null /*Credentials*/,
> null /*ShowHideToggle*/,
> out encoding /*Encoding*/,
> out mimeType /*MimeType*/,
> out historyParms /*ParametersUsed*/,
> out warnings /*Warnings*/,
> out streamIDs /*StreamIds*/);
> The call generates the following HTTP traffic. As you can see the HistoryId
> is not sent in the request yet ParametersUsed is populated in the result. If
> I'm interpreting the documentation correctly this value should not be
> populated in the response. I really don't what ParametersUsed to be
> populated in the response. Is this the correct behavior?
> POST /ReportServer/ReportService.asmx HTTP/1.1
> Content-Type: text/xml; charset=utf-8
> SOAPAction:
> "http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices/Render"
> Content-Length: 524
> Expect: 100-continue
> Host: localhost
> Cookie: sqlAuthCookie=****; UsrTkn=>****; AppTkn=>****
> <?xml version="1.0" encoding="utf-8"?><soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="<soap:Body><Render">http://www.w3.org/2001/XMLSchema"><soap:Body><Render
> xmlns="<Report>/ReportServerStatistics/PTest</Report><Format>HTML4.0</Format><Parameters><ParameterValue><Name>p1</Name><Value>2/11/2007">http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices"><Report>/ReportServerStatistics/PTest</Report><Format>HTML4.0</Format><Parameters><ParameterValue><Name>p1</Name><Value>2/11/2007
> 7:32:50
> PM</Value></ParameterValue></Parameters></Render></soap:Body></soap:Envelope>
> HTTP/1.1 200 OK
> Date: Mon, 12 Feb 2007 00:32:50 GMT
> Server: Microsoft-IIS/6.0
> X-Powered-By: ASP.NET
> X-AspNet-Version: 1.1.4322
> Cache-Control: private, max-age=0
> Content-Type: text/xml; charset=utf-8
> Content-Length: 9021
> <?xml version="1.0" encoding="utf-8"?><soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="<soap:Header><ServerInfoHeader">http://www.w3.org/2001/XMLSchema"><soap:Header><ServerInfoHeader
> xmlns="<ReportServerVersionNumber>Microsoft">http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices"><ReportServerVersionNumber>Microsoft
> SQL Server Reporting Services Version
> 8.00.1038.00</ReportServerVersionNumber><ReportServerEdition>Enterprise</ReportServerEdition></ServerInfoHeader><SessionHeader
> xmlns="<SessionId>glbci3rl3utt1iqmon253t45</SessionId><IsNewExecution>true</IsNewExecution><ExecutionDateTime>2007-02-11T19:32:50</ExecutionDateTime><ExpirationDateTime>2007-02-11T19:32:50</ExpirationDateTime></SessionHeader></soap:Header><soap:Body><RenderResponse">http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices"><SessionId>glbci3rl3utt1iqmon253t45</SessionId><IsNewExecution>true</IsNewExecution><ExecutionDateTime>2007-02-11T19:32:50</ExecutionDateTime><ExpirationDateTime>2007-02-11T19:32:50</ExpirationDateTime></SessionHeader></soap:Header><soap:Body><RenderResponse
> xmlns="<Result>">http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices"><Result>
> Base 64 Encoded response removed to shorten post
> </Result><Encoding>Unicode
> (UTF-8)</Encoding><MimeType>text/html</MimeType><ParametersUsed><ParameterValue><Name>p1</Name><Value>2/11/2007
> 7:32:50 PM</Value></ParameterValue></ParametersUsed><StreamIds
> /></RenderResponse></soap:Body></soap:Envelope>
>
Friday, March 9, 2012
Parameters in SSRS with OLAP
parameters into the report using URL. I've tried setting the parameter to
the value I desire, but that doesn't work. Here's an example:
http://mysite/reportserver/report.rdl&rc:toolbar=true&rc:LinkTarget=_top&DimParameter=301
When I look at how OLAP passes parameters into reports, it's not the same as
when I use straight SQL tables. So I tried:
http://mysite/reportserver/report.rdl&rc:toolbar=true&rc:LinkTarget=_top&DimParameter=[DimParameter].[MEMBER].[301]
but then I get an error message saying that the text is too long. Any help
would be appreciated.What is the MDX of the statement you are trying to execute based on the
parameter?
This has to be set up as a concatenated string in the DS for the report.
Chris E
"Jim" <Jim@.discussions.microsoft.com> wrote in message
news:2582B5B0-C2AE-4327-8A66-FECA58B19754@.microsoft.com...
> Hi - I have a report that uses an OLAP cube. I cannot figure out how to
> pass
> parameters into the report using URL. I've tried setting the parameter to
> the value I desire, but that doesn't work. Here's an example:
> http://mysite/reportserver/report.rdl&rc:toolbar=true&rc:LinkTarget=_top&DimParameter=301
> When I look at how OLAP passes parameters into reports, it's not the same
> as
> when I use straight SQL tables. So I tried:
> http://mysite/reportserver/report.rdl&rc:toolbar=true&rc:LinkTarget=_top&DimParameter=[DimParameter].[MEMBER].[301]
> but then I get an error message saying that the text is too long. Any help
> would be appreciated.
>|||Thanks for your response, Chris. The MDX statement is:
SELECT NON EMPTY { [Measures].[Responses], [Measures].[Quantity],
[Measures].[Total Cost], [Measures].[Revenue] } ON COLUMNS, NON EMPTY { ([Dim
Expire Group].[Dim Expire Group].[Dim Expire Group].ALLMEMBERS * [Dim
Notice].[Dim Notice].[Dim Notice].ALLMEMBERS * [Dim Notice].[Notice
Order].[Notice Order].ALLMEMBERS * [Dim YOF].[YOF Name].[YOF Name].ALLMEMBERS
* [Dim YOF].[YOF Order].[YOF Order].ALLMEMBERS * [Dim HPC].[HPC Id1].[HPC
Id1].ALLMEMBERS * [Dim HPC].[HPC Name1].[HPC Name1].ALLMEMBERS * [Dim
HPC].[HPC Order1].[HPC Order1].ALLMEMBERS * [Dim YOF].[Dim YOF].[Dim
YOF].ALLMEMBERS * [Dim Package].[Package Type Id].[Package Type
Id].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON
ROWS FROM ( SELECT ( STRTOSET(@.DimHPCHPCName, CONSTRAINED) ) ON COLUMNS FROM
( SELECT ( STRTOSET(@.DimExpireGroupDimExpireGroup, CONSTRAINED) ) ON COLUMNS
FROM ( SELECT ( STRTOSET(@.DimPackagePackageTypeId, CONSTRAINED) ) ON COLUMNS
FROM ( SELECT ( STRTOSET(@.DimProgramDimProgram, CONSTRAINED) ) ON COLUMNS
FROM [FactSourceCode])))) WHERE ( IIF( STRTOSET(@.DimProgramDimProgram,
CONSTRAINED).Count = 1, STRTOSET(@.DimProgramDimProgram, CONSTRAINED), [Dim
Program].[Dim Program].currentmember ) ) CELL PROPERTIES VALUE, BACK_COLOR,
FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
I pass several parameters into the statement. I thought I'd figured it out
by using the codes that represent the [, ] and &. But I'm still getting the
same issue when it tries to pass the parameter in the URL.
"Chris" wrote:
> What is the MDX of the statement you are trying to execute based on the
> parameter?
> This has to be set up as a concatenated string in the DS for the report.
> Chris E
> "Jim" <Jim@.discussions.microsoft.com> wrote in message
> news:2582B5B0-C2AE-4327-8A66-FECA58B19754@.microsoft.com...
> > Hi - I have a report that uses an OLAP cube. I cannot figure out how to
> > pass
> > parameters into the report using URL. I've tried setting the parameter to
> > the value I desire, but that doesn't work. Here's an example:
> >
> > http://mysite/reportserver/report.rdl&rc:toolbar=true&rc:LinkTarget=_top&DimParameter=301
> >
> > When I look at how OLAP passes parameters into reports, it's not the same
> > as
> > when I use straight SQL tables. So I tried:
> >
> > http://mysite/reportserver/report.rdl&rc:toolbar=true&rc:LinkTarget=_top&DimParameter=[DimParameter].[MEMBER].[301]
> >
> > but then I get an error message saying that the text is too long. Any help
> > would be appreciated.
> >
>
>|||I had a similar problem. My solve was:
the konfiguration of report paramters must set
available evaluates = not asked
and
standard value = zero
then it should function with the parameters [DimParameter].[MEMBER].[301]
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com|||I had a similar problem. My solve was:
the konfiguration of report paramters must set
available value = not asked
and
standard value = zero
then it should function with the parameters [DimParameter].[MEMBER].[301]
EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
Wednesday, March 7, 2012
Parameters from Dropdownlist
the database table? My query is: I want the city field filled in from the
column. Thanks in advance.
SELECT FNAME, LNAME, .EMAIL, .PHONE_NBR, CITY
FROM MR_MEMBER_1
WHERE (MEMBER_STATUS = 'A') AND (CITY = @.CITY)Go into you parameter and check the box that says "From Query" then choose
the dataset you want to use and then choose the from the value field list
the field that you want to run the parameter off of! Hope that helps...
"Shan Afzal" <Shan Afzal@.discussions.microsoft.com> wrote in message
news:89935558-78A2-441D-A410-A7C51E056189@.microsoft.com...
> In SSRS 2000 how can I have the parameter filled in the drop downlist from
> the database table? My query is: I want the city field filled in from
> the
> column. Thanks in advance.
> SELECT FNAME, LNAME, .EMAIL, .PHONE_NBR, CITY
> FROM MR_MEMBER_1
> WHERE (MEMBER_STATUS = 'A') AND (CITY = @.CITY)|||Go into you parameter and check the box that says "From Query" then choose
the dataset you want to use and then choose the from the value field list
the field that you want to run the parameter off of! Hope that helps...
"Shan Afzal" <Shan Afzal@.discussions.microsoft.com> wrote in message
news:89935558-78A2-441D-A410-A7C51E056189@.microsoft.com...
> In SSRS 2000 how can I have the parameter filled in the drop downlist from
> the database table? My query is: I want the city field filled in from
> the
> column. Thanks in advance.
> SELECT FNAME, LNAME, .EMAIL, .PHONE_NBR, CITY
> FROM MR_MEMBER_1
> WHERE (MEMBER_STATUS = 'A') AND (CITY = @.CITY)|||Ben, It gives me the follwoing error when I do what you explained.
The report parameter â'CITYâ' has a DefaultValue or a ValidValue that depends
on the report parameter â'CITYâ'. Forward dependencies are not valid.
Build complete -- 1 errors, 0 warnings
Thanks
"Ben Watts" wrote:
> Go into you parameter and check the box that says "From Query" then choose
> the dataset you want to use and then choose the from the value field list
> the field that you want to run the parameter off of! Hope that helps...
> "Shan Afzal" <Shan Afzal@.discussions.microsoft.com> wrote in message
> news:89935558-78A2-441D-A410-A7C51E056189@.microsoft.com...
> > In SSRS 2000 how can I have the parameter filled in the drop downlist from
> > the database table? My query is: I want the city field filled in from
> > the
> > column. Thanks in advance.
> >
> > SELECT FNAME, LNAME, .EMAIL, .PHONE_NBR, CITY
> > FROM MR_MEMBER_1
> > WHERE (MEMBER_STATUS = 'A') AND (CITY = @.CITY)
>
>|||You could try and create a different dataset that is exactly the same as
your current one and name it city parameter or something like that. Then
inside your report parameter for the values, change the dataset to the one
you just created and choose the field from that! Let me know.....
"Shan Afzal" <ShanAfzal@.discussions.microsoft.com> wrote in message
news:3A6CE6FD-1BEA-459C-B223-B9B3952782CE@.microsoft.com...
> Ben, It gives me the follwoing error when I do what you explained.
> The report parameter 'CITY' has a DefaultValue or a ValidValue that
> depends
> on the report parameter "CITY". Forward dependencies are not valid.
> Build complete -- 1 errors, 0 warnings
> Thanks
> "Ben Watts" wrote:
>> Go into you parameter and check the box that says "From Query" then
>> choose
>> the dataset you want to use and then choose the from the value field list
>> the field that you want to run the parameter off of! Hope that helps...
>> "Shan Afzal" <Shan Afzal@.discussions.microsoft.com> wrote in message
>> news:89935558-78A2-441D-A410-A7C51E056189@.microsoft.com...
>> > In SSRS 2000 how can I have the parameter filled in the drop downlist
>> > from
>> > the database table? My query is: I want the city field filled in from
>> > the
>> > column. Thanks in advance.
>> >
>> > SELECT FNAME, LNAME, .EMAIL, .PHONE_NBR, CITY
>> > FROM MR_MEMBER_1
>> > WHERE (MEMBER_STATUS = 'A') AND (CITY = @.CITY)
>>|||Got it Ben. Work like a champ. Thanks for your help.
"Ben Watts" wrote:
> You could try and create a different dataset that is exactly the same as
> your current one and name it city parameter or something like that. Then
> inside your report parameter for the values, change the dataset to the one
> you just created and choose the field from that! Let me know.....
> "Shan Afzal" <ShanAfzal@.discussions.microsoft.com> wrote in message
> news:3A6CE6FD-1BEA-459C-B223-B9B3952782CE@.microsoft.com...
> > Ben, It gives me the follwoing error when I do what you explained.
> >
> > The report parameter 'CITY' has a DefaultValue or a ValidValue that
> > depends
> > on the report parameter "CITY". Forward dependencies are not valid.
> > Build complete -- 1 errors, 0 warnings
> >
> > Thanks
> >
> > "Ben Watts" wrote:
> >
> >> Go into you parameter and check the box that says "From Query" then
> >> choose
> >> the dataset you want to use and then choose the from the value field list
> >> the field that you want to run the parameter off of! Hope that helps...
> >>
> >> "Shan Afzal" <Shan Afzal@.discussions.microsoft.com> wrote in message
> >> news:89935558-78A2-441D-A410-A7C51E056189@.microsoft.com...
> >> > In SSRS 2000 how can I have the parameter filled in the drop downlist
> >> > from
> >> > the database table? My query is: I want the city field filled in from
> >> > the
> >> > column. Thanks in advance.
> >> >
> >> > SELECT FNAME, LNAME, .EMAIL, .PHONE_NBR, CITY
> >> > FROM MR_MEMBER_1
> >> > WHERE (MEMBER_STATUS = 'A') AND (CITY = @.CITY)
> >>
> >>
> >>
>
>
Saturday, February 25, 2012
parameters
Hello,
i am new to ssrs and am trying to generate a report with 4 parameters. 2 of which are dates. The other 2 are drop downlists. Now the report works fine when i enter all 4 parameters. But in some cases i want to leave one of the parameters unentered . It doesnt all me to do that. Gives a error saying i need to enter the parameter. How do u get aroud this issue ?
I have seperate dataset for this parameters list and am using a where clause in my main query.
Can anyone please help me out with this?
Thx
Ashish
the parameters which are not needed all times can be set as
1. under parameter properties check all ow null values option
2. take default value for parameter as null
hope these will solve u r problem
|||
the parameters which are not needed all times can be set as
1. under parameter properties check allow null values option
2. take default value for parameter as null
hope these will solve u r problem
|||
hello rakam,
Thx for the reply.
My problem still continues. i tried ur suggestion but it still prompts me to select that paramater when trying to view report.
Any other options with be appreciated.
Thx
Ashish
|||The only thing you should have to do is define a valid Default value in the parameter setup in Design view of the report. If you still have the problem after saving and redeploying the report, you may want to delete the report from the report server and then deploy it again. Sometimes the subtle updates don't post properly unless you delete first.|||Read this article http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1061210&SiteID=1
parameters
Hello,
i am new to ssrs and am trying to generate a report with 4 parameters. 2 of which are dates. The other 2 are drop downlists. Now the report works fine when i enter all 4 parameters. But in some cases i want to leave one of the parameters unentered . It doesnt all me to do that. Gives a error saying i need to enter the parameter. How do u get aroud this issue ?
I have seperate dataset for this parameters list and am using a where clause in my main query.
Can anyone please help me out with this?
Thx
Ashish
the parameters which are not needed all times can be set as
1. under parameter properties check all ow null values option
2. take default value for parameter as null
hope these will solve u r problem
|||
the parameters which are not needed all times can be set as
1. under parameter properties check allow null values option
2. take default value for parameter as null
hope these will solve u r problem
|||
hello rakam,
Thx for the reply.
My problem still continues. i tried ur suggestion but it still prompts me to select that paramater when trying to view report.
Any other options with be appreciated.
Thx
Ashish
|||The only thing you should have to do is define a valid Default value in the parameter setup in Design view of the report. If you still have the problem after saving and redeploying the report, you may want to delete the report from the report server and then deploy it again. Sometimes the subtle updates don't post properly unless you delete first.|||Read this article http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1061210&SiteID=1
Monday, February 20, 2012
Parameterized MDX Query Performance Issue in SSRS
Hi,
I'm having issues with a reasonably complex MDX query used in a Reporting Services report. I have executed the query and traced activity on the SSAS box and have discovered that there is a major difference in performance between the parameterized query and the exact same one but with 'hard coded' values. The difference we are talking about is from a couple of seconds (hard coded) to minutes when parameterized!!
The key difference is that the parameterized query is causing litterally hundreds of thousands of Query Dimension events (EventSubClass : 1 - Cache Data) to occur against one of the dimensions (the Date dimension to be exact). This dimension is not even large with only a few hundred leaf level members and about five levels. There is another very large dimension in the cube however, c.1.5million members, upon which subsets of member are being ranked but this doesn't appear in the trace any more often than in the non-parameterized version of the query.
Have I missed something here or is there something I can do to improve the performance ofparameterized queries? Any suggestions or adive whatsoever woould be greatly appreciated.
Thanks,
Rob.
Hi Rob,
Can you post up the query you're using?
Chris
|||Hi Chris... below is the query. Note that I've had to change a few of the member names etc so apologies if I've introduced any syntax errors etc...
With
Member [Measures].[Current Period Count] As
(
STRTOMEMBER(@.DateMember),
[Measures].[Count]
)
Set [Current Period Documents Ordered by Count] As
TOPPERCENT(
NonEmpty(
Descendants(
STRTOMEMBER(@.DocumentMember),
[Documents].[Documents].[Document Title],
SELF
),
[Measures].[Current Period Count]
),
100,
[Measures].[Current Period Count]
)
Member [Measures].[Current Period Document Ranking] As
Rank(
([Documents].[Documents].CurrentMember),
[Current Period Documents Ordered by Count],
-[Measures].[Current Period Count]
), FORMAT_STRING="#;#;-;-"
Member [Measures].[Prev Period Count] As
(
STRTOMEMBER(@.DateMember).PrevMember,
[Measures].[Click Through Count]
), FORMAT_STRING="#;#;-;-"
Set [Prev Period Documents Ordered by Count] As
TOPPERCENT(
NonEmpty(
Descendants(
STRTOMEMBER(@.DocumentMember),
[Documents].[Documents].[Document Title],
SELF
),
[Measures].[Prev Period Count]
),
100,
[Measures].[Prev Period Count]
)
Member [Measures].[Prev Period Document Ranking] As
IIF(
[Measures].[Prev Period Count] > 0,
Rank(
[Documents].[Documents].CurrentMember,
[Prev Period Documents Ordered by Count],
-[Measures].[Prev Period Count]
),
Null
), FORMAT_STRING="#;#;-;-"
Member [Measures].[Param1] As
[Documents].[Documents].CurrentMember.Properties("Param1")
Member [Measures].[Param2] As
[Documents].[Documents].CurrentMember.Properties("Param2")
Select
{
[Measures].[Param1],
[Measures].[Param2],
[Measures].[Current Period Count],
[Measures].[Current Period Ranking],
[Measures].[Prev Period Count],
[Measures].[Prev Period Ranking]
} On 0,
TOPCOUNT(
Filter(
[Current Period Documents Ordered by Count],
[Measures].[Count] > 0
),
30
)
On 1
From
[OLAPDatabase]
Where
(
STRTOMEMBER(@.TimePeriod),
STRTOMEMBER(@.UserMember),
STRTOMEMBER(@.ProductMember)
)
|||Hi Rob,
Two ideas to start off with....
I'm not sure exactly why parameterising the query has such a performance hit, but I think it's because using parameters involves using the StrToX family of functions, and any calculated member which uses these functions is going to incur a performance hit and possibly stop caching being so effective. You've got no choice here though, unless your data source in Reporting Services from using the 'Analysis Services' provider to using the 'OLE DB' provider and not using AS parameters, but dynamically generating the entire query string with Reporting Services expressions - which is pretty unpleasant. Just out of interest though, if you remove the parameters from the calculated member definitions and leave them in place elsewhere in the query (eg in the WHERE clause), what's performance like?|||
Chris, many thanks for your reply.
Yes I've been considering dynamically building the MDX statements as a get around but as you say, it's not pleasant and certainly not elegant... however it looks as if your assumptions were correct as removing the parameters from the calculated members causes a significant improvement to performance. Even leaving the parameters in the Where clause, it's returns the result set only fractionally slower then the non-parameterized query. And by implimenting your second suggestion of replacing the calculated members with Tuples throughout the query the performance is greatly improved from what I had originally. It's still far slower than the non-parameterized version but acceptable.
Many thanks for you swift and effective advice!
Rob.
|||Glad I could help. I don't know enough about your cube or parameters to say whether this would be possible, but potentially the query could be further optimised by removing the parameterisation from the calculated measure definitions and putting it somewhere else; it depends on whether the contents of @.DateMember could be put in the WHERE clause or on a visible axis.
Chris