Showing posts with label string. Show all posts
Showing posts with label string. Show all posts

Sunday, March 25, 2012

CustomData on SQL Server connection string?

Analysis Services has a CustomData connection string property. You can put anything on it, then inside an MDX query you can use the CustomData() function to retrieve whatever was on the connection string. This is helpful for passing in a security token.

Is there anything equivalent for SQL Server?

I also posted this here, but got no response so thought I'd check in the security forum.

I'm not sure that there is a property which is exactly suited for passing custom user data, but there is a property which you might modify without affecting pretty much anything else.

The property is "Application Name" (SSPROP_INIT_APPNAME).

|||

I see where you're going with that, but is there a SQL function to detect the application name from the connection string of the currently connected person?

|||

Hi,

What you can do to get the application name provided in the property is to run a statement like this:

select program_name from master..sysprocesses where spid=@.@.spid

HTH,
Jivko Dobrev - MSFT
--
This posting is provided "AS IS" with no warranties, and confers no rights.

CustomData on SQL Server connection string?

Analysis Services has a CustomData connection string property. You can put anything on it, then inside an MDX query you can use the CustomData() function to retrieve whatever was on the connection string. This is helpful for passing in a security token.

Is there anything equivalent for SQL Server?

I also posted this here, but got no response so thought I'd check in the security forum.

I'm not sure that there is a property which is exactly suited for passing custom user data, but there is a property which you might modify without affecting pretty much anything else.

The property is "Application Name" (SSPROP_INIT_APPNAME).

|||

I see where you're going with that, but is there a SQL function to detect the application name from the connection string of the currently connected person?

|||

Hi,

What you can do to get the application name provided in the property is to run a statement like this:

select program_name from master..sysprocesses where spid=@.@.spid

HTH,
Jivko Dobrev - MSFT
--
This posting is provided "AS IS" with no warranties, and confers no rights.

Thursday, March 22, 2012

Custom Stored procedure

Hi, I've tried to develop custom function for AS 2005, written in C#, and registered as database assembly

Code snippet is here

public string MySampleMethod()

{

AdomdCommand command = new AdomdCommand();

command.CommandText = string.Format("with member A AS 'username' select A on 0 FROM MyCube");

return (string)command.ExecuteScalar();

}

Error that I've got was "XML for Analysis parser: The input query is not in the language specified in the Dialect property for this request."

When I execute the same query from SQL Management Studio, everything works OK.

What I did wrong and how it can be resolved?

Thanks in advance

Borko

Hi Borko,

You can't use AS stored procs to execute queries on the same connection as you're using to call the proc, unfortunately. You can open a new connection within the proc but that may or may not be particularly useful to you - here's an example of how to do this:

using System;

using System.Collections.Generic;

using System.Text;

using Microsoft.AnalysisServices.AdomdServer;

using Microsoft.AnalysisServices.AdomdClient;

namespace MDXTests

{

public class RunMDXQueries

{

public static Microsoft.AnalysisServices.AdomdClient.AdomdDataReader RunAQuery()

{

Microsoft.AnalysisServices.AdomdClient.AdomdCommand c = new Microsoft.AnalysisServices.AdomdClient.AdomdCommand("select measures.members on 0 from [adventure works]");

AdomdConnection conn = new AdomdConnection(@."Data Source=localhost\sh; Provider=msolap.3; initial catalog=adventure works dw");

conn.Open();

c.Connection = conn;

return c.ExecuteReader();

}

}

}

You need to set security permissions to 'unrestricted' to get this to work; you can then call this from SQLMS using the following:

CALL SPSRUNNINGQUERIES.RUNAQUERY()

HTH,

Chris

|||

Chris,

information that is not possible to execute queries on the same connection as connection used to call the proc is very usefull.

Thank you very much.

Borko

Sunday, March 11, 2012

Custom query string question

Hi there,

I have a custom query string that I placed as a varchar, for instance

@.UnknownColumnName varchar(100)
@.CostumQueryString varchar(1000)
@.Value int

SET @.UnknownColumnName = (SELECT ColName FROM Utility WHERE ID =1)

SET @.CustomQueryString = 'SELECT ' + @.UnknownColumnName + ' From Table2 WHERE .....'

