Showing posts with label ssrs. Show all posts
Showing posts with label ssrs. Show all posts

Tuesday, March 20, 2012

Queries against Analysis Server executed several times in SSRS

Using Reporting Services 2005 with SSAS 2005 I have a report working with
some parameters. In queries for the parameters some default values were
calculated. E.g. the current date. Then these values were used as input to
create mdx statements. Parameters!kdjfaj.value
When watching what is happening on the SSAS Server with SQL Profiler I
watched the queries executing SEVERAL times ("query begin" as event class).
Is this a normal behaviour of Reporting Services?
Or is it just a gag of the Profiler Tool to repeat the queries in time?
Or is this depending on the order of the datasets for the report? If this
would be the case - how could I change the order of execution of the dataset
queries?
Best regards,
StefoonI have a similar problem. I have a report created in Visual Studio
based on a querry that retrieves data.
Today however we found a need to count how many times rhis report was
printed. Piece of cake I thought just put an UPDATE query at the botom
of the querry that retrieves data.
tested my simple UPDATE Invoice.ReminderNo = Invoice.ReminderNo + 1 in
managment studio and it worked as i shoud.
But when i tried running the report it suddenly added 10. so I put in
another UPDATE that added one letter/execution to a text field. sure
anough 10 pretty A:s.
The query contains 5 separate datasets and is run 10 times when i
render my report. I find that to striking to be a coincidence. I
believe that the querry is run twice/dataset.
How many datasets do you have, how many times is the querry run?
On 1 Mar, 14:25, Stefoon23 <Stefoo...@.discussions.microsoft.com>
wrote:
> Using Reporting Services 2005 with SSAS 2005 I have a report working with
> some parameters. In queries for the parameters some default values were
> calculated. E.g. the current date. Then these values were used as input to
> create mdx statements. Parameters!kdjfaj.value
> When watching what is happening on the SSAS Server with SQL Profiler I
> watched the queries executingSEVERALtimes("querybegin" as event class).
> Is this a normal behaviour of Reporting Services?
> Or is it just a gag of the Profiler Tool to repeat the queries in time?
> Or is this depending on the order of the datasets for the report? If this
> would be the case - how could I change the order of execution of the dataset
> queries?
> Best regards,
> Stefoon|||Hi Markus,
the proportion is about the same. It seems that any query is executed 2
times.
I understand, that the parameter queries could run several times if you have
cascading picklists or something, but the query for the report's data?
Very mysterious.
Stefoon
"markus.rohsto@.gmail.com" wrote:
> I have a similar problem. I have a report created in Visual Studio
> based on a querry that retrieves data.
> Today however we found a need to count how many times rhis report was
> printed. Piece of cake I thought just put an UPDATE query at the botom
> of the querry that retrieves data.
> tested my simple UPDATE Invoice.ReminderNo = Invoice.ReminderNo + 1 in
> managment studio and it worked as i shoud.
> But when i tried running the report it suddenly added 10. so I put in
> another UPDATE that added one letter/execution to a text field. sure
> anough 10 pretty A:s.
> The query contains 5 separate datasets and is run 10 times when i
> render my report. I find that to striking to be a coincidence. I
> believe that the querry is run twice/dataset.
> How many datasets do you have, how many times is the querry run?
> On 1 Mar, 14:25, Stefoon23 <Stefoo...@.discussions.microsoft.com>
> wrote:
> > Using Reporting Services 2005 with SSAS 2005 I have a report working with
> > some parameters. In queries for the parameters some default values were
> > calculated. E.g. the current date. Then these values were used as input to
> > create mdx statements. Parameters!kdjfaj.value
> > When watching what is happening on the SSAS Server with SQL Profiler I
> > watched the queries executingSEVERALtimes("querybegin" as event class).
> > Is this a normal behaviour of Reporting Services?
> > Or is it just a gag of the Profiler Tool to repeat the queries in time?
> >
> > Or is this depending on the order of the datasets for the report? If this
> > would be the case - how could I change the order of execution of the dataset
> > queries?
> >
> > Best regards,
> > Stefoon
>
>

Quarter() function in SSRS

I am uisng VS 2005 to build reports for SQL 2005. The problem is with getting the Quarter() function, mentioned in the BOL, to work in the report builder. When I build an expression and try to use the function as noted in the BOL I receive an error stating that the name "Quarter" is not declaired. When I use the expression builder to build the expression the function is not available in the builder, which is probably why I get the error.

I am assuming there is some sort of service pack of hot fix I need to apply to my VS but have not been able to locate which one. I have verified that I have all of the recent service packs applied for VS and SQL server 2005 but I am still unable to see/use this function.

Any help would be greatly appreciated. I need this function for my financial reports.

Using the QUARTER(datetime) function does not seem to be available in SQL 2005 SSRS;

=Quarter(today())

Results in an error.

After playing with the date part function I was able to resolve my problem. If you are having a similar problem use the following function to extract the quarter from a date

=DatePart(DateInterval.Quarter,today())

Replace Today() with the date you want to get the value for. You can test this by creating a report and placing a textbox anywhere on the report and setting the above code as the expression for the value of the textbox.