Showing posts with label custom. Show all posts
Showing posts with label custom. Show all posts

Sunday, March 25, 2012

Access chart Palette color set in custom code

Hi, all. I am doing a pie chart, to display the market value for each asset type. I couldn't put the market value and asset type together in the legend, so I create another table behind the pie chart. Since I want to use the table to replace the legend of pie chart, I plan to put a retangle with same color of each asset type in the pie chart. How can I use the Palette color serizes like Excel, Earth Tone, Pastel in the assemble custom code?

I recommend to just define your own color palette and use it in both the chart and the custom table legend. Check this blog article for an example and explanations: http://blogs.msdn.com/bwelcker/archive/2005/05/20/420349.aspx

-- Robert

|||Thanks, Robert. It helps

Access chart Palette color set in custom code

Hi, all. I am doing a pie chart, to display the market value for each asset type. I couldn't put the market value and asset type together in the legend, so I create another table behind the pie chart. Since I want to use the table to replace the legend of pie chart, I plan to put a retangle with same color of each asset type in the pie chart. How can I use the Palette color serizes like Excel, Earth Tone, Pastel in the assemble custom code?

I recommend to just define your own color palette and use it in both the chart and the custom table legend. Check this blog article for an example and explanations: http://blogs.msdn.com/bwelcker/archive/2005/05/20/420349.aspx

-- Robert

|||Thanks, Robert. It helps

Sunday, March 11, 2012

Accesing Oracle from an assembly!

Hi Group!
Iâ've a big problem with MS Reporting Services, i try to access an oracle
database from a custom assembly, in desing view all work nice, but in
production environment, the call to the class fail!.
What i can do to correct this problem?
I added the dll file to de bin folder or reportserver and report designer,
but donâ't work.
Really I need help.
Thanks for the helpCarlos,
It sounds like a CAS issue (Code Access Security)
Make sure you define (in the RS Policy file) definitions of the location and
the name of the Custome Assembly DLL's and what Rights you want to assign to
it.
RS provides very limited default "trust" of Custom Assemblies, you'll need
to define specific additions to this to allow access to the database.
Btw: Although it can be done, it's a little unusual to access the database
from a Custom Assembly - I normally see it done as an extension like a data
procesing extension.
HTH
- peteZ
"Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
news:A591ABD5-0838-4B99-88A3-43FBBE27FD49@.microsoft.com...
> Hi Group!
> I've a big problem with MS Reporting Services, i try to access an oracle
> database from a custom assembly, in desing view all work nice, but in
> production environment, the call to the class fail!.
> What i can do to correct this problem?
> I added the dll file to de bin folder or reportserver and report designer,
> but don't work.
> Really I need help.
> Thanks for the help
>|||You will need to assert FullTrust permissions to use the Oracle data
provider from a custom assembly. Below is an example of how to assert full
trust in your custom assembly using an attribute on the method that opens an
Oracle connection:
[PermissionSet(SecurityAction.Assert, Unrestricted=true)]
public foo()
{
// your code
strConn = "Data Source=TSD01;User ID=SchemaName;password=password;";
OracleConnection cn = new OracleConnection(strConn);
cn.Open();
// ...
}
Note: in addition to changing the code in the custom assembly, you will need
to modify the code policy config files to give your custom assembly full
trust permissions.
http://msdn.microsoft.com/library/?url=/library/en-us/dnsql2k/html/dngrfCodeAccessSecurityInSQLServer2000ReportingServices.asp
There is a reason why you will need to assert FullTrust permissions: If you
read the MSDN documentation for the OraclePermission class and the
SqlClientPermission class and compare them, you will notice the following
statement:
"This class [i.e. OraclePermission] is intended for future use when the .NET
Framework Data Provider for Oracle is enabled for partial trust scenarios.
The provider currently requires FullTrust permission."
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdataoracleclientoraclepermissionclasstopic.asp
I.e. asserting the OraclePermission won't help you get around the Security
exception, because the .NET data provider for Oracle _must_ have full trust
and does not work in a partially trusted environment. This is inherit to the
current design of the data provider and the Oracle client. Note: The managed
provider for SQL Server is enabled for partial trust scenarios, therefore it
is sufficient (and advisable) to just assert the SqlClientPermission when
using it in custom assemblies.
HTH,
--
Robert M. Bruckner
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"PeteZ" <peteZ@.aol.com> wrote in message
news:OyiJok40EHA.3584@.TK2MSFTNGP11.phx.gbl...
> Carlos,
> It sounds like a CAS issue (Code Access Security)
> Make sure you define (in the RS Policy file) definitions of the location
and
> the name of the Custome Assembly DLL's and what Rights you want to assign
to
> it.
> RS provides very limited default "trust" of Custom Assemblies, you'll need
> to define specific additions to this to allow access to the database.
> Btw: Although it can be done, it's a little unusual to access the database
> from a Custom Assembly - I normally see it done as an extension like a
data
> procesing extension.
> HTH
> - peteZ
>
> "Carlos López." <CarlosLpez@.discussions.microsoft.com> wrote in message
> news:A591ABD5-0838-4B99-88A3-43FBBE27FD49@.microsoft.com...
> > Hi Group!
> >
> > I've a big problem with MS Reporting Services, i try to access an oracle
> > database from a custom assembly, in desing view all work nice, but in
> > production environment, the call to the class fail!.
> > What i can do to correct this problem?
> >
> > I added the dll file to de bin folder or reportserver and report
designer,
> > but don't work.
> >
> > Really I need help.
> >
> > Thanks for the help
> >
>