I have to execute this custom querystring now:
SET @.Value = (EXEC sp_executesql @.CustomQueryString)

I get a syntax error....I'm not sure how i can execute this querystirng and set the result to a variable..any help much appreciated

Regards
Mike

you can try this one

SET @.CustomQueryString = 'SELECT ' + @.UnknownColumnName + ' INTO #Values From Table2 WHERE .....'

EXEC sp_executesql @.CustomQueryString

SELECT *
FROM #Values

DROP TABLE #Values|||Hi, thanks for the reply.

I actually found the solution in books online (ooops should have searched harder there) and the best way of doing this is to make use of OUTPUT parameters:

DECLARE @.IntVariable int;
DECLARE @.SQLString nvarchar(500);
DECLARE @.ParmDefinition nvarchar(500);
DECLARE @.max_title varchar(30);

SET @.IntVariable = 197;
SET @.SQLString = N'SELECT @.max_titleOUT = max(Title)
FROM AdventureWorks.HumanResources.Employee
WHERE ManagerID = @.level';
SET @.ParmDefinition = N'@.level tinyint, @.max_titleOUT varchar(30) OUTPUT';

EXECUTE sp_executesql @.SQLString, @.ParmDefinition, @.level = @.IntVariable, @.max_titleOUT=@.max_title OUTPUT;

SELECT @.max_title;

Thursday, March 8, 2012

Custom Formatt Required

Hi,
I need custom format string for displaying percentage values.
If negative values are there it should be displayed within
paranthesis(brackets), it should display two decimal values also.
Example:
Present Value Format
--
-0.21%
Required Value Format
--
(0.21)%
Plzz help me with any suggestion/url, it's very urgent.
Thanks and Regards,
Rajesh Yennam.
HA,India.#0.0%;(#0.0%)
HTH
"Rajesh Yennam" <RajeshYennam@.discussions.microsoft.com> wrote in message
news:3FFB1760-D5F1-4092-A4F5-1F339F6CC6B6@.microsoft.com...
> Hi,
> I need custom format string for displaying percentage values.
> If negative values are there it should be displayed within
> paranthesis(brackets), it should display two decimal values also.
> Example:
> Present Value Format
> --
> -0.21%
> Required Value Format
> --
> (0.21)%
> Plzz help me with any suggestion/url, it's very urgent.
> Thanks and Regards,
> Rajesh Yennam.
> HA,India.|||Take a look at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcustomnumericformatstrings.asp
You can use semi-colons in your format string semicolon to specify positive,
negative, and zero formats, e.g.
%;(%);%
--
Brian Welcker
Group Program Manager
Microsoft SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
"Rajesh Yennam" <RajeshYennam@.discussions.microsoft.com> wrote in message
news:3FFB1760-D5F1-4092-A4F5-1F339F6CC6B6@.microsoft.com...
> Hi,
> I need custom format string for displaying percentage values.
> If negative values are there it should be displayed within
> paranthesis(brackets), it should display two decimal values also.
> Example:
> Present Value Format
> --
> -0.21%
> Required Value Format
> --
> (0.21)%
> Plzz help me with any suggestion/url, it's very urgent.
> Thanks and Regards,
> Rajesh Yennam.
> HA,India.|||Thanks a lot for your response Tim.
It's working fine.
Thanks and Regards,
Rajesh Yennam
HA,India.
"Tim Ellison" wrote:
> #0.0%;(#0.0%)
> HTH
> "Rajesh Yennam" <RajeshYennam@.discussions.microsoft.com> wrote in message
> news:3FFB1760-D5F1-4092-A4F5-1F339F6CC6B6@.microsoft.com...
> > Hi,
> > I need custom format string for displaying percentage values.
> > If negative values are there it should be displayed within
> > paranthesis(brackets), it should display two decimal values also.
> >
> > Example:
> > Present Value Format
> > --
> > -0.21%
> >
> > Required Value Format
> > --
> > (0.21)%
> >
> > Plzz help me with any suggestion/url, it's very urgent.
> >
> > Thanks and Regards,
> > Rajesh Yennam.
> > HA,India.
>
>

