Showing posts with label specific. Show all posts
Showing posts with label specific. Show all posts

Saturday, February 25, 2012

Changing of @@IDENTITY item in a trigger

Hello!

I have a instead of insert trigger that after doing some validation, inserts a record into a specific table. Another table requires the key generated by this insert in order to add a record, which is done at the end of the trigger. When called from a client (via a recordset.update call) the newly created key from the first insert is overridden with the key from the second insert. Any ideas on how I can save the first key, then pass it back to the client? The client currently receives the second key created.

Thanks in advance,

EverettI have exactly the same problem and although I don't have a solution (yet), I have found out that this appears to be by design. ADO does a "Select @.@.IDENTITY" after an insert to retrieve the key of the record inserted (See Chapter 11 of "Programming ADO" by David Sceppa at http://www.microsoft.com/mspress/books/sampchap/3445a.asp). If there was some way to modify ADO's behaviour to use instead "Select IDENT_CURRENT('<tablename>')" then problem solved. The article describes a "Update Resync" dynamic record set property but it doesn't appear to be flexible enough to tell ADO to use IDENT_CURRENT.

The hunt continues...

Sunday, February 19, 2012

Changing Group BackgroundColor from Field Values

Hello Everybody,

I'am working with "Reporting Services 2005".
I would like to have specific Colors for a Group.

e.g.

+Apel: (Group, f.e. "green")

+peach: (Group, f.e. "red")
....

Apel and peach have each a color assigned in the database.
Each Report can have different Fruits on it, but they are defined by their color.

Could change the color statically and and toggle Details Colors, but nut this!

Thanks very much for any kind of help!

Have your query return the background color. THen add that color field to your group. Set the rowdetail background to the color from the dataset.|||Thanks very much, it works!

Friday, February 10, 2012

Changing Data Sources Quick and Dirty

Has anyone stumbled on a quick easy way to change all report DataSources to
one specific shared DataSource? Any cool tricks or scripts or whatnot would
be appreciated. Even just a reply saying that there is no easy way to do it
would be great so I can give up searching for an answer.You could do it manually from the datasources...I am sure you have
figured that part out. You don't actually have to go to the reports to
do this though. I guess there would be a way to change the guid that
represents the datasource on the report in the SQL database. I doubt
that Microsoft will support you if you opt to go that route though. I
would say...practice on a non production machine first. Not sure if
that is much help.|||Timm wrote:
> Has anyone stumbled on a quick easy way to change all report
DataSources to
> one specific shared DataSource? Any cool tricks or scripts or whatnot
would
> be appreciated. Even just a reply saying that there is no easy way to
do it
> would be great so I can give up searching for an answer.
The book "Hitchhiker's guide to reporting service" has a code snippet ,
you need to call soap api SetReportDataSources ,I use it to change
datasouce after I created the reports|||Really? What page is it on?
"ottawa111" wrote:
> Timm wrote:
> > Has anyone stumbled on a quick easy way to change all report
> DataSources to
> > one specific shared DataSource? Any cool tricks or scripts or whatnot
> would
> > be appreciated. Even just a reply saying that there is no easy way to
> do it
> > would be great so I can give up searching for an answer.
> The book "Hitchhiker's guide to reporting service" has a code snippet ,
> you need to call soap api SetReportDataSources ,I use it to change
> datasouce after I created the reports
>|||You can use this code instead the book
Dim reference As New ReportServer.DataSourceReference
reference.Reference = "/MyDS"
Dim dss As New ReportServer.DataSource
dss.Item = CType(reference,
ReportServer.DataSourceDefinitionOrReference)
dss.Name = "MyDS"
Dim dsList() As ReportServer.DataSource = New
ReportServer.DataSource(1){}
dsList(1) = dss
dsList(1).Name = "MyDS"
rs.SetReportDataSources("/Test report1", dsList)
"Timm" wrote:
> Really? What page is it on?
> "ottawa111" wrote:
> >
> > Timm wrote:
> > > Has anyone stumbled on a quick easy way to change all report
> > DataSources to
> > > one specific shared DataSource? Any cool tricks or scripts or whatnot
> > would
> > > be appreciated. Even just a reply saying that there is no easy way to
> > do it
> > > would be great so I can give up searching for an answer.
> >
> > The book "Hitchhiker's guide to reporting service" has a code snippet ,
> > you need to call soap api SetReportDataSources ,I use it to change
> > datasouce after I created the reports
> >
> >