Sunday, February 12, 2012

About extended stored procedures

Hi,
I have such situation:
A function that make some custom translation of numbers (convert numbers to
text). I have this function in DLL. I want to use that function in my
selects like that:
SELECT SOME_NUMBER, xp_transfunc(SOME_NUMBER) AS SOME_NUMBER_AS_TEXT
FROM SOME_TABLE
What are my options? Extended stored procedure? Something else? I know that
Extended stored procedures are function in external DLL that meet some
requirements, but can I use Extended stored procedure in such way?
TIA,
Miro.Hi Miro.
You can't call an xp_ directly in a set based call like that.
To do a set based call against an external library, you'd wrap the library
in a udf(), but calls to the xp_ will be serialized so performance might not
be too thrilling, depending on the number of rows in the select & the amount
of work / efficiency of the xp_.
If the custom logic isn't too complex, you might consider consider
converting to a t-sql udf() as this would give you the best performance, if
that's important to you..
HTH
Regards,
Greg Linwood
SQL Server MVP
"Miro Penchev" <miroslav.penchev@.bsc.bg> wrote in message
news:opr1pl4riy12pphn@.msnews.microsoft.com...
> Hi,
> I have such situation:
> A function that make some custom translation of numbers (convert numbers
to
> text). I have this function in DLL. I want to use that function in my
> selects like that:
> SELECT SOME_NUMBER, xp_transfunc(SOME_NUMBER) AS SOME_NUMBER_AS_TEXT
> FROM SOME_TABLE
> What are my options? Extended stored procedure? Something else? I know
that
> Extended stored procedures are function in external DLL that meet some
> requirements, but can I use Extended stored procedure in such way?
> TIA,
> Miro.|||There are only extended stored procedures and you would need to use EXEC to
call them. This sort of syntax is currently not supported for extended
stored procedures. Even if you call extended stored procedures from
functions, you have many restrictions there.
--
HTH,
SriSamp
Please reply to the whole group only!
http://www32.brinkster.com/srisamp
"Miro Penchev" <miroslav.penchev@.bsc.bg> wrote in message
news:opr1pl4riy12pphn@.msnews.microsoft.com...
> Hi,
> I have such situation:
> A function that make some custom translation of numbers (convert numbers
to
> text). I have this function in DLL. I want to use that function in my
> selects like that:
> SELECT SOME_NUMBER, xp_transfunc(SOME_NUMBER) AS SOME_NUMBER_AS_TEXT
> FROM SOME_TABLE
> What are my options? Extended stored procedure? Something else? I know
that
> Extended stored procedures are function in external DLL that meet some
> requirements, but can I use Extended stored procedure in such way?
> TIA,
> Miro.|||For now you should use a UDF. When YUKON comes out, you can make your UDF in
ainy dot net language... today your UDF must be written in T-SQL...
Another thing you might consider is writing a com object then using
sp_oacreate in a function to invoke it, but performance ( I suspect) would
not be as good as if you had written the UDF directly ONLY using T-SQL
--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Miro Penchev" <miroslav.penchev@.bsc.bg> wrote in message
news:opr1pl4riy12pphn@.msnews.microsoft.com...
> Hi,
> I have such situation:
> A function that make some custom translation of numbers (convert numbers
to
> text). I have this function in DLL. I want to use that function in my
> selects like that:
> SELECT SOME_NUMBER, xp_transfunc(SOME_NUMBER) AS SOME_NUMBER_AS_TEXT
> FROM SOME_TABLE
> What are my options? Extended stored procedure? Something else? I know
that
> Extended stored procedures are function in external DLL that meet some
> requirements, but can I use Extended stored procedure in such way?
> TIA,
> Miro.|||On Tue, 13 Jan 2004 21:55:34 +1100
"Greg Linwood" <g_linwoodQhotmail.com> wrote:
> Hi Miro.
> You can't call an xp_ directly in a set based call like that.
> To do a set based call against an external library, you'd wrap the library
> in a udf(), but calls to the xp_ will be serialized so performance might not
> be too thrilling, depending on the number of rows in the select & the amount
> of work / efficiency of the xp_.
> If the custom logic isn't too complex, you might consider consider
> converting to a t-sql udf() as this would give you the best performance, if
> that's important to you..
The performance is not important in my case because that function will be used in SELECTs with small number of rows in result set (in most cases with only one row in result set). And the logic is complex enough to have that logic in two sources - one in SQL and one in my source. So I will made it with xp_.
Thanks again for your help,
Miro.|||On Tue, 13 Jan 2004 06:24:04 -0500
"Wayne Snyder" <wsnyder@.computeredservices.com> wrote:
> For now you should use a UDF. When YUKON comes out, you can make your UDF in
> ainy dot net language...
:) Ooo god - no! The 'dot net' is the BIG mistake in world of programming for last 20 years ;).
> today your UDF must be written in T-SQL...
> Another thing you might consider is writing a com object then using
> sp_oacreate in a function to invoke it, but performance ( I suspect) would
> not be as good as if you had written the UDF directly ONLY using T-SQL
I prefer to do it in xp_ and make wrapper for it in UDF (see my other post in that thread). Logic inside is too complex to have two sources to maintain - one in T_SQL and one in my source (Delphi source actually).
10x,
Miro.