Wednesday, March 7, 2012

Custom error msg breaks my error handler

Hi,

I added this line of code to my error handler script, in red.

User:Tongue TiedcriptError is a package-level string variable

User:Tongue TiedcriptError has a value assigned to it when another script encounters an error condition (which I define)

I added "User:Tongue TiedcriptError" as a read-only variable to the error handler script task.

Public Sub Main()

Dim messages As Collections.ArrayList

Try

messages = CType(Dts.Variables("errorMessages").Value, Collections.ArrayList)

Catch ex As Exception

messages = New Collections.ArrayList()

End Try

messages.Add(Dts.Variables("SourceName").Value.ToString)

messages.Add(Dts.Variables("ErrorDescription").Value.ToString())

messages.Add(Dts.Variables("scriptError").Value.ToString)

Dts.Variables("errorMessages").Value = messages

Dts.TaskResult = Dts.Results.Success

End Sub

Now, when I run the package, and an it encounters an error, it task just hangs, that is, it stays yellow instead of turning red... if I remove the line in red above, it works ok again.

Why would this line cause a problem?

Thanks

Make sure you are unlocking the scriptError variable in the first task. It might help if you post the script from that task.|||

Hi,

What do you mean by "unlocking the scriptError variable"?

Thanks

|||Dts.Variables.Unlock()|||

I will try that. Why is unlocking necessary? I've never run into this before.

Thanks

|||If the first task is raising an error, the error handling task can be fired before the variable is unlocked in the first task. Make sure that you unlock it in the error handler in the first script.|||

This is the part of my code that seems to be causing the problem. I am trying to set the "scriptError" variable to the error message below. As you can see, I am setting the Dts.TaskResult to "failure" BEFORE assigning the value to my variable. The "failure" causes execution to go to my Error Handler script task. That's where it hangs.

Perhaps I should put the the "failure" AFTER the variable assignment.

I don't understand all this "unlocking" stuff quite yet. What do you mean by "unlock it in the error handler"? Perhaps that doesn't apply here, I don't know.

Thanks

Else

Dts.TaskResult = Dts.Results.Failure

Dts.Variables("scriptError").Value = "The extracts in " & CStr(Dts.Variables("Folder").Value) & " are not current! Data NOT loaded."

End If

|||Adding

Dts.Variables.Unlock()

right after the variable is written to (but not before) works!

Custom error msg breaks my error handler

Hi,

I added this line of code to my error handler script, in red.

User:Tongue TiedcriptError is a package-level string variable

User:Tongue TiedcriptError has a value assigned to it when another script encounters an error condition (which I define)

I added "User:Tongue TiedcriptError" as a read-only variable to the error handler script task.

Public Sub Main()

Dim messages As Collections.ArrayList

Try

messages = CType(Dts.Variables("errorMessages").Value, Collections.ArrayList)

Catch ex As Exception

messages = New Collections.ArrayList()

End Try

messages.Add(Dts.Variables("SourceName").Value.ToString)

messages.Add(Dts.Variables("ErrorDescription").Value.ToString())

messages.Add(Dts.Variables("scriptError").Value.ToString)

Dts.Variables("errorMessages").Value = messages

Dts.TaskResult = Dts.Results.Success

End Sub

Now, when I run the package, and an it encounters an error, it task just hangs, that is, it stays yellow instead of turning red... if I remove the line in red above, it works ok again.

Why would this line cause a problem?

Thanks

Make sure you are unlocking the scriptError variable in the first task. It might help if you post the script from that task.|||

Hi,

What do you mean by "unlocking the scriptError variable"?

Thanks

|||Dts.Variables.Unlock()|||

I will try that. Why is unlocking necessary? I've never run into this before.

Thanks

|||If the first task is raising an error, the error handling task can be fired before the variable is unlocked in the first task. Make sure that you unlock it in the error handler in the first script.|||

This is the part of my code that seems to be causing the problem. I am trying to set the "scriptError" variable to the error message below. As you can see, I am setting the Dts.TaskResult to "failure" BEFORE assigning the value to my variable. The "failure" causes execution to go to my Error Handler script task. That's where it hangs.

