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

Friday, March 30, 2012

Report parameter using Member_Key

I am trying to create a parameter driven SSRS report agains my cube but I want the parameter to contain only the Key value of the member I am trying to select. When I use the query designer, I get something like this:

SELECT ( STRTOSET(@.PlantStructureDepartment, CONSTRAINED)

Where @.PlantStructureDepartment is my paramter and contains the Unique Name of the member like this "[Plant Structure].[Department].&[39952]" where "39952" is the Key value.

What I want is to be able to pass the paramter in as "39952" and build the rest of the string. I tried this:

SELECT ( STRTOSET('[Plant Structure].[Department].&[' + @.PlantStructureDepartment + ']', CONSTRAINED)

but that didn't work.

The reason I'm trying to do this is that we are using SharePoint integrated filtering and we have a number of basic relational reports using the same filters as the reports against the cubes. We would like to keep them all using the integer values.

For sake of completeness, here is the full query as it sits right now:

SELECT NON EMPTY { [Measures].[FTT Percent] } ON COLUMNS, NON EMPTY { ([Plant Structure].[Prod Line].[Prod Line].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( STRTOSET(@.PlantStructureDepartment, CONSTRAINED) ) ON COLUMNS FROM [FTT]) WHERE ( IIF( STRTOSET(@.PlantStructureDepartment, CONSTRAINED).Count = 1, STRTOSET(@.PlantStructureDepartment, CONSTRAINED), [Plant Structure].[Department].currentmember ) ) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS

I am fairly new to MDX and would appreciate any help or suggestions.

Here is a copy of the query modified to use Adventure Works but illustrating what you requested. Where I've used '1', you would use your report parameter value.

Hope that helps,
Bryan

Code Snippet

SELECT

NON EMPTY { [Measures].[Reseller Sales Amount] } ON COLUMNS,

NON EMPTY { ([Product].[SubCategory].[SubCategory].ALLMEMBERS ) }

DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS

FROM (

SELECT ( STRTOSET('[Product].[Category].&['+'1'+']', CONSTRAINED) ) ON COLUMNS

FROM [Adventure Works])

WHERE (

IIF( STRTOSET('[Product].[Category].&['+'1'+']', CONSTRAINED).Count = 1,

STRTOSET('[Product].[Category].&['+'1'+']', CONSTRAINED),

[Product].[Category].currentmember

)

)

CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS

|||

Bryan,

Thanks for the reply. I think you are stating the same thing that I tried already. When I hardcode the value as you suggest, the query works. However, when I set up the parameter, I get this message:

Parser: The query contains the Department parameter, which is not declared. (msmgdsrv)


This is because the paramter isn't declared in the data tab of the report. When I declare the parameter, I get this error:

Query (6, 23) The restrictions imposed by the CONSTRAINED flag in the STRTOSET function were violated. (Microsoft SQL Server 2005 Analysis Services)

The parameters page of the Data tab only allows you to tie a parameter to a dimension of the cube. I think I need a way around that.

Thanks again for the idea. If you have another, I'd appreciate it.

Chris

|||

The CONSTRAINED keyword is there to prevent an injection of a function call into the statement. While I think this is a good idea, I get the same error as you do when no injection is occuring. While I would recommend digging into the MDX statement a little deeper to understand the issue, I have in the past simply removed the CONSTRAINED keyword.

Not sure this is the best of ideas, but .....

Bryan

|||

That's what it was.

Thanks!

|||

You have CONSTRAINED in several areas, do you need to remove them all. Can you post your modified code?

Thanks,

Shari

|||I don't have access to my query right at the moment (I'm at a different location) but suffice it to say, I removed all of the CONSTRAINED flags and it worked. To the point made earlier, I'm not sure if it was a good idea, but it got me around the issue I was having.|||

I tried that, removing all the CONSTRAINED but got another error about STRTOSET function expects a tuple set, string was supplied .... . I am anxious to see your query if you could share (when you have access).

Thanks,

Shari

Monday, March 26, 2012

Report of Reports

Are there any example of SSRS reports using an rdl file as the source for the report. I.e. a Report of Reports?

Hi Freddie,

could you please elaborate a bit more?

thanks, 99

|||

One way of doing this in RS 2005 is to render a report with the xml data rendering extension as xml document. This is then used as input for the xml data extension. However, getting the query setup correctly and working is a bit tricky. A specific sample and explanation for this approach will be available in an upcoming MSDN article about the RS 2005 Xml data extension later this summer.

-- Robert

|||

Thanks Robert,

I did find an article "Integrate XML into Your Reporting Environment" by Bill Wolff at http://www.ftponline.com/special/sqlserver/bwolff/

I will be looking for the upcoming MSDN Article.

To elaborate more on my question...I would like to document my reporting service reports using reporting services. For example which property has custom code (e.g. IIF).

Report of Reports

Are there any example of SSRS reports using an rdl file as the source for the report. I.e. a Report of Reports?

Hi Freddie,

could you please elaborate a bit more?

thanks, 99

|||

One way of doing this in RS 2005 is to render a report with the xml data rendering extension as xml document. This is then used as input for the xml data extension. However, getting the query setup correctly and working is a bit tricky. A specific sample and explanation for this approach will be available in an upcoming MSDN article about the RS 2005 Xml data extension later this summer.

-- Robert

|||

Thanks Robert,

I did find an article "Integrate XML into Your Reporting Environment" by Bill Wolff at http://www.ftponline.com/special/sqlserver/bwolff/

I will be looking for the upcoming MSDN Article.

To elaborate more on my question...I would like to document my reporting service reports using reporting services. For example which property has custom code (e.g. IIF).

Report not reflecting Dataset

My SSRS 2005 Dataset refreshes fine but my report, even though I refresh isn't really picking it up 100%...it's missing an account but I know that account shows in my dataset in VS. I only am using one filter and that is fine...has no affect.

Is there a specific way to refresh my report after my dataset besides the refresh button for the report itself?

If you run the report in report designer, it will cache the data to a local file on disk (e.g. report1.rdl.data). The .rdl.data file should be refreshed if you click the green refresh icon in preview. If this doesn't work, you can always close report designer/VS, delete the .rdl.data file from disk and it will recreate that file the next you run the report by reexecuting queries.

-- Robert

|||thanks a bunch.|||

Thanks for the info on the .rdl.data, but I don't have such a file.

Two (out of three) datasets (ds) on my report are not refreshing, and if you try to run them, they err. The third dataset works fine. And, another report with 3 other datasets, works fine.

I have verified all the way back to the stored procs (SP) for the name, and a syntax check. And, in query analyzer they run.

When you look at a good dataset window, you have the SP dropdown on the upper right, which if the dataset result is displayed, the drop down is not available.

Then there's a light yellow sql section that just says that the ds 'uses' the SP name.

On one of the non working ds's, the sql section is white, has my SP name in it as tho it was sql code, and the drop down says it's an SP and shows the correct name.

I also tried a brand new project with just one of the offending ds's, and it didn't refresh or run there either.

Halp.

sql

Tuesday, March 20, 2012

Report Model & Data Source Views

Hi,
(Newbie at SSRS, 10 years experience with SQL-Server & Web/App programming)
I recently (about 1 week ago) introduced myself to the world of SSRS - but
it wasn't as straightforward as I first thought it should be. Try yourself by
searching for documentation about installing reporting services on another
machine than the same as the sql server (ie: at the webserver). As usual: -
you have to read several different webpages, scan through endless
documentation created by linquist-speciallists (discussing everything but the
subject) - a.k.a. 'quickstarts'. Whehehe..
Anyhow, I've now successfully setup Reporting Services and it really excells
at everything it does :)
However, I find it a little bit strange generating the Report Model from the
Data Source View. Shouldn't it be the otherway around? - First creating the
Model (a simple schema of the database - right?), and THEN creating the view
- 'building' upon that model. Could someone please expand on this subject?
Why?
Then there seems to be an issue when I try to include a SQL Server "SQL
View" a.k.a. "Indexed Views" into the Report Model, so this results in that
neither of my SQL View are accessible from the online Report Builder tool.
Shouldn't it be possible to include views in the Report Model?
Best Regards,
FredrikThis is how I solved it:
- In the Data Source View, be sure to set Logical Primary Keys for the SQL
Views that you want to use. Just select the unique columns (if more than
one), rightclick and create the key.
- In the Report Model, add the entities (SQL views) manually - name & bind
them to the SQL views. Rightclick on an empty & newly created entity and
select autogenerate, proceed through the wizard. Add the identifying column
manually on the the entity (using the properties tool-window).
- Build and combine the .DSV & .SMDL file into one (fairly easy to google),
then upload the resulting "model.smdl" to the Report Manager.
- Enjoy SQL views in Report Builder!
"Fredrik Johansson" wrote:
> Hi,
> (Newbie at SSRS, 10 years experience with SQL-Server & Web/App programming)
> I recently (about 1 week ago) introduced myself to the world of SSRS - but
> it wasn't as straightforward as I first thought it should be. Try yourself by
> searching for documentation about installing reporting services on another
> machine than the same as the sql server (ie: at the webserver). As usual: -
> you have to read several different webpages, scan through endless
> documentation created by linquist-speciallists (discussing everything but the
> subject) - a.k.a. 'quickstarts'. Whehehe..
> Anyhow, I've now successfully setup Reporting Services and it really excells
> at everything it does :)
> However, I find it a little bit strange generating the Report Model from the
> Data Source View. Shouldn't it be the otherway around? - First creating the
> Model (a simple schema of the database - right?), and THEN creating the view
> - 'building' upon that model. Could someone please expand on this subject?
> Why?
> Then there seems to be an issue when I try to include a SQL Server "SQL
> View" a.k.a. "Indexed Views" into the Report Model, so this results in that
> neither of my SQL View are accessible from the online Report Builder tool.
> Shouldn't it be possible to include views in the Report Model?
>
> Best Regards,
> Fredrik