About extended stored procedures

Hi,
I have such situation:
A function that make some custom translation of numbers (convert numbers to
text). I have this function in DLL. I want to use that function in my
selects like that:
SELECT SOME_NUMBER, xp_transfunc(SOME_NUMBER) AS SOME_NUMBER_AS_TEXT
FROM SOME_TABLE
What are my options? Extended stored procedure? Something else? I know that
Extended stored procedures are function in external DLL that meet some
requirements, but can I use Extended stored procedure in such way?
TIA,
Miro.Hi Miro.
You can't call an xp_ directly in a set based call like that.
To do a set based call against an external library, you'd wrap the library
in a udf(), but calls to the xp_ will be serialized so performance might not
be too thrilling, depending on the number of rows in the select & the amount
of work / efficiency of the xp_.
If the custom logic isn't too complex, you might consider consider
converting to a t-sql udf() as this would give you the best performance, if
that's important to you..
HTH
Regards,
Greg Linwood
SQL Server MVP
"Miro Penchev" <miroslav.penchev@.bsc.bg> wrote in message
news:opr1pl4riy12pphn@.msnews.microsoft.com...
quote:

> Hi,
> I have such situation:
> A function that make some custom translation of numbers (convert numbers

to
quote:

> text). I have this function in DLL. I want to use that function in my
> selects like that:
> SELECT SOME_NUMBER, xp_transfunc(SOME_NUMBER) AS SOME_NUMBER_AS_TEXT
> FROM SOME_TABLE
> What are my options? Extended stored procedure? Something else? I know