Perhaps I should put the the "failure" AFTER the variable assignment.

I don't understand all this "unlocking" stuff quite yet. What do you mean by "unlock it in the error handler"? Perhaps that doesn't apply here, I don't know.

Thanks

Else

Dts.TaskResult = Dts.Results.Failure

Dts.Variables("scriptError").Value = "The extracts in " & CStr(Dts.Variables("Folder").Value) & " are not current! Data NOT loaded."

End If

|||Adding

Dts.Variables.Unlock()

right after the variable is written to (but not before) works!

Custom error msg breaks my error handler

Hi,

I added this line of code to my error handler script, in red.

User:Tongue TiedcriptError is a package-level string variable

User:Tongue TiedcriptError has a value assigned to it when another script encounters an error condition (which I define)

I added "User:Tongue TiedcriptError" as a read-only variable to the error handler script task.

Public Sub Main()

Dim messages As Collections.ArrayList

Try

messages = CType(Dts.Variables("errorMessages").Value, Collections.ArrayList)

Catch ex As Exception

messages = New Collections.ArrayList()

End Try

messages.Add(Dts.Variables("SourceName").Value.ToString)

messages.Add(Dts.Variables("ErrorDescription").Value.ToString())

messages.Add(Dts.Variables("scriptError").Value.ToString)

Dts.Variables("errorMessages").Value = messages

Dts.TaskResult = Dts.Results.Success

End Sub

Now, when I run the package, and an it encounters an error, it task just hangs, that is, it stays yellow instead of turning red... if I remove the line in red above, it works ok again.

Why would this line cause a problem?

Thanks

Make sure you are unlocking the scriptError variable in the first task. It might help if you post the script from that task.|||

Hi,

What do you mean by "unlocking the scriptError variable"?

Thanks

|||Dts.Variables.Unlock()|||

I will try that. Why is unlocking necessary? I've never run into this before.

Thanks

|||If the first task is raising an error, the error handling task can be fired before the variable is unlocked in the first task. Make sure that you unlock it in the error handler in the first script.|||

This is the part of my code that seems to be causing the problem. I am trying to set the "scriptError" variable to the error message below. As you can see, I am setting the Dts.TaskResult to "failure" BEFORE assigning the value to my variable. The "failure" causes execution to go to my Error Handler script task. That's where it hangs.

Perhaps I should put the the "failure" AFTER the variable assignment.

I don't understand all this "unlocking" stuff quite yet. What do you mean by "unlock it in the error handler"? Perhaps that doesn't apply here, I don't know.

Thanks

Else

Dts.TaskResult = Dts.Results.Failure

Dts.Variables("scriptError").Value = "The extracts in " & CStr(Dts.Variables("Folder").Value) & " are not current! Data NOT loaded."

End If

|||Adding

Dts.Variables.Unlock()

right after the variable is written to (but not before) works!

Custom dataflow component: How do you make properties editable?

I have a custom component that takes in unicode stream and converts it to ascii text. However I would like to make my default string length and code page editable in the standard GUI editor. Right now I can set the default to 1000 characters, but when I try to change it, it says "Property value is not valid"

Any ideas?

Thanks!

I assume you define your property in ProvideComponentProperties? Can you post the code just to be clear?

By default this is all you need to do, the property should then be listed in teh Advanced UI and also in the Visual Studio designer property grid. You would have to do some extra special stuff to make it read-only.

I would check the data type of your property and see what value you have entered, it maybe a simple data conversion issue. To be sure of the property type I woudl view the package XML and find your property and look for the dataType. When you define properties in code, there is no way to really specify the type, it is kind of guess work based on the default value, and it does get it wrong sometimes.

Some package XML to illustrate where you should look...

blah...blah...

<component id="174" name="Your Component Name" componentClassID=.......>

<properties>

<property id="175" name="Your Property" dataType="System.Int32 CHECK THIS"....

Custom Data Mining Functions

I would like to write a custom mining function, which takes a string, queries the database, and returns an answer based upon those queries. So the basic function is then:

[MiningFunction("Performs Foo")]
public string Foo(string param)
{
// process parameters
// query database

// calculate answer from query results

// return query results
}

And is executed from the client using:

