Showing posts with label path. Show all posts
Showing posts with label path. Show all posts

Monday, March 26, 2012

How to fire off a report and save it as pdf...

Using vb.net, does anyone know or has anyone fired off a sql report, save it as PDF to a defined path?

I am knew to sql reporting services and the help files are not very helpfile.

Any sample code would be helpful.

Thanks

Hello,

Have a look at the sample code on this page:

http://msdn2.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsexecutionservice2005.reportexecutionservice.render.aspx

Specify the export format you want (in your case "PDF") as a parameter to the Render method.

-Chris

|||

I looked at the sample code, how ever, not sure where the references are to things like

"ReportExecutionService" and some of the other objects.

WHich .net items do I need to import?

Daryl

|||In your project you need add a web reference to the reportexecution service. this will create a proxy class that you an instantiate in code to call the web service|||does it matter that I am NOT building a web application? Building a Desktop vb.net exe.|||no it doesn't matter|||

I cannot find this reference. I looked in windows and system...

|||Right-click your project and select "Add Web Reference"|||

Hi Adam,

The post and the replies are really useful. Thanks a lot for the help...

Adam, the URL "http://localhost/reportserver/reportexecution2005.asmx" needs to be a working one or are we giving a dummy value?

Thanks in advance for the help....

Sudhiiiii...

|||Replace "localhost" with the name of your reports server.|||

Hi,

First of all thanks for the reply.

I tried the above stated method and the URL for my system was "http://localhost/reportserver$sqlserver/reportexecution2005.asmx".

As i'm developing a Windows application solution, i hasn't deployed any of my reports in the specified URL or any other.

I tried to add the URL as a Web reference its saying the URL doesnot contain any web service.

I tried to browse the URL manually, its saying that there is an authentication problem, and user "systemname\ASPNet" is unable to connect to the Database.I went to Sql server and given all the rights to 'aspnet" user , which was a normal user previously.In IIS i tried giving anonyous rights as well as windows integrated user for the virtual directory .My DB is having full rights, and working on integrated user while using the forms.

still the problem persists.

1) is the problem in SQL server or IIS or windows...?

2)Does this has any relation to 'ASP.Net state service' service in windows

3) will me publishing the reorts in iis server will solve the issue. I should have tried this but i'm a too newbie in this and i need to search for how to do that...

Please do help...... Thanks in advance......

Sudhiiii....

|||

Sudeesh,

If you are developing a windows application then you should use the ReportViewer control. This can be used in one of 2 modes:

local mode: the report files are saved as RDLC and stored in the application directory (no report server required)

server mode: where the control connects to a report server and displays shared reports. For this reports need to deployed tot he server.

|||

Hi Adam,

Thanks a lot for the reply...

I should have told my problem in detail...

Let me do that now..

I'm creating a windows application With Vb2005 and Sql 2005 express editions.
The basic point is to create 5 reports from the data in sql tables, each one having several subreports. These reports have to be exported to Excel as there was a VBA application on Excel previously.Currently I'm able to manually save each report as an individual file and later open five excel files move/copy them into one file and then save the excel.I want to automate the task using code such that for the end user it should be like, one button pressed and five reports are saved to excel file... The issue is that i'm able to save at least a report to an excel file manually only, not using code.

Once i'm able to save one report by code we can bundle all of them into one workbook.

To view the report I'm using Reportviewer control but i'm not able to save it.

I hope i made it clear....

Sudhiiiii...

sql

Friday, March 23, 2012

How to fire off a report and save it as pdf...

Using vb.net, does anyone know or has anyone fired off a sql report, save it as PDF to a defined path?

I am knew to sql reporting services and the help files are not very helpfile.

Any sample code would be helpful.

Thanks

Hello,

Have a look at the sample code on this page:

http://msdn2.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsexecutionservice2005.reportexecutionservice.render.aspx

Specify the export format you want (in your case "PDF") as a parameter to the Render method.

-Chris

|||

I looked at the sample code, how ever, not sure where the references are to things like

"ReportExecutionService" and some of the other objects.

WHich .net items do I need to import?

Daryl

|||In your project you need add a web reference to the reportexecution service. this will create a proxy class that you an instantiate in code to call the web service|||does it matter that I am NOT building a web application? Building a Desktop vb.net exe.|||no it doesn't matter|||

I cannot find this reference. I looked in windows and system...

|||Right-click your project and select "Add Web Reference"|||

Hi Adam,

The post and the replies are really useful. Thanks a lot for the help...

Adam, the URL "http://localhost/reportserver/reportexecution2005.asmx" needs to be a working one or are we giving a dummy value?