that
quote:

> Extended stored procedures are function in external DLL that meet some
> requirements, but can I use Extended stored procedure in such way?
> TIA,
> Miro.
|||There are only extended stored procedures and you would need to use EXEC to
call them. This sort of syntax is currently not supported for extended
stored procedures. Even if you call extended stored procedures from
functions, you have many restrictions there.
--
HTH,
SriSamp
Please reply to the whole group only!
http://www32.brinkster.com/srisamp
"Miro Penchev" <miroslav.penchev@.bsc.bg> wrote in message
news:opr1pl4riy12pphn@.msnews.microsoft.com...
quote:

> Hi,
> I have such situation:
> A function that make some custom translation of numbers (convert numbers

to
quote:

> text). I have this function in DLL. I want to use that function in my
> selects like that:
> SELECT SOME_NUMBER, xp_transfunc(SOME_NUMBER) AS SOME_NUMBER_AS_TEXT
> FROM SOME_TABLE
> What are my options? Extended stored procedure? Something else? I know

that
quote:

> Extended stored procedures are function in external DLL that meet some
> requirements, but can I use Extended stored procedure in such way?
> TIA,
> Miro.
|||For now you should use a UDF. When YUKON comes out, you can make your UDF in
ainy dot net language... today your UDF must be written in T-SQL...
Another thing you might consider is writing a com object then using
sp_oacreate in a function to invoke it, but performance ( I suspect) would
not be as good as if you had written the UDF directly ONLY using T-SQL
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Miro Penchev" <miroslav.penchev@.bsc.bg> wrote in message
news:opr1pl4riy12pphn@.msnews.microsoft.com...
quote:

> Hi,
> I have such situation:
> A function that make some custom translation of numbers (convert numbers

to
quote:

> text). I have this function in DLL. I want to use that function in my
> selects like that:
> SELECT SOME_NUMBER, xp_transfunc(SOME_NUMBER) AS SOME_NUMBER_AS_TEXT
> FROM SOME_TABLE
> What are my options? Extended stored procedure? Something else? I know

that
quote:

> Extended stored procedures are function in external DLL that meet some
> requirements, but can I use Extended stored procedure in such way?
> TIA,
> Miro.
|||On Tue, 13 Jan 2004 21:55:34 +1100
"Greg Linwood" <g_linwoodQhotmail.com> wrote:
quote:

> Hi Miro.
> You can't call an xp_ directly in a set based call like that.
> To do a set based call against an external library, you'd wrap the library
> in a udf(), but calls to the xp_ will be serialized so performance might n
ot
> be too thrilling, depending on the number of rows in the select & the amou
nt
> of work / efficiency of the xp_.
> If the custom logic isn't too complex, you might consider consider
> converting to a t-sql udf() as this would give you the best performance, i
f
> that's important to you..

The performance is not important in my case because that function will be us
ed in SELECTs with small number of rows in result set (in most cases with on
ly one row in result set). And the logic is complex enough to have that logi
c in two sources - one in S
QL and one in my source. So I will made it with xp_.
Thanks again for your help,
Miro.|||On Tue, 13 Jan 2004 06:24:04 -0500
"Wayne Snyder" <wsnyder@.computeredservices.com> wrote:
quote:

> For now you should use a UDF. When YUKON comes out, you can make your UDF
in
> ainy dot net language...