SELECT Foo("X Y Z") FROM FooModel

This arrangement is so that resource-intensive calculations are performed server-side.

My question is: what is the preferrable method for executing the database query from within the custom mining function?

Custom mining functions are not actually designed for this kind of operations. They are intended for predictive features that are related to the mining model and typically this kind of operations do not need external access (such as a database query). I assume that your function's calculation part will use some information from the mining model and apply it to the database query results.

I think you should use a stored procedure. Inside the stored procedure, you should use the server side object model (add a reference to Microsoft.AnalysisServices.AdomdServer). With the server side object model, you can perform the following operations:

- use AdomdCommand to execute calls such as CALL SystemOpenQuery(DataSource, Query), which is the recommended way of querying a relational database from analysis services

- also use AdomdCommand to execute calls such as SELECT .... FROM YourModel PREDICTION JOIN OPENQUERY(DataSource, Query)

This would allow you to get the information from the data base together with scoring for each, scoring computed as a prediction from your model ). Your code could use the results and perform aggregations or more complex computations on the result.

If, in the code of your stored procedure, you need to get extra information from your model, you can traverse the content of the mining model using the object model.

The article at http://www.sqlserverdatamining.com/DMCommunity/TipsNTricks/4264.aspx contains such a stored procedure, which requires both data and model content information, so I think it may be a good example. The data is coming directly from the model, with a drillthrough query. You can replace that query with a CALL SystemOpenQuery or prediction against an OPENQUERY statement.

Hope this helps

|||Yes, this is helpful. I'm looking at the material you referenced to see if it completely answers my question. Unfortunately, I don't seem able to progress pass the logon screen at sqlserverdatamining at the moment, so I can't get the .cs example...|||Do you have an account on sqlserverdatamining.com? Do you have problems logging in with your account? Or creating a new account

Saturday, February 25, 2012

Custom Data Extension to SQL Server

Where I work we have custom code to retrieve the connection string. Theprogrammer provides a role and a mode and a connection object isretured. I need similar functionality from Reporting Services and I'mnot sure where to start. I was thinking of passing the role and mode inas username and password under credentials and being able to use thisas my connection to get data for reports. Any help in solving thisproblem would be greatly appreciated.

SQL Server Reporting services is part of SQL Server so you can create roles either with stored procedure or under permissions in Enterprise manager. Hope this helps.

Kind regards,

Gift Peddie

|||Sorry but you did not understand my post. Please read before replying.As I said we have custom code that we pass a role and mode to that willgive us the CONNECTIONSTRING.
Ryan
|||

Sorry maybe the link below could help.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secmod/html/secmod12.asp

Kind regards,

Gift Peddie

|||I have figured it out and that link doesn't relate to the problem.
I figured out how to do a custom data extension but I am getting astack overflow exception when I try using the extension. I am alsogetting a SecurityPermission exception when I try calling a functionthat uses interop code. So anyone with any ideas to either of theseproblems would be appreciated.
Ryan

Custom Data Extension - Query String

Hi,
--Question
I have a created a custom data extension and I want to populate the query
string with some default text, how can I do this? I've initialised the
command text property to my desired default but it always shows an empty
string in the designer? I've included the background as to why I want to do
this below.
Any help would be much appreciated
--Background info
I have created a custom data extension which works just fine when I hard
code the 3 parameters required. These parameters are actually instruction for
my DAL to work with so they are essential to know up front, rather than
typical parameters that would be passed to a SP to filter data. My parameters
are XmlConfigFile and DataProviderID, my DAL then creates an object using
info from the config file for the specified DataProviderID. Since these
params are essential to return any data I want them to be passed via the
query string, I also want the default query string to have them populated
with empty strings
e.g. @.XmlConfigFile='' ; @.DataProviderId=''
This way the report designer just needs to add the values an not remember
the parameter names.The CommandText property gets set by report designer based on the
user-specified values. From the designer point of view, the CommandText
property is "set-only". It will never get the value of the property.
Not sure if this would work for your situation, but you could generate a
"report template" which has a prepopulated dataset with command text.
Instead of creating a new report, report authors should instead create the
new report based of that template.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Neil" <Neil@.discussions.microsoft.com> wrote in message
news:BDF78560-A993-4CBD-A126-3B8DB7D70C2E@.microsoft.com...
> Hi,
> --Question
> I have a created a custom data extension and I want to populate the query
> string with some default text, how can I do this? I've initialised the
> command text property to my desired default but it always shows an empty
> string in the designer? I've included the background as to why I want to
> do
> this below.
> Any help would be much appreciated
> --Background info
> I have created a custom data extension which works just fine when I hard
> code the 3 parameters required. These parameters are actually instruction
> for
> my DAL to work with so they are essential to know up front, rather than
> typical parameters that would be passed to a SP to filter data. My
> parameters
> are XmlConfigFile and DataProviderID, my DAL then creates an object using
> info from the config file for the specified DataProviderID. Since these
> params are essential to return any data I want them to be passed via the
> query string, I also want the default query string to have them populated
> with empty strings
> e.g. @.XmlConfigFile='' ; @.DataProviderId=''
> This way the report designer just needs to add the values an not remember
> the parameter names.