Thanks in advance for the help....

Sudhiiiii...

|||Replace "localhost" with the name of your reports server.|||

Hi,

First of all thanks for the reply.

I tried the above stated method and the URL for my system was "http://localhost/reportserver$sqlserver/reportexecution2005.asmx".

As i'm developing a Windows application solution, i hasn't deployed any of my reports in the specified URL or any other.

I tried to add the URL as a Web reference its saying the URL doesnot contain any web service.

I tried to browse the URL manually, its saying that there is an authentication problem, and user "systemname\ASPNet" is unable to connect to the Database.I went to Sql server and given all the rights to 'aspnet" user , which was a normal user previously.In IIS i tried giving anonyous rights as well as windows integrated user for the virtual directory .My DB is having full rights, and working on integrated user while using the forms.

still the problem persists.

1) is the problem in SQL server or IIS or windows...?

2)Does this has any relation to 'ASP.Net state service' service in windows

3) will me publishing the reorts in iis server will solve the issue. I should have tried this but i'm a too newbie in this and i need to search for how to do that...

Please do help...... Thanks in advance......

Sudhiiii....

|||

Sudeesh,

If you are developing a windows application then you should use the ReportViewer control. This can be used in one of 2 modes:

local mode: the report files are saved as RDLC and stored in the application directory (no report server required)

server mode: where the control connects to a report server and displays shared reports. For this reports need to deployed tot he server.

|||

Hi Adam,

Thanks a lot for the reply...

I should have told my problem in detail...

Let me do that now..

I'm creating a windows application With Vb2005 and Sql 2005 express editions.
The basic point is to create 5 reports from the data in sql tables, each one having several subreports. These reports have to be exported to Excel as there was a VBA application on Excel previously.Currently I'm able to manually save each report as an individual file and later open five excel files move/copy them into one file and then save the excel.I want to automate the task using code such that for the end user it should be like, one button pressed and five reports are saved to excel file... The issue is that i'm able to save at least a report to an excel file manually only, not using code.

Once i'm able to save one report by code we can bundle all of them into one workbook.

To view the report I'm using Reportviewer control but i'm not able to save it.

I hope i made it clear....

Sudhiiiii...

How to fire off a report and save it as pdf...

Using vb.net, does anyone know or has anyone fired off a sql report, save it as PDF to a defined path?

I am knew to sql reporting services and the help files are not very helpfile.

Any sample code would be helpful.

Thanks

Hello,

Have a look at the sample code on this page:

http://msdn2.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsexecutionservice2005.reportexecutionservice.render.aspx

Specify the export format you want (in your case "PDF") as a parameter to the Render method.

-Chris

|||

I looked at the sample code, how ever, not sure where the references are to things like

"ReportExecutionService" and some of the other objects.

WHich .net items do I need to import?

Daryl

|||In your project you need add a web reference to the reportexecution service. this will create a proxy class that you an instantiate in code to call the web service|||does it matter that I am NOT building a web application? Building a Desktop vb.net exe.|||no it doesn't matter|||

I cannot find this reference. I looked in windows and system...

|||Right-click your project and select "Add Web Reference"|||

Hi Adam,

The post and the replies are really useful. Thanks a lot for the help...

Adam, the URL "http://localhost/reportserver/reportexecution2005.asmx" needs to be a working one or are we giving a dummy value?

Thanks in advance for the help....

Sudhiiiii...

|||Replace "localhost" with the name of your reports server.|||

Hi,

First of all thanks for the reply.

I tried the above stated method and the URL for my system was "http://localhost/reportserver$sqlserver/reportexecution2005.asmx".

As i'm developing a Windows application solution, i hasn't deployed any of my reports in the specified URL or any other.

I tried to add the URL as a Web reference its saying the URL doesnot contain any web service.

I tried to browse the URL manually, its saying that there is an authentication problem, and user "systemname\ASPNet" is unable to connect to the Database.I went to Sql server and given all the rights to 'aspnet" user , which was a normal user previously.In IIS i tried giving anonyous rights as well as windows integrated user for the virtual directory .My DB is having full rights, and working on integrated user while using the forms.

still the problem persists.

1) is the problem in SQL server or IIS or windows...?

2)Does this has any relation to 'ASP.Net state service' service in windows

3) will me publishing the reorts in iis server will solve the issue. I should have tried this but i'm a too newbie in this and i need to search for how to do that...

Please do help...... Thanks in advance......

Sudhiiii....

|||

Sudeesh,

If you are developing a windows application then you should use the ReportViewer control. This can be used in one of 2 modes:

local mode: the report files are saved as RDLC and stored in the application directory (no report server required)

server mode: where the control connects to a report server and displays shared reports. For this reports need to deployed tot he server.

|||

Hi Adam,

Thanks a lot for the reply...

I should have told my problem in detail...

Let me do that now..

I'm creating a windows application With Vb2005 and Sql 2005 express editions.
The basic point is to create 5 reports from the data in sql tables, each one having several subreports. These reports have to be exported to Excel as there was a VBA application on Excel previously.Currently I'm able to manually save each report as an individual file and later open five excel files move/copy them into one file and then save the excel.I want to automate the task using code such that for the end user it should be like, one button pressed and five reports are saved to excel file... The issue is that i'm able to save at least a report to an excel file manually only, not using code.

Once i'm able to save one report by code we can bundle all of them into one workbook.

To view the report I'm using Reportviewer control but i'm not able to save it.

I hope i made it clear....

Sudhiiiii...

Wednesday, March 21, 2012

how to find the windows path of custom assembly using c# code?

I am using a custom assembly. My assembly has to read a particular file and
take some values from it. I set the required permissions and everything works
good. However I dont want to hardcode the location of my text file. I decided
to put the text file in the same location as dll file i.e in ..\Program
Files\Reporting Services\ReportServer\bin folder and thought of finding the
path in my class library using something like
String pathval=System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
But this method always gives me #Error in my report expression. I also tried
by removing all other code and just returning the path. Also if I try to
return System.Reflection.Assembly.GetExecutingAssembly().FullName; it works
good. I am totally confused as how one property will work and another one
does not. Is there anything I am missing like setting some reference or
changing some permission etc.
I want to know the location of the dll i.e windows path(C:\Program
Files\Reporting Services\ReportServer\bin) using c# code which will work with
reporting services.
Thanks in advance.Probably the exception you are getting is FileIOPermission. If you look at
the Assembly.CodeBase Property topic in BOL, you will see that it requires
FileIOPermission. To confirm this, disable CAS in RS (comment the
<securityPolicy> element in Report Server web.config) and see if it will
execute fine.
See
http://groups.google.com/group/microsoft.public.sqlserver.reportingsvcs/browse_frm/thread/2bd7a109fd6dbe4b/df80503c4773a1b0?lnk=st&q=fileiopermission+assert+group%3A*.reportingsvcs&rnum=1&hl=en#df80503c4773a1b0
or increase the expression CAS policy to FullTrust by changing the
MyComputer GodeGroup in rssrvpolicy.config as follows
<CodeGroup
class="FirstMatchCodeGroup"
version="1"
PermissionSetName="FullTrust"
Description="This code group grants
MyComputer code Execution permission. ">
<IMembershipCondition
class="ZoneMembershipCondition"
version="1"
Zone="MyComputer" />
--
HTH,
---
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
---
"msdnuser" <ringt@.nospam.nospam> wrote in message
news:3469D9D8-469F-4A2C-A7D9-A3CE022FCE72@.microsoft.com...
> I am using a custom assembly. My assembly has to read a particular file
> and
> take some values from it. I set the required permissions and everything
> works
> good. However I dont want to hardcode the location of my text file. I
> decided
> to put the text file in the same location as dll file i.e in ..\Program
> Files\Reporting Services\ReportServer\bin folder and thought of finding
> the
> path in my class library using something like
> String pathval=System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
> But this method always gives me #Error in my report expression. I also
> tried
> by removing all other code and just returning the path. Also if I try to
> return System.Reflection.Assembly.GetExecutingAssembly().FullName; it
> works
> good. I am totally confused as how one property will work and another one
> does not. Is there anything I am missing like setting some reference or
> changing some permission etc.
> I want to know the location of the dll i.e windows path(C:\Program
> Files\Reporting Services\ReportServer\bin) using c# code which will work
> with
> reporting services.
> Thanks in advance.
>
>|||Thanks for Teo's inputs,
Hi Ringt,
I think you can try checking the CAS permission as Teo suggested first. To
temporarly turn off .NET code access security, we can also execute the:
caspol -s off under the VS.NET command console.....
In addition, as for getting assembly path, we don't quite suggest use
codebase since this is not always correctly in some certain scenario (when
assemblies are added into GAC and the original path not in application's
directory...). I think you can also try
AppDomain.BaseDirectory , this will return the base physical location of
our application(if we execute it on the main appdomain......)..
Thanks,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
| From: "Teo Lachev [MVP]" <teo.lachev@.nospam.prologika.com>
| References: <3469D9D8-469F-4A2C-A7D9-A3CE022FCE72@.microsoft.com>
| Subject: Re: how to find the windows path of custom assembly using c#
code?
| Date: Tue, 13 Dec 2005 16:27:58 -0500
| Lines: 67
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <e5Y7SwCAGHA.3864@.tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.sqlserver.reportingsvcs
| NNTP-Posting-Host: mail01-ips.ips-sendero.com 12.163.123.194
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.reportingsvcs:64985
| X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
|
| Probably the exception you are getting is FileIOPermission. If you look
at
| the Assembly.CodeBase Property topic in BOL, you will see that it
requires
| FileIOPermission. To confirm this, disable CAS in RS (comment the
| <securityPolicy> element in Report Server web.config) and see if it will
| execute fine.
|
| See
|
http://groups.google.com/group/microsoft.public.sqlserver.reportingsvcs/brow
se_frm/thread/2bd7a109fd6dbe4b/df80503c4773a1b0?lnk=st&q=fileiopermission+as
sert+group%3A*.reportingsvcs&rnum=1&hl=en#df80503c4773a1b0
|
| or increase the expression CAS policy to FullTrust by changing the
| MyComputer GodeGroup in rssrvpolicy.config as follows
| <CodeGroup
| class="FirstMatchCodeGroup"
| version="1"
| PermissionSetName="FullTrust"
| Description="This code group grants
| MyComputer code Execution permission. ">
| <IMembershipCondition
| class="ZoneMembershipCondition"
| version="1"
| Zone="MyComputer" />
|
| --
| HTH,
| ---
| Teo Lachev, MVP, MCSD, MCT
| "Microsoft Reporting Services in Action"
| "Applied Microsoft Analysis Services 2005"
| Home page and blog: http://www.prologika.com/
|
| ---
| "msdnuser" <ringt@.nospam.nospam> wrote in message
| news:3469D9D8-469F-4A2C-A7D9-A3CE022FCE72@.microsoft.com...
| >
| > I am using a custom assembly. My assembly has to read a particular file
| > and
| > take some values from it. I set the required permissions and everything
| > works
| > good. However I dont want to hardcode the location of my text file. I
| > decided
| > to put the text file in the same location as dll file i.e in ..\Program
| > Files\Reporting Services\ReportServer\bin folder and thought of finding
| > the
| > path in my class library using something like
| >
| > String
pathval=System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
| >
| > But this method always gives me #Error in my report expression. I also
| > tried
| > by removing all other code and just returning the path. Also if I try to
| > return System.Reflection.Assembly.GetExecutingAssembly().FullName; it
| > works
| > good. I am totally confused as how one property will work and another
one
| > does not. Is there anything I am missing like setting some reference or
| > changing some permission etc.
| >
| > I want to know the location of the dll i.e windows path(C:\Program
| > Files\Reporting Services\ReportServer\bin) using c# code which will
work
| > with
| > reporting services.
| >
| > Thanks in advance.
| >
| >
| >
|
|
||||Hi Teo and Steven,
Thank you both for the replies. I am able to get the executing path of
assembly using System.AppDomain.CurrentDomain.BaseDirectory only if I give
FullTrust permissionset to "MyComputer" and
"Report_Expressions_Default_Permissions" Code Groups. Is there a way I can
reduce the permission and make them work?
Note: I also have my own permission set and code group to give my dll, read
permission to my text file which is not a config file. I am using Reporting
Services 2005.
Thanks,
ringt|||The links I included in my previous post should get you started although in
your case it is like catch-22. You need to grant access to a path which is
known only at runtime. You have to do some reasearch to find if this is
possible at all.
Good luck!
--
HTH,
---
Teo Lachev, MVP, MCSD, MCT
"Microsoft Reporting Services in Action"
"Applied Microsoft Analysis Services 2005"
Home page and blog: http://www.prologika.com/
---
"msdnuser" <ringt@.nospam.nospam> wrote in message
news:8F143CDF-66BE-4E12-AC74-7322855E18E3@.microsoft.com...
> Hi Teo and Steven,
> Thank you both for the replies. I am able to get the executing path of
> assembly using System.AppDomain.CurrentDomain.BaseDirectory only if I give
> FullTrust permissionset to "MyComputer" and
> "Report_Expressions_Default_Permissions" Code Groups. Is there a way I can
> reduce the permission and make them work?
> Note: I also have my own permission set and code group to give my dll,
> read
> permission to my text file which is not a config file. I am using
> Reporting
> Services 2005.
> Thanks,
> ringt
>|||Hi ringt,
I'm afraid grant the sufficient CAS permission is necessary. However, I
agree with you that it's not necessary to grant the FullTrust to
LocalComputer zone... You can choose to adjust the existing PermissionSet
, e.g the "Execution" or add a new named PermissionSet and add those
FileIOPermissions in that PermissionSet. To grant the custom PermssionSet
to your own assembly, you can consider strong-named your assemtly so that
you can grant permissionSet through Strong-named condition.....
So far I haven't found any resource directly describing modifying the
reporting service's security policy file, but there is on good article
discussing customize ASP.NET 2.0 security policys:
#How To: Use Code Access Security in ASP.NET 2.0
http://msdn.microsoft.com/library/en-us/dnpag2/html/paght000017.asp?frame=tr
ue
this article mentioned the similiar ideas on customizing existing security
policy file and add FileIOPermission for certain CodeGroup....
Hope helps. Thanks,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
| From: "Teo Lachev [MVP]" <teo.lachev@.nospam.prologika.com>
| References: <3469D9D8-469F-4A2C-A7D9-A3CE022FCE72@.microsoft.com>
<e5Y7SwCAGHA.3864@.tk2msftngp13.phx.gbl>
<P8Vq8jFAGHA.3764@.TK2MSFTNGXA02.phx.gbl>
<8F143CDF-66BE-4E12-AC74-7322855E18E3@.microsoft.com>
| Subject: Re: how to find the windows path of custom assembly using c#
code?
| Date: Wed, 14 Dec 2005 21:27:19 -0500
| Lines: 38
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <uiwOM8RAGHA.2040@.TK2MSFTNGP14.phx.gbl>
| Newsgroups: microsoft.public.sqlserver.reportingsvcs
| NNTP-Posting-Host: c-66-56-76-188.hsd1.ga.comcast.net 66.56.76.188
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.reportingsvcs:65108
| X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
|
| The links I included in my previous post should get you started although
in
| your case it is like catch-22. You need to grant access to a path which
is
| known only at runtime. You have to do some reasearch to find if this is
| possible at all.
|
| Good luck!
|
| --
| HTH,
| ---
| Teo Lachev, MVP, MCSD, MCT
| "Microsoft Reporting Services in Action"
| "Applied Microsoft Analysis Services 2005"
| Home page and blog: http://www.prologika.com/
|
| ---
| "msdnuser" <ringt@.nospam.nospam> wrote in message
| news:8F143CDF-66BE-4E12-AC74-7322855E18E3@.microsoft.com...
| > Hi Teo and Steven,
| >
| > Thank you both for the replies. I am able to get the executing path of
| > assembly using System.AppDomain.CurrentDomain.BaseDirectory only if I
give
| > FullTrust permissionset to "MyComputer" and
| > "Report_Expressions_Default_Permissions" Code Groups. Is there a way I
can
| > reduce the permission and make them work?
| >
| > Note: I also have my own permission set and code group to give my dll,
| > read
| > permission to my text file which is not a config file. I am using
| > Reporting
| > Services 2005.
| >
| > Thanks,
| > ringt
| >
| >
|
|
||||Hi there,
As Steven mentioned, I have to give fullTrust permission to get the path
during runtime. Even then as Toe have mentioned asserting permissions to a
path known at runtime is not successful to me. It throws me #Error again. Is
there any other way (even by reducing or modifying some permissions) to
implement this?
Expecting your help.
Thanks.
"Steven Cheng[MSFT]" wrote:
> Hi ringt,
> I'm afraid grant the sufficient CAS permission is necessary. However, I
> agree with you that it's not necessary to grant the FullTrust to
> LocalComputer zone... You can choose to adjust the existing PermissionSet
> , e.g the "Execution" or add a new named PermissionSet and add those
> FileIOPermissions in that PermissionSet. To grant the custom PermssionSet
> to your own assembly, you can consider strong-named your assemtly so that
> you can grant permissionSet through Strong-named condition.....
> So far I haven't found any resource directly describing modifying the
> reporting service's security policy file, but there is on good article
> discussing customize ASP.NET 2.0 security policys:
>
> #How To: Use Code Access Security in ASP.NET 2.0
> http://msdn.microsoft.com/library/en-us/dnpag2/html/paght000017.asp?frame=tr
> ue
> this article mentioned the similiar ideas on customizing existing security
> policy file and add FileIOPermission for certain CodeGroup....
>
> Hope helps. Thanks,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
>
> --
> | From: "Teo Lachev [MVP]" <teo.lachev@.nospam.prologika.com>
> | References: <3469D9D8-469F-4A2C-A7D9-A3CE022FCE72@.microsoft.com>
> <e5Y7SwCAGHA.3864@.tk2msftngp13.phx.gbl>
> <P8Vq8jFAGHA.3764@.TK2MSFTNGXA02.phx.gbl>
> <8F143CDF-66BE-4E12-AC74-7322855E18E3@.microsoft.com>
> | Subject: Re: how to find the windows path of custom assembly using c#
> code?
> | Date: Wed, 14 Dec 2005 21:27:19 -0500
> | Lines: 38
> | X-Priority: 3
> | X-MSMail-Priority: Normal
> | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
> | X-RFC2646: Format=Flowed; Original
> | Message-ID: <uiwOM8RAGHA.2040@.TK2MSFTNGP14.phx.gbl>
> | Newsgroups: microsoft.public.sqlserver.reportingsvcs
> | NNTP-Posting-Host: c-66-56-76-188.hsd1.ga.comcast.net 66.56.76.188
> | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14.phx.gbl
> | Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.reportingsvcs:65108
> | X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
> |
> | The links I included in my previous post should get you started although
> in
> | your case it is like catch-22. You need to grant access to a path which
> is
> | known only at runtime. You have to do some reasearch to find if this is
> | possible at all.
> |
> | Good luck!
> |
> | --
> | HTH,
> | ---
> | Teo Lachev, MVP, MCSD, MCT
> | "Microsoft Reporting Services in Action"
> | "Applied Microsoft Analysis Services 2005"
> | Home page and blog: http://www.prologika.com/
> |
> | ---
> | "msdnuser" <ringt@.nospam.nospam> wrote in message
> | news:8F143CDF-66BE-4E12-AC74-7322855E18E3@.microsoft.com...
> | > Hi Teo and Steven,
> | >
> | > Thank you both for the replies. I am able to get the executing path of
> | > assembly using System.AppDomain.CurrentDomain.BaseDirectory only if I
> give
> | > FullTrust permissionset to "MyComputer" and
> | > "Report_Expressions_Default_Permissions" Code Groups. Is there a way I
> can
> | > reduce the permission and make them work?
> | >
> | > Note: I also have my own permission set and code group to give my dll,
> | > read
> | > permission to my text file which is not a config file. I am using
> | > Reporting
> | > Services 2005.
> | >
> | > Thanks,
> | > ringt
> | >
> | >
> |
> |
> |
>|||Hi Teo and Steven,
Please ignore my last reply in this thread. I made a mistake of not
appending my file name after I find the path using
System.AppDomain.CurrentDomain.BaseDirectory. Thus my problem is solved now.
Thank you very much.
"msdnuser" wrote:
> Hi there,
> As Steven mentioned, I have to give fullTrust permission to get the path
> during runtime. Even then as Toe have mentioned asserting permissions to a
> path known at runtime is not successful to me. It throws me #Error again. Is
> there any other way (even by reducing or modifying some permissions) to
> implement this?
> Expecting your help.
> Thanks.
>
> "Steven Cheng[MSFT]" wrote:
> > Hi ringt,
> >
> > I'm afraid grant the sufficient CAS permission is necessary. However, I
> > agree with you that it's not necessary to grant the FullTrust to
> > LocalComputer zone... You can choose to adjust the existing PermissionSet
> > , e.g the "Execution" or add a new named PermissionSet and add those
> > FileIOPermissions in that PermissionSet. To grant the custom PermssionSet
> > to your own assembly, you can consider strong-named your assemtly so that
> > you can grant permissionSet through Strong-named condition.....
> >
> > So far I haven't found any resource directly describing modifying the
> > reporting service's security policy file, but there is on good article
> > discussing customize ASP.NET 2.0 security policys:
> >
> >
> > #How To: Use Code Access Security in ASP.NET 2.0
> > http://msdn.microsoft.com/library/en-us/dnpag2/html/paght000017.asp?frame=tr
> > ue
> >
> > this article mentioned the similiar ideas on customizing existing security
> > policy file and add FileIOPermission for certain CodeGroup....
> >
> >
> > Hope helps. Thanks,
> >
> > Steven Cheng
> > Microsoft Online Support
> >
> > Get Secure! www.microsoft.com/security
> > (This posting is provided "AS IS", with no warranties, and confers no
> > rights.)
> >
> >
> >
> >
> >
> >
> > --
> > | From: "Teo Lachev [MVP]" <teo.lachev@.nospam.prologika.com>
> > | References: <3469D9D8-469F-4A2C-A7D9-A3CE022FCE72@.microsoft.com>
> > <e5Y7SwCAGHA.3864@.tk2msftngp13.phx.gbl>
> > <P8Vq8jFAGHA.3764@.TK2MSFTNGXA02.phx.gbl>
> > <8F143CDF-66BE-4E12-AC74-7322855E18E3@.microsoft.com>
> > | Subject: Re: how to find the windows path of custom assembly using c#
> > code?
> > | Date: Wed, 14 Dec 2005 21:27:19 -0500
> > | Lines: 38
> > | X-Priority: 3
> > | X-MSMail-Priority: Normal
> > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
> > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
> > | X-RFC2646: Format=Flowed; Original
> > | Message-ID: <uiwOM8RAGHA.2040@.TK2MSFTNGP14.phx.gbl>
> > | Newsgroups: microsoft.public.sqlserver.reportingsvcs
> > | NNTP-Posting-Host: c-66-56-76-188.hsd1.ga.comcast.net 66.56.76.188
> > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14.phx.gbl
> > | Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.reportingsvcs:65108
> > | X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
> > |
> > | The links I included in my previous post should get you started although
> > in
> > | your case it is like catch-22. You need to grant access to a path which
> > is
> > | known only at runtime. You have to do some reasearch to find if this is
> > | possible at all.
> > |
> > | Good luck!
> > |
> > | --
> > | HTH,
> > | ---
> > | Teo Lachev, MVP, MCSD, MCT
> > | "Microsoft Reporting Services in Action"
> > | "Applied Microsoft Analysis Services 2005"
> > | Home page and blog: http://www.prologika.com/
> > |
> > | ---
> > | "msdnuser" <ringt@.nospam.nospam> wrote in message
> > | news:8F143CDF-66BE-4E12-AC74-7322855E18E3@.microsoft.com...
> > | > Hi Teo and Steven,
> > | >
> > | > Thank you both for the replies. I am able to get the executing path of
> > | > assembly using System.AppDomain.CurrentDomain.BaseDirectory only if I
> > give
> > | > FullTrust permissionset to "MyComputer" and
> > | > "Report_Expressions_Default_Permissions" Code Groups. Is there a way I
> > can
> > | > reduce the permission and make them work?
> > | >
> > | > Note: I also have my own permission set and code group to give my dll,
> > | > read
> > | > permission to my text file which is not a config file. I am using
> > | > Reporting
> > | > Services 2005.
> > | >
> > | > Thanks,
> > | > ringt
> > | >
> > | >
> > |
> > |
> > |
> >
> >|||You're welcome Ringt,
Also, I didn't mean that we have to grant FullTrust permission , but should
grant whatever permission that is necessary for our custom operations. and
for your scenario, this is the FileIOPermission... :-)
Anyway, glad that you've got it working....
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--
| Thread-Topic: how to find the windows path of custom assembly using c#
code?
| thread-index: AcYCXj/lieGZBwSnQZaVOJeA9HQJ8Q==| X-WBNR-Posting-Host: 38.113.18.195
| From: "=?Utf-8?B?bXNkbnVzZXI=?=" <ringt@.nospam.nospam>
| References: <3469D9D8-469F-4A2C-A7D9-A3CE022FCE72@.microsoft.com>
<e5Y7SwCAGHA.3864@.tk2msftngp13.phx.gbl>
<P8Vq8jFAGHA.3764@.TK2MSFTNGXA02.phx.gbl>
<8F143CDF-66BE-4E12-AC74-7322855E18E3@.microsoft.com>
<uiwOM8RAGHA.2040@.TK2MSFTNGP14.phx.gbl>
<5s9mSKWAGHA.1504@.TK2MSFTNGXA02.phx.gbl>
<92BCD84D-F5A4-4E8E-AF01-463F71D0FB24@.microsoft.com>
| Subject: Re: how to find the windows path of custom assembly using c#
code?
| Date: Fri, 16 Dec 2005 08:32:04 -0800
| Lines: 131
| Message-ID: <A04C0A67-0357-46A7-B39B-793FBC570C33@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.reportingsvcs
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA
03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.reportingsvcs:65287
| X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
|
| Hi Teo and Steven,
|
| Please ignore my last reply in this thread. I made a mistake of not
| appending my file name after I find the path using
| System.AppDomain.CurrentDomain.BaseDirectory. Thus my problem is solved
now.
| Thank you very much.
|
|
|
| "msdnuser" wrote:
|
| > Hi there,
| >
| > As Steven mentioned, I have to give fullTrust permission to get the
path
| > during runtime. Even then as Toe have mentioned asserting permissions
to a
| > path known at runtime is not successful to me. It throws me #Error
again. Is
| > there any other way (even by reducing or modifying some permissions) to
| > implement this?
| >
| > Expecting your help.
| >
| > Thanks.
| >
| >
| >
| > "Steven Cheng[MSFT]" wrote:
| >
| > > Hi ringt,
| > >
| > > I'm afraid grant the sufficient CAS permission is necessary. However,
I
| > > agree with you that it's not necessary to grant the FullTrust to
| > > LocalComputer zone... You can choose to adjust the existing
PermissionSet
| > > , e.g the "Execution" or add a new named PermissionSet and add
those
| > > FileIOPermissions in that PermissionSet. To grant the custom
PermssionSet
| > > to your own assembly, you can consider strong-named your assemtly so
that
| > > you can grant permissionSet through Strong-named condition.....
| > >
| > > So far I haven't found any resource directly describing modifying
the
| > > reporting service's security policy file, but there is on good
article
| > > discussing customize ASP.NET 2.0 security policys:
| > >
| > >
| > > #How To: Use Code Access Security in ASP.NET 2.0
| > >
http://msdn.microsoft.com/library/en-us/dnpag2/html/paght000017.asp?frame=tr
| > > ue
| > >
| > > this article mentioned the similiar ideas on customizing existing
security
| > > policy file and add FileIOPermission for certain CodeGroup....
| > >
| > >
| > > Hope helps. Thanks,
| > >
| > > Steven Cheng
| > > Microsoft Online Support
| > >
| > > Get Secure! www.microsoft.com/security
| > > (This posting is provided "AS IS", with no warranties, and confers no
| > > rights.)
| > >
| > >
| > >
| > >
| > >
| > >
| > > --
| > > | From: "Teo Lachev [MVP]" <teo.lachev@.nospam.prologika.com>
| > > | References: <3469D9D8-469F-4A2C-A7D9-A3CE022FCE72@.microsoft.com>
| > > <e5Y7SwCAGHA.3864@.tk2msftngp13.phx.gbl>
| > > <P8Vq8jFAGHA.3764@.TK2MSFTNGXA02.phx.gbl>
| > > <8F143CDF-66BE-4E12-AC74-7322855E18E3@.microsoft.com>
| > > | Subject: Re: how to find the windows path of custom assembly using
c#
| > > code?
| > > | Date: Wed, 14 Dec 2005 21:27:19 -0500
| > > | Lines: 38
| > > | X-Priority: 3
| > > | X-MSMail-Priority: Normal
| > > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > > | X-RFC2646: Format=Flowed; Original
| > > | Message-ID: <uiwOM8RAGHA.2040@.TK2MSFTNGP14.phx.gbl>
| > > | Newsgroups: microsoft.public.sqlserver.reportingsvcs
| > > | NNTP-Posting-Host: c-66-56-76-188.hsd1.ga.comcast.net 66.56.76.188
| > > | Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14.phx.gbl
| > > | Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.sqlserver.reportingsvcs:65108
| > > | X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
| > > |
| > > | The links I included in my previous post should get you started
although
| > > in
| > > | your case it is like catch-22. You need to grant access to a path
which
| > > is
| > > | known only at runtime. You have to do some reasearch to find if
this is
| > > | possible at all.
| > > |
| > > | Good luck!
| > > |
| > > | --
| > > | HTH,
| > > | ---
| > > | Teo Lachev, MVP, MCSD, MCT
| > > | "Microsoft Reporting Services in Action"
| > > | "Applied Microsoft Analysis Services 2005"
| > > | Home page and blog: http://www.prologika.com/
| > > |
| > > | ---
| > > | "msdnuser" <ringt@.nospam.nospam> wrote in message
| > > | news:8F143CDF-66BE-4E12-AC74-7322855E18E3@.microsoft.com...
| > > | > Hi Teo and Steven,
| > > | >
| > > | > Thank you both for the replies. I am able to get the executing
path of
| > > | > assembly using System.AppDomain.CurrentDomain.BaseDirectory only
if I
| > > give
| > > | > FullTrust permissionset to "MyComputer" and
| > > | > "Report_Expressions_Default_Permissions" Code Groups. Is there a
way I
| > > can
| > > | > reduce the permission and make them work?
| > > | >
| > > | > Note: I also have my own permission set and code group to give my
dll,
| > > | > read
| > > | > permission to my text file which is not a config file. I am using
| > > | > Reporting
| > > | > Services 2005.
| > > | >
| > > | > Thanks,
| > > | > ringt
| > > | >
| > > | >
| > > |
| > > |
| > > |
| > >
| > >
|