Ooo god - no! The 'dot net' is the BIG mistake in world of programming fo
r last 20 years ;).
quote:

> today your UDF must be written in T-SQL...
> Another thing you might consider is writing a com object then using
> sp_oacreate in a function to invoke it, but performance ( I suspect) would
> not be as good as if you had written the UDF directly ONLY using T-SQL

I prefer to do it in xp_ and make wrapper for it in UDF (see my other post i
n that thread). Logic inside is too complex to have two sources to maintain
- one in T_SQL and one in my source (Delphi source actually).
10x,
Miro.

Saturday, February 11, 2012

About dynamic URL link

I want the URL link to be generated dynamically by a function written in a
custom assembly. However instead of generating the link each time the link is
clicked. The function only called once when the report is generated.
Therefore that link always return the same value. How can i implement this?
Thank you veru much.You can put per-report initialization in the OnInit() event in the Code
property of the report.
--
This post is provided 'AS IS' with no warranties, and confers no rights. All
rights reserved. Some assembly required. Batteries not included. Your
mileage may vary. Objects in mirror may be closer than they appear. No user
serviceable parts inside. Opening cover voids warranty. Keep out of reach of
children under 3.
"mcngan" <mcngan@.discussions.microsoft.com> wrote in message
news:16560A52-A252-4796-AAA3-CE8755473631@.microsoft.com...
> I want the URL link to be generated dynamically by a function written in a
> custom assembly. However instead of generating the link each time the link
is
> clicked. The function only called once when the report is generated.
> Therefore that link always return the same value. How can i implement
this?
> Thank you veru much.

Thursday, February 9, 2012

About Custom SiteMapProvider

Hi,

i used the custom sqlsitemapprovider which is in this web :http://msdn.microsoft.com/msdnmag/issues/06/02/wickedcode/default.aspx?loc=&fig=true#fig5 but in this sample they used sqlsitemapprovider as a default sitemapprovider i dont wanna use it as a default and i wanna send a paramater which is used to filter datas to that class. I modified that class and i can take a sitemapprovider back and i wanna show it a sitemappath data source programmaticaly. i wanna create an instance object of sitemappath datasource and i wanna bind it to that class and then i wanna add a treeview control to the page then i wanna bind it to the sitemapdatasource programmaticaly too..

Thanks for your attetion.

Regards...

Ok i made it

if you wanna learn how i made it :

just write them written below in the specified area :

in web.config:

<connectionStrings>
<add name="SiteMapConnectionString" connectionString="Data Source=.;Initial Catalog=Sorular;Integrated Security=True;Pooling=False" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<caching>
<sqlCacheDependency enabled="true"/>
</caching>
<siteMap>
<providers>
<add name="SiteMapBenYazdim" type="SqlSiteMapProvider" connectionStringName="SiteMapConnectionString"></add>
</providers>
</siteMap
codebehind:
SiteMapDataSource data = new SiteMapDataSource();
data.SiteMapProvider = "SiteMapBenYazdim";
TreeView1.DataSource = data;
TreeNodeBinding bind = new TreeNodeBinding();
bind.TextField = "Title";
bind.ToolTipField = "Description";
bind.ValueField = "Url";
bind.SelectAction = TreeNodeSelectAction.SelectExpand;
TreeView1.DataBindings.Add(bind);

That it man.i have been working on that damn thing about 2 days. And thanks God finally i made it..

|||SqlSiteMapProvider sitemap =newSqlSiteMapProvider();SiteMapDataSource treeVeriTabani =newSiteMapDataSource();

treeVeriTabani.Provider = sitemap;

TreeKonular.DataSource = treeVeriTabani;

TreeNodeBinding alanlar =newTreeNodeBinding();

alanlar.TextField ="Title";

alanlar.ValueField ="Url";

alanlar.ToolTipField ="Title";

alanlar.SelectAction =TreeNodeSelectAction.SelectExpand;

TreeKonular.DataBindings.Add(alanlar);

Page.DataBind();

Ok thats itSmile