Friday, February 24, 2012

Custom Code/function to format Seconds to hh:mm:ss with ability to go over 24 hours

Hello,

I am trying to get this to work - but it only returns minutes & seconds:

Function Seconds2mmss(ByVal seconds As Integer) As String
Dim ss As Integer = seconds Mod 60
Dim mm As Integer = (seconds - ss) / 60
Seconds2mmss = String.Format("{0:0}:{1:00}", mm, ss)
End Function

Can anyone help me out? I am not that familiar with VB.

Thanks,

Deb

I think this is more of an access report expression format, but it should help you out.

=Int([sumofacd]/3600) & ":" & (Int([sumofacd]/60)-(Int([sumofacd]/3600)*60)) & ":" & format(([sumofacd] Mod 60),"00")

"It works by dividing sumofacd by the number of seconds in 1 hour, the integer of this then becomes the Hours, we then need to take the remainder and convert it to Minutes.

There is more than one way to do the next part. My choice is to divide sumofacd by 60, the integer of this will be the total number of minutes from sumofacd, I then repeat the first part of the equation this time multiplying it by 60 to change it back to minutes, I then minus this from the minutes calculated earlier, this gives the minutes (ie less than 60 or 1 hour).

To get seconds is much easier, as the other elements are made up of multiples of 60 we only require the balance, below 60 so we use the VB Mod function to do this and then format the result.

My first error was to ignore the formatting, doing this would give a :3 instead of :03, and thinking about it you maybe should format the minutes the same way to give 0:03:03 instead of 0:3:03.

Think I will stop looking at the equation, can see additional brakets in the minutes calculation now, for the record would complete each part of the equation before attempting to use the format, as you need the result before formatting, this way you are less likely to get mixed up due to the high number of brackets used"

http://www.utteraccess.com/forums/showflat.php?Board=87&Number=1140884

|||

Thanks for your reply, however, I am not sure how to incorporate this into my report. Does the above expression belong in the code itself, or is it referenced in a report field? This is the first time I've ever tried to use code in a RS report, if you could steer me in the right direction I'm sure I can figure it out.

Deb

Custom Code in Chart - background color

I have the following very simple code block that I wrote for a chart.
public function bdr_chartcolor(xType as string) as string
IF xType = "IR"
return "White"
ELSE
return "Blue"
END IF
end function
HOW and WHERE do I implement it to set the charts background color? Many
properties of objects have EXPRESSION as an option, HOWEVER, there is no
EXPRESSION as a type for a chart's background color in the properties.Chart area, Fill.
"MSSQLServerDeveloper" <MSSQLServerDeveloper@.discussions.microsoft.com>
wrote in message news:22B72235-5282-4095-951F-9B9DCF89E0B3@.microsoft.com...
>I have the following very simple code block that I wrote for a chart.
> public function bdr_chartcolor(xType as string) as string
> IF xType = "IR"
> return "White"
> ELSE
> return "Blue"
> END IF
> end function
> HOW and WHERE do I implement it to set the charts background color? Many
> properties of objects have EXPRESSION as an option, HOWEVER, there is no
> EXPRESSION as a type for a chart's background color in the properties.|||Sorry,
plot area, fill.
There are two, the area outside the chart plot area and the area inside the
chart plot area.
Use Code.bdf_chartcolor(...) in the expression editor.
"MSSQLServerDeveloper" <MSSQLServerDeveloper@.discussions.microsoft.com>
wrote in message news:22B72235-5282-4095-951F-9B9DCF89E0B3@.microsoft.com...
>I have the following very simple code block that I wrote for a chart.
> public function bdr_chartcolor(xType as string) as string
> IF xType = "IR"
> return "White"
> ELSE
> return "Blue"
> END IF
> end function
> HOW and WHERE do I implement it to set the charts background color? Many
> properties of objects have EXPRESSION as an option, HOWEVER, there is no
> EXPRESSION as a type for a chart's background color in the properties.