Saturday, February 25, 2012

Report in SSRS using cube in SQL 2000

I want to create reports in SSRS that use cube in SQL 2000, I don't know which type of connection that i have to use,

I tested it with Microsoft SQL Analysis Services, means I connect to my cube with this type , everything is ok in developpement (create MDX query , make reports...), but in production It gives me this error message (cannot connect to the datasource),

so I don't know how to solve this problem,

Thanks in advance for your help...,

Regards

Posting the full error message would help.

Posting it in the Reporting Services forum would help even more.

-Jamie

Report in Report Manager (server) does not look the same way that it looks in the Visual Studio

I am using SSRS 2005 and my server is a Microsoft Windows Server 2003 Enterprise Edition Service Pack 1.

Most of the differences between VS and Report Manager are formatting differences. Borders won't show up, scrolling does not work etc. Is there something i need to upgrade on the server.

Last thing but not the least. Everytime i change something in regards to the parameters i need to delete the report from the report manager and deploy in order for the change to appear on the Report Manager. Is there a fix for this?

Could somebody please help me with these?

1. differences in rendering between design-time and run-time -- the renderer used in Report Designer is quite different than the renderer used in Report Manager. The Designer renderer is GDI-based, whereas the Report Manager renderer is HTML-based. There are many differences between these renderers, including handling of overlapping items, borders, and pagination.

