Showing posts with label datai. Show all posts
Showing posts with label datai. Show all posts

Monday, March 12, 2012

Generating a cached copy of the report

Is there a way to programatically determine if a report should be generated from the cache or run against real-time data?

I have a situation wherein I would need to programmatically figure out if the datasource needs to be a cached version or real-time data based on certain options that a user defines (not report parameters)...

any help would be very appreciated.Not before running the report, but afterwards you can look at the ExecutionDate property. Depending on the version of SRS you are using that can be retrieved in different ways.|||

NOt sure what you're trying to do: data sources are not cached in Reporting Services. Report are.

Essentially, if you want cache to work, you need to set the data source to use stored credentials and not use any User!UserID or User!Language references in your report.

The GetCacheOptions method provides caching information on the report itself.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsprog/htm/rsp_ref_soapapi_service_ak_5jas.asp

-Lukasz

|||

Yes, I would like to have the report cached with the underlying data in it.

If I were to have it cached per UserID, would having references to User!UserID in the report take care of it?

Sorry if this is a pretty basic question, but I am trying to finalize if this is possible using Reporting services.
Thanks

|||The cache is not per user, it is shared between users (based on parameters). You can use a post query filter on UserID but referenceing the user it in the query doesn't make any sense. All of the caching options are discussed in the online help.|||If the report uses UserID in a post-query filter, the report will get cached, but the filter will be re-executed for each user.|||

I am trying to get around the user global variable to run reports. I have security implemented by User in the reports. i.e. a userID is only allowed to select the following regions in the region parameter,

I also have a hidden parameter that has two values; online and offline. The parameter is defaulted to online when running the reports interactively and for subscriptions to batch. When it is online, I get the current logged on userID using a CLR function. We get around the batch parameters by using a master userID that has access to all the data (all regions) in the subscriptions.

When the subscription is run with batch, will the interactive users pick up the cached report or run it again as the interactive parameter is online? From your reply, the cache that is selected is based on the parameter list for the report.

The real question is caching based on the parameters passed to retrieve from cache or is there a way around it? Or is there a way to determine if a cached version of the report is being run so that I can plug in my master userID?

Thanks

Generating a cached copy of the report

Is there a way to programatically determine if a report should be generated from the cache or run against real-time data?

I have a situation wherein I would need to programmatically figure out if the datasource needs to be a cached version or real-time data based on certain options that a user defines (not report parameters)...

any help would be very appreciated.Not before running the report, but afterwards you can look at the ExecutionDate property. Depending on the version of SRS you are using that can be retrieved in different ways.|||

NOt sure what you're trying to do: data sources are not cached in Reporting Services. Report are.

Essentially, if you want cache to work, you need to set the data source to use stored credentials and not use any User!UserID or User!Language references in your report.

The GetCacheOptions method provides caching information on the report itself.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsprog/htm/rsp_ref_soapapi_service_ak_5jas.asp

-Lukasz

|||

Yes, I would like to have the report cached with the underlying data in it.

If I were to have it cached per UserID, would having references to User!UserID in the report take care of it?

Sorry if this is a pretty basic question, but I am trying to finalize if this is possible using Reporting services.
Thanks

|||The cache is not per user, it is shared between users (based on parameters). You can use a post query filter on UserID but referenceing the user it in the query doesn't make any sense. All of the caching options are discussed in the online help.|||If the report uses UserID in a post-query filter, the report will get cached, but the filter will be re-executed for each user.|||

I am trying to get around the user global variable to run reports. I have security implemented by User in the reports. i.e. a userID is only allowed to select the following regions in the region parameter,

I also have a hidden parameter that has two values; online and offline. The parameter is defaulted to online when running the reports interactively and for subscriptions to batch. When it is online, I get the current logged on userID using a CLR function. We get around the batch parameters by using a master userID that has access to all the data (all regions) in the subscriptions.

When the subscription is run with batch, will the interactive users pick up the cached report or run it again as the interactive parameter is online? From your reply, the cache that is selected is based on the parameter list for the report.

The real question is caching based on the parameters passed to retrieve from cache or is there a way around it? Or is there a way to determine if a cached version of the report is being run so that I can plug in my master userID?

Thanks

Friday, March 9, 2012

generate update statements for existing data

Does anyone know how to write scripts for generating update statements for
existing data?
I found a stored procedure online that generates INSERT statements for a
given table, I was wondering if anyone has worked on a UPDATE generatorMike
What do you mean by "generating update"?
Do you want to build a script that does updateting?
declare @.sql varchar(400)
set @.sql='update '+ @.tablename+' set col'..........
"Mike" <Mike@.discussions.microsoft.com> wrote in message
news:9E10B2B9-80CC-4E50-9E34-5865A0C3BA1D@.microsoft.com...
> Does anyone know how to write scripts for generating update statements for
> existing data?
> I found a stored procedure online that generates INSERT statements for a
> given table, I was wondering if anyone has worked on a UPDATE generator|||I have a tables with about 1000 records and if I make changes I would like t
o
generate script (UPDATE scripts) for the existing data that I could run on
another server or ship it to a client with the latest changes instead of a
restore.
there is a good insert script available at
http://vyaskn.tripod.com/code.htm#inserts , I am looking for something
similar for UPDATE
"Uri Dimant" wrote:

> Mike
> What do you mean by "generating update"?
> Do you want to build a script that does updateting?
>
> declare @.sql varchar(400)
> set @.sql='update '+ @.tablename+' set col'..........
>
> "Mike" <Mike@.discussions.microsoft.com> wrote in message
> news:9E10B2B9-80CC-4E50-9E34-5865A0C3BA1D@.microsoft.com...
>
>|||Mike
Do you consider using Replication/Triggers ? It will be much better than
generating SQL script.
If you use SQL Server 2005 you can create a SNAPSHOP database ( ah i forgot
, it should be on the same server),sorry.
"Mike" <Mike@.discussions.microsoft.com> wrote in message
news:00EF43C1-EBF7-4422-99D0-A1979F3500A0@.microsoft.com...
>I have a tables with about 1000 records and if I make changes I would like
>to
> generate script (UPDATE scripts) for the existing data that I could run on
> another server or ship it to a client with the latest changes instead of a
> restore.
> there is a good insert script available at
> http://vyaskn.tripod.com/code.htm#inserts , I am looking for something
> similar for UPDATE
> "Uri Dimant" wrote:
>|||Mike wrote:
> I have a tables with about 1000 records and if I make changes I would like
to
> generate script (UPDATE scripts) for the existing data that I could run on
> another server or ship it to a client with the latest changes instead of a
> restore.
> there is a good insert script available at
> http://vyaskn.tripod.com/code.htm#inserts , I am looking for something
> similar for UPDATE
>
http://www.red-gate.com/products/SQ...mpare/index.htm
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||Try www.sqlscripter.com to generate data scripts. All types are supported
(Insert, Update, Delete).
It's free.
Thomas
"Mike" wrote:

> Does anyone know how to write scripts for generating update statements for
> existing data?
> I found a stored procedure online that generates INSERT statements for a
> given table, I was wondering if anyone has worked on a UPDATE generator