Friday, February 17, 2012

Custom Assemblies and Accessing report parameters

I am trying to access the datasource's parameters (connection string etc) via
the report, and passing these parameters to a custom assembly at the end of
the report, with the intention of firing off a stored procedure from this
assembly.
The assembly is done, but the connection string is hard coded.
Is there anyway of accessing these parameters direct from the report, or an
interface I can implement to achieve this?Please see my response on your other thread with the same title.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Benugo" <Benugo@.discussions.microsoft.com> wrote in message
news:F65A3AB4-D2FB-456A-8BE3-BD24CD50E5B2@.microsoft.com...
> I am trying to access the datasource's parameters (connection string etc)
via
> the report, and passing these parameters to a custom assembly at the end
of
> the report, with the intention of firing off a stored procedure from this
> assembly.
> The assembly is done, but the connection string is hard coded.
> Is there anyway of accessing these parameters direct from the report, or
an
> interface I can implement to achieve this?

Custom assemblies and accessing report parameters

I am trying to access the datasource parameters (connection string etc)
through the report with the intention of using them to fire off a stored
procedure at the end of the report. The parameters will be passed to a custom
assembly will execute the sp to update several status flags in the database.
The assembly is done and updates the status parameters, however the
connection string is currently hard coded.
Is there any way to access these parameters direct from the report, or an
interface I could implement in my assembly that would allow me access to them?Please see my response on your other thread with the same title.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Benugo" <Benugo@.discussions.microsoft.com> wrote in message
news:484BE97E-55FF-456B-94C7-C7AECE733CF1@.microsoft.com...
> I am trying to access the datasource parameters (connection string etc)
> through the report with the intention of using them to fire off a stored
> procedure at the end of the report. The parameters will be passed to a
custom
> assembly will execute the sp to update several status flags in the
database.
> The assembly is done and updates the status parameters, however the
> connection string is currently hard coded.
> Is there any way to access these parameters direct from the report, or an
> interface I could implement in my assembly that would allow me access to
them?

Custom Assemblies and accessing report connection parameters

I am trying to access the datasource connection properties (connection string
etc) from a report -I will be accessing the information via a custom
assembly, or passing it to a custom assembly with a view to firing a stored
procedure at the end of the report in order to update a number of status
flags including the last page number of a report. The custom assmbly's done,
but has a hard coded connection string - I need to get at the reports
connection string so I fire the sp in the same db as the report's bound to.
Is there any way of accessing this information direct from the report or an
interface I can implement to retrieve it?No, you cannot access this information on RS 2000. The closest you can get
to have this configurable is to add a hidden parameter (requires RS 2000
SP1) and pass this parameter to the custom assembly.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Benugo" <Benugo@.discussions.microsoft.com> wrote in message
news:DBEF289F-B31A-4318-86C0-303AFC35E5A0@.microsoft.com...
> I am trying to access the datasource connection properties (connection
string
> etc) from a report -I will be accessing the information via a custom
> assembly, or passing it to a custom assembly with a view to firing a
stored
> procedure at the end of the report in order to update a number of status
> flags including the last page number of a report. The custom assmbly's
done,
> but has a hard coded connection string - I need to get at the reports
> connection string so I fire the sp in the same db as the report's bound
to.
> Is there any way of accessing this information direct from the report or
an
> interface I can implement to retrieve it?