2. changes to parameters made at design-time require deletion and republishing -- this is an artifact of our "server wins" philosophy. Since you can change parameter characteristics in the Report Server after a report has been published 9and therefore which may conflict with the characteristics stored in the RDL), it is indeterminate which version of the parameters a user expects to be persisted -- do you expect customizations made after publishing to dominate, or does republishing dominate? We chose to go with the server's version of parameters. Note that if we chose the other way, you would lose server-based parameter customizations everytime you republished an RDL. Admittedly it it would be nice to give users control over this, like with an RDL-based design-time option to choose which parameter collection dominates, or a publish-time option so you could choose one or the other at publish time.

|||You mean there is no way i can reproduce my params changes in the report manager with out deleting the report itself. Everytime i do that it deletes all the subscriptions on my report. Isn't there any work around?|||

Go ahead and republish the RDL, but don't bother making changes to the parameter properties in Report Designer -- just make them directly in the Report Manager or Management Studio UI.

If you need to change the # or name of the parameters, that will have to be done in Report Designer.

Report in Report Manager (server) does not look the same way that it looks in the Visual Stu

I am using SSRS 2005 and my server is a Microsoft Windows Server 2003 Enterprise Edition Service Pack 1.

Most of the differences between VS and Report Manager are formatting differences. Borders won't show up, scrolling does not work etc. Is there something i need to upgrade on the server.

Last thing but not the least. Everytime i change something in regards to the parameters i need to delete the report from the report manager and deploy in order for the change to appear on the Report Manager. Is there a fix for this?

Could somebody please help me with these?

1. differences in rendering between design-time and run-time -- the renderer used in Report Designer is quite different than the renderer used in Report Manager. The Designer renderer is GDI-based, whereas the Report Manager renderer is HTML-based. There are many differences between these renderers, including handling of overlapping items, borders, and pagination.

2. changes to parameters made at design-time require deletion and republishing -- this is an artifact of our "server wins" philosophy. Since you can change parameter characteristics in the Report Server after a report has been published 9and therefore which may conflict with the characteristics stored in the RDL), it is indeterminate which version of the parameters a user expects to be persisted -- do you expect customizations made after publishing to dominate, or does republishing dominate? We chose to go with the server's version of parameters. Note that if we chose the other way, you would lose server-based parameter customizations everytime you republished an RDL. Admittedly it it would be nice to give users control over this, like with an RDL-based design-time option to choose which parameter collection dominates, or a publish-time option so you could choose one or the other at publish time.

|||You mean there is no way i can reproduce my params changes in the report manager with out deleting the report itself. Everytime i do that it deletes all the subscriptions on my report. Isn't there any work around?|||

Go ahead and republish the RDL, but don't bother making changes to the parameter properties in Report Designer -- just make them directly in the Report Manager or Management Studio UI.

If you need to change the # or name of the parameters, that will have to be done in Report Designer.

Report Headers & Footers

I see the Page Header and Page footer, but what about Report Header and Report Footers? Doesn't look like ssrs has this ability, am I wrong?

I was able to accomplish what I want by following the suggestion in this post:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=377566&SiteID=1

IMO, this is lame. Come on, even Access has a Report Header & Report Footer, what were they thinking? Seems like to get simple stuff done in ssrs you have to basically find hacks and workarounds. Not impressed.

|||

Hello,

Would the table header/footer work for you?

Jarret

|||

Yes, I ended having to use the table header/footer like it is described in the link in my previous post. I still think this is kind of a hack and am wondering why ReportHeader & ReportFooter were left out.

|||

The link in your previous post takes me to another post by you for Parameter Validation Failed. Oh well, glad you got it working.

Maybe I am missing something, but I can't think of any reason why they wouldn't be considered synonymous. Can you give me an example of something a report header can do that a table header can't (or vice versa), just for my knowledge?

Jarret

|||Sorry about that! I have fixed the link to point to the correct article, thanks for pointing that out.