Sunday, March 25, 2012
Accessing Delivery Extension UI WebControls
We are developing a custom web application that will interact with the
Reporting Services web service (instead of using the ReportManager). I need
to manage subscriptions from my custom web app just like ReportManager does.
I would like to programmatically access the web controls located in each
extension dll (e-mail, fileshare, or my own custom dlls) used to gather
information from the client instead of having to write new ones. I know the
ReportManager accesses these objects (for example, the
PrinterDeliveryUIProvider in the printer delivery sample), so there must be a
way to do this. (Reflection?)
I couldn't find any helpful documentation (might have missed something), and
wondered if anyone knew how the best way to go about this.
Thanks,
MattThe Report Manager obtains the list of the registered UI controls from the
<DeliveryUI> element in the RSWebApplication.config file. Then, it proceeds
by loading dynamically the user control presumably by calling LoadControl().
Since the UI controls implement ISubscriptionBaseUIUserControl the Report
Manager knows how to manipulate them in a standard fashion.
You may find my custom Web Service delivery extension (included in the book
source code) useful to understand how the UI controls work.
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"mshumaker" <mshumaker@.discussions.microsoft.com> wrote in message
news:14595C36-8130-481F-8DC9-7C356DF66314@.microsoft.com...
> hi,
> We are developing a custom web application that will interact with the
> Reporting Services web service (instead of using the ReportManager). I
need
> to manage subscriptions from my custom web app just like ReportManager
does.
> I would like to programmatically access the web controls located in each
> extension dll (e-mail, fileshare, or my own custom dlls) used to gather
> information from the client instead of having to write new ones. I know
the
> ReportManager accesses these objects (for example, the
> PrinterDeliveryUIProvider in the printer delivery sample), so there must
be a
> way to do this. (Reflection?)
> I couldn't find any helpful documentation (might have missed something),
and
> wondered if anyone knew how the best way to go about this.
> Thanks,
> Matt|||Ah, that would be the link I was looking for. I focused on obtaining the
info straight from the ReportServer and didn't think of using my own config
file. And after the time I've already spent with the config files while
getting my custom delivery extension to work...
I will also look into the LoadControl() method.
Thanks for your help.
Matt
"Teo Lachev [MVP]" wrote:
> The Report Manager obtains the list of the registered UI controls from the
> <DeliveryUI> element in the RSWebApplication.config file. Then, it proceeds
> by loading dynamically the user control presumably by calling LoadControl().
> Since the UI controls implement ISubscriptionBaseUIUserControl the Report
> Manager knows how to manipulate them in a standard fashion.
> You may find my custom Web Service delivery extension (included in the book
> source code) useful to understand how the UI controls work.
> --
> Hope this helps.
>|||LoadControl() won't work - it loads a UserControl where a control used for a
delivery extension UI is a WebControl.
I'll look into this more - maybe try loading it with reflection.
"mshumaker" wrote:
> Ah, that would be the link I was looking for. I focused on obtaining the
> info straight from the ReportServer and didn't think of using my own config
> file. And after the time I've already spent with the config files while
> getting my custom delivery extension to work...
> I will also look into the LoadControl() method.
> Thanks for your help.
> Matt
>
> "Teo Lachev [MVP]" wrote:
> > The Report Manager obtains the list of the registered UI controls from the
> > <DeliveryUI> element in the RSWebApplication.config file. Then, it proceeds
> > by loading dynamically the user control presumably by calling LoadControl().
> > Since the UI controls implement ISubscriptionBaseUIUserControl the Report
> > Manager knows how to manipulate them in a standard fashion.
> >
> > You may find my custom Web Service delivery extension (included in the book
> > source code) useful to understand how the UI controls work.
> >
> > --
> > Hope this helps.
> >
>|||My bad :-)
Than, it is probably dynamically loading the assembly using Load or LoadFrom
and adding the control to a placeholder, e.g.
PlaceHolder1.Controls.Add(ctrl);
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"mshumaker" <mshumaker@.discussions.microsoft.com> wrote in message
news:01BF60A4-B199-4A2C-B494-5741ADAD650E@.microsoft.com...
> LoadControl() won't work - it loads a UserControl where a control used for
a
> delivery extension UI is a WebControl.
> I'll look into this more - maybe try loading it with reflection.
> "mshumaker" wrote:
> >
> > Ah, that would be the link I was looking for. I focused on obtaining
the
> > info straight from the ReportServer and didn't think of using my own
config
> > file. And after the time I've already spent with the config files while
> > getting my custom delivery extension to work...
> >
> > I will also look into the LoadControl() method.
> >
> > Thanks for your help.
> > Matt
> >
> >
> > "Teo Lachev [MVP]" wrote:
> >
> > > The Report Manager obtains the list of the registered UI controls from
the
> > > <DeliveryUI> element in the RSWebApplication.config file. Then, it
proceeds
> > > by loading dynamically the user control presumably by calling
LoadControl().
> > > Since the UI controls implement ISubscriptionBaseUIUserControl the
Report
> > > Manager knows how to manipulate them in a standard fashion.
> > >
> > > You may find my custom Web Service delivery extension (included in the
book
> > > source code) useful to understand how the UI controls work.
> > >
> > > --
> > > Hope this helps.
> > >
> >
accessing datasets / Field collections through custom code
My report has multiple datasets, and I want to access the fields of a particular dataset from custom code. The problem is that the name of the dataset to use is only calculated during the execution of the custom code.
Allow me to illustrate:
public function Test(data as DataSets, fieldName as string)
dim datasetName as string = CalculateDatasetName()
dim ds as Dataset = data(datasetName)
' now here I want to get the fieldName out of the dataset.
' in the report, I would do something like
' First(Fields!fieldName.Value, datasetName)
' but in custom code, this obviously doesn't work.
end function
I've been looking for a way to accomplish this, but it seems you cannot get data from a dataset through custom code (there is only the commandtext property). Also it is not possible to pass the Fields collection as a parameter, as I do not know the dataset name when in the report designer.
I hope my problem description is clear.
Does anyone know how to solve this issue?
Thanks,
Phil
Hi Phil,
Look at the code below
public DataSet Dataset_name = new DataSet();
public DataTable DataTable_name = new DataTable();
public DataColumn DataColumn_name = new DataColumn();
public DataView View_name = new DataView();
public datatype function(name_of _variable_which catch_the column_value datatype)
{
DataColumn_name = new DataColumn("name_of _variable_which catch_the column_value", System.Type.GetType("System.String"))
}
Hope this helps
Priyank
Accessing dataset with custom code
Hi,
Need a little help on the code here. How can I import values from an RSS dataset? I will store them in a hash table and then call the function to check for dups. An example or pointer or article reference would be appreciated.
Thanks.
Since RSS is xml, you can use the XML data processing extension that comes with SQL Server 2005. This link has documentation on this feature:
http://msdn2.microsoft.com/en-us/library/ms159741.aspx
Basically, you create a data source in report designer with type xml and specify the connection string to be the url of RSS feed. The query language it uses is similar to XPath. The doc for the query language is here:
http://msdn2.microsoft.com/en-US/library/ms365158.aspx
|||Here is an example of using the Xml Data Processing extension using this forum's RSS feed as the source.Connection String:
http://forums.microsoft.com/MSDN/rss.aspx?ForumID=82&Mode=0&SiteID=1
Query:
<Query>
<ElementPath IgnoreNamespaces="True">rss{}/channel{title,link, description}/item{title, date, link, description, comments}</ElementPath>
</Query>
Ian|||
Thanks for all the help. This stuff is pretty much new to me. I'm mostly familiar with VBA, Classic VB, and T-SQL but we'll see where this leads.
Thursday, March 22, 2012
Accessing Custom Properties in UI
I am attempting to set my custom properties in the UI I have created for my custom transformation. I can access them in the ProcessInput, but if I try to assign them a new value in my UI the values dont change.
I set the properties up in ProvideComponentProperties
public override void ProvideComponentProperties()
{
// Perform component setup operations
ComponentMetaData.UsesDispositions = false;
// Add Input
IDTSInput90 input = ComponentMetaData.InputCollection.New();
input.Name = "TrimInput";
input.ErrorRowDisposition = DTSRowDisposition.RD_NotUsed;
// Add Output
IDTSOutput90 output = ComponentMetaData.OutputCollection.New();
output.Name = "TrimOutput";
output.SynchronousInputID = input.ID;
IDTSCustomProperty90 Trimproperty = ComponentMetaData.CustomPropertyCollection.New();
Trimproperty.Name = "Trim Values";
Trimproperty.Description = "Selected Trim Values";
IDTSCustomProperty90 Colproperty = ComponentMetaData.CustomPropertyCollection.New();
Colproperty.Name = "Col Names";
Colproperty.Description = "Column Names";
}
btn Click event in UI form
IDTSCustomProperty90 Trimproperty = _dtsComponentMetaData.CustomPropertyCollection["Trim Values"];
Trimproperty.Value = sConcatTrim;
IDTSCustomProperty90 Colproperty = _dtsComponentMetaData.CustomPropertyCollection["Col Names"];
Colproperty.Value = sConcatColNames;
Any suggestions or please point me to any example would be greatly appreciated.
Could you share how you implemented DTSComponentUI interface? It could be that you are not committing changes when you close the UI.
Thanks.
|||That was the problem .. fixed it. When the ok button was clicked on the form was not setting the form dialog result to ok.
Thank you,
Carlier
Accessing Custom Assemblies
We are building a report via Business Intelligent Studio. We have deployed the custom assembly dll to two folders:
1. Microsoft Sql Server\MMSQL.3\Reporting Services\Report Server\bin
2. Microsoft Visual Studio 8\Common\IDE\private assemblies.
This dll is an instance dll.
When we open the report properties/reference tab, we can find and link to the dll. Which one of the above locations is the correct one? (We have #2).
We created the class and instance entry.
Next, we added a textbox to the report layout. When we try to use the =Code keyword we get an unrecognized identifier error.
Can anyone shed any light on why this is happening. We've spent considerable time trying to find any info on this with no luck.
Any help is appreciated
Information about using custom assemblies with reports can be found here:
http://msdn2.microsoft.com/en-us/library/ms153561.aspx
For me, to use the assembly in BIDS the path is \Visual Studio 8\Common7\IDE\PrivateAssemblies
Note "Common7" and no spaces in "PrivateAssemblies".
Accessing config file from delivery extension
entries in it from within a delivery extension. I've tried putting it in the
ReportServer web.config and RSReportServer.config, and my code doesn't seem
to be able to find it.
When I use the configuration file .Net framework classes from within a
delivery extension, which config file is it looking at?
Thanks,
Mike SandwickMike,
Subscriptions are run in an unattended mode by the Report Server Windows
service (ReportingServicesService.exe) not the Report Server. So, try
putting your config settings in ReportingServicesService.exe.config.
--
Hope this helps.
----
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
----
"Mike Sandwick" <MikeSandwick@.discussions.microsoft.com> wrote in message
news:8BF4DD62-2EBE-491E-AB21-12BCFF53AA8E@.microsoft.com...
> I'm running into a problem with reading a config file with my own custom
> entries in it from within a delivery extension. I've tried putting it in
the
> ReportServer web.config and RSReportServer.config, and my code doesn't
seem
> to be able to find it.
> When I use the configuration file .Net framework classes from within a
> delivery extension, which config file is it looking at?
> Thanks,
> Mike Sandwick|||Hi Teo:
The delivery extension also has to provide GUI functionality in the
Report Server process, which will pull settings from
RSWebApplication.config. Depending on when the settings are used -
they might have to appear in both.
--
Scott
http://www.OdeToCode.com/
On Tue, 5 Oct 2004 21:57:50 -0400, "Teo Lachev [MVP]"
<teo.lachev@.nospam.prologika.com> wrote:
>Mike,
>Subscriptions are run in an unattended mode by the Report Server Windows
>service (ReportingServicesService.exe) not the Report Server. So, try
>putting your config settings in ReportingServicesService.exe.config.|||That was it, I put my configuration file entry in the
ReportingServicesService.exe.config, and it now works.
Thanks!
Mike
"Teo Lachev [MVP]" wrote:
> Mike,
> Subscriptions are run in an unattended mode by the Report Server Windows
> service (ReportingServicesService.exe) not the Report Server. So, try
> putting your config settings in ReportingServicesService.exe.config.
> --
> Hope this helps.
> ----
> Teo Lachev, MVP [SQL Server], MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ----
> "Mike Sandwick" <MikeSandwick@.discussions.microsoft.com> wrote in message
> news:8BF4DD62-2EBE-491E-AB21-12BCFF53AA8E@.microsoft.com...
> > I'm running into a problem with reading a config file with my own custom
> > entries in it from within a delivery extension. I've tried putting it in
> the
> > ReportServer web.config and RSReportServer.config, and my code doesn't
> seem
> > to be able to find it.
> >
> > When I use the configuration file .Net framework classes from within a
> > delivery extension, which config file is it looking at?
> >
> > Thanks,
> > Mike Sandwick
>
>|||Scott,
You are right. In general, a custom extension should store its config
settings in the Configuration element in the RSWebApplication.config. This
will allow the Report Server (or Report Manager) to push these settings to
the extension.
Perhaps, I should have started my reply with this side note. I assumed that
in Mike's case this wasn't acceptable. Thanks for pointing this out.
--
Hope this helps.
----
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
----
"Scott Allen" <bitmask@.[nospam].fred.net> wrote in message
news:6g07m0ttch61feklpro0dueks5a301o6d7@.4ax.com...
> Hi Teo:
> The delivery extension also has to provide GUI functionality in the
> Report Server process, which will pull settings from
> RSWebApplication.config. Depending on when the settings are used -
> they might have to appear in both.
> --
> Scott
> http://www.OdeToCode.com/
> On Tue, 5 Oct 2004 21:57:50 -0400, "Teo Lachev [MVP]"
> <teo.lachev@.nospam.prologika.com> wrote:
> >Mike,
> >
> >Subscriptions are run in an unattended mode by the Report Server Windows
> >service (ReportingServicesService.exe) not the Report Server. So, try
> >putting your config settings in ReportingServicesService.exe.config.
>
Tuesday, March 20, 2012
Accessing a package's variables from within a custom log provider...or not...
Hi,
Given that Task.Validate() exposes the package's VariableDispenser, but LogProviderBase.Validate() doesn't...
http://msdn2.microsoft.com/fr-fr/library/microsoft.sqlserver.dts.runtime.task.validate.aspx
http://msdn2.microsoft.com/fr-fr/library/microsoft.sqlserver.dts.runtime.logproviderbase.validate.aspx
...I guess that simply means that I can't access a package's variables within a custom log provider? Can anyone comment/confirm? Any other options/routes to achieving the same..?
We live in hope,
Tamim.
I have recently looked at this and would agree, there is no way to use variables in a log provider. There are no hooks available in any of the base class methods or any parameters that you are exposed to in a log provider. Would be nice if you could though, as it would give you more control to create your own message content, but as it stands this is not viable.|||
Thanks Darren - I was pretty sure there was no alternative, so it's good to have that ratified by yourself. There is however one cheeky/not-so-neat way round: the 'source' for some events, e.g. PackageStart, gives the package name. (Of course this is an exception for only 1 system variable, with no wider applicability).
Cheers,
Tamim.
Accessing .Net 2.0 custom assembly in report to be deployed on SSRS 2000 SP2
I am using SQL reporting services 2000 + SP2. In one of my report I am
using custom .Net 1.1 assembly. I have given the reference for the
same in the report.
The report gets deployed without any issues.
Recently we had to upgrade this custom assembly to .Net 2.0. Now when
I try to deploy this report on SSRS 2000 it gives me error "Error
while loading code module:<my custom assembly complete name> " and
"Details: The format of the file <my custom assembly name>is invalid."
I have both .Net 1.1 and .Net 2.0 frameworks on my reporting server.
If I try to give reference to this .Net 2.0 binary again in the report
through IDE (Microsoft Visual Studio .NET 2003 IDE) it gives me error
"<my custom assembly name> does not contain an assembly".
How can I use my .Net 2.0 custom assembly in my SSRS 2000 + SP2
report. I have to use SSRS2000 SP2 as we cannot remove the support of
SSRS2000 SP2 for our reports.
Custom assembly been used is using various .Net 2.0 provided classes
now so it has to be in .Net 2.0.
Can I somehow tell the ASP.Net webapplication through various config
file that while using my custom binary load it in .Net 2.0 Framework?
I tried giving binding redirect but it did not work in the
Reprotserver config file . how can i specify the .Net framework
version in those entries?
Everything works fine in SSRS 2005 as the reporting service is also
in .Net 2.0
Regards,
ManojHi, I have the same issue. Have you got it fixed? How?
Could someone from MSFT give us an answer?
Thanks,
Lianghong
"Manoj" wrote:
> Hi ,
> I am using SQL reporting services 2000 + SP2. In one of my report I am
> using custom .Net 1.1 assembly. I have given the reference for the
> same in the report.
> The report gets deployed without any issues.
> Recently we had to upgrade this custom assembly to .Net 2.0. Now when
> I try to deploy this report on SSRS 2000 it gives me error "Error
> while loading code module:<my custom assembly complete name> " and
> "Details: The format of the file <my custom assembly name>is invalid."
> I have both .Net 1.1 and .Net 2.0 frameworks on my reporting server.
> If I try to give reference to this .Net 2.0 binary again in the report
> through IDE (Microsoft Visual Studio .NET 2003 IDE) it gives me error
> "<my custom assembly name> does not contain an assembly".
> How can I use my .Net 2.0 custom assembly in my SSRS 2000 + SP2
> report. I have to use SSRS2000 SP2 as we cannot remove the support of
> SSRS2000 SP2 for our reports.
> Custom assembly been used is using various .Net 2.0 provided classes
> now so it has to be in .Net 2.0.
> Can I somehow tell the ASP.Net webapplication through various config
> file that while using my custom binary load it in .Net 2.0 Framework?
> I tried giving binding redirect but it did not work in the
> Reprotserver config file . how can i specify the .Net framework
> version in those entries?
>
> Everything works fine in SSRS 2005 as the reporting service is also
> in .Net 2.0
> Regards,
> Manoj
>|||dotNet 2.0 uses a different framework - have you installed the dotnet 2.0
framework on your server?
"Lianghong" <Lianghong@.discussions.microsoft.com> wrote in message
news:7423185E-C8BA-4D1E-BB04-6BF78AD4DCAB@.microsoft.com...
> Hi, I have the same issue. Have you got it fixed? How?
> Could someone from MSFT give us an answer?
> Thanks,
> Lianghong
> "Manoj" wrote:
>> Hi ,
>> I am using SQL reporting services 2000 + SP2. In one of my report I am
>> using custom .Net 1.1 assembly. I have given the reference for the
>> same in the report.
>> The report gets deployed without any issues.
>> Recently we had to upgrade this custom assembly to .Net 2.0. Now when
>> I try to deploy this report on SSRS 2000 it gives me error "Error
>> while loading code module:<my custom assembly complete name> " and
>> "Details: The format of the file <my custom assembly name>is invalid."
>> I have both .Net 1.1 and .Net 2.0 frameworks on my reporting server.
>> If I try to give reference to this .Net 2.0 binary again in the report
>> through IDE (Microsoft Visual Studio .NET 2003 IDE) it gives me error
>> "<my custom assembly name> does not contain an assembly".
>> How can I use my .Net 2.0 custom assembly in my SSRS 2000 + SP2
>> report. I have to use SSRS2000 SP2 as we cannot remove the support of
>> SSRS2000 SP2 for our reports.
>> Custom assembly been used is using various .Net 2.0 provided classes
>> now so it has to be in .Net 2.0.
>> Can I somehow tell the ASP.Net webapplication through various config
>> file that while using my custom binary load it in .Net 2.0 Framework?
>> I tried giving binding redirect but it did not work in the
>> Reprotserver config file . how can i specify the .Net framework
>> version in those entries?
>>
>> Everything works fine in SSRS 2005 as the reporting service is also
>> in .Net 2.0
>> Regards,
>> Manoj
>>|||Yes. The .Net framework 2.0 is installed on the server.
"Bob" wrote:
> dotNet 2.0 uses a different framework - have you installed the dotnet 2.0
> framework on your server?
> "Lianghong" <Lianghong@.discussions.microsoft.com> wrote in message
> news:7423185E-C8BA-4D1E-BB04-6BF78AD4DCAB@.microsoft.com...
> > Hi, I have the same issue. Have you got it fixed? How?
> > Could someone from MSFT give us an answer?
> >
> > Thanks,
> > Lianghong
> >
> > "Manoj" wrote:
> >
> >> Hi ,
> >>
> >> I am using SQL reporting services 2000 + SP2. In one of my report I am
> >> using custom .Net 1.1 assembly. I have given the reference for the
> >> same in the report.
> >>
> >> The report gets deployed without any issues.
> >>
> >> Recently we had to upgrade this custom assembly to .Net 2.0. Now when
> >> I try to deploy this report on SSRS 2000 it gives me error "Error
> >> while loading code module:<my custom assembly complete name> " and
> >> "Details: The format of the file <my custom assembly name>is invalid."
> >>
> >> I have both .Net 1.1 and .Net 2.0 frameworks on my reporting server.
> >>
> >> If I try to give reference to this .Net 2.0 binary again in the report
> >> through IDE (Microsoft Visual Studio .NET 2003 IDE) it gives me error
> >> "<my custom assembly name> does not contain an assembly".
> >>
> >> How can I use my .Net 2.0 custom assembly in my SSRS 2000 + SP2
> >> report. I have to use SSRS2000 SP2 as we cannot remove the support of
> >> SSRS2000 SP2 for our reports.
> >>
> >> Custom assembly been used is using various .Net 2.0 provided classes
> >> now so it has to be in .Net 2.0.
> >> Can I somehow tell the ASP.Net webapplication through various config
> >> file that while using my custom binary load it in .Net 2.0 Framework?
> >> I tried giving binding redirect but it did not work in the
> >> Reprotserver config file . how can i specify the .Net framework
> >> version in those entries?
> >>
> >>
> >> Everything works fine in SSRS 2005 as the reporting service is also
> >> in .Net 2.0
> >>
> >> Regards,
> >> Manoj
> >>
> >>
>
>
Sunday, March 11, 2012
Access to variables in Custom Log Provider?
Hello,
I found one post from the past asking this question, but didn't see an answer, so I am hoping someone can shed some more light on it:
I am writing a custom log provider in C#. Is it possible give this custom log provider access to the variables collection (via a variabledispenser object)? First glance at the log provider classes would tell me that this is not possible, though I would like confirmation. Also, if I am correct in thinking it is not possible, what was the reason for leaving this out?
Thanks!
Indeed this does not appear to be possible. What is it you are trying to acheive? Some more info may help us evaluate this as a feature request for the future.
Donald
|||Donald,
Thanks for the response. A brief explanation of my thought process below:
I have a package with a number of variables that are evaluated during package execution via property expressions. When a component of the package logs a warning or failure, I would like to be able to identify what state each variable was in at the time of that warning/failure. I had hoped to be able to create a custom log provider to log this information to a database along with the warning/failure message. If the VariableDispenser object was passed into the Log method of my custom log provider, I would be able to accomplish this.
Thanks again.
David
Thursday, March 8, 2012
Access to report objects fom custom code
dialog.
Can this code access any of the report object such as data or Custom Report
Items ?
What context is this code running under ? I tried to figure it out using
reflector and got to a dead end on a internal class called
ReportExprHostImpl.CustomCodeProxy that doesn't seem to have a reference to
anything in the report.
--
Francisco Padron
www.chartfx.comhmm...In the past what I've done is setup c# classes and just
referenced them from the report...
try this: http://msdn2.microsoft.com/en-us/library/ms155798.aspx
Hope this helps!
--
Ben Sullins
http://bensullins.com|||Unfortunatley it is not possible to access any report objects. You'll need
to pass anything you need as parameters into your functions.
"news.microsoft.com" wrote:
> I can write custom code in my report through the "Report -> Properties"
> dialog.
> Can this code access any of the report object such as data or Custom Report
> Items ?
> What context is this code running under ? I tried to figure it out using
> reflector and got to a dead end on a internal class called
> ReportExprHostImpl.CustomCodeProxy that doesn't seem to have a reference to
> anything in the report.
> --
> Francisco Padron
> www.chartfx.com
>
>
Tuesday, March 6, 2012
Access to datasources in custom code
I'm wondering if there is any way to access the datasources inside
your custom code of a VS 2005.NET report. My datasources are made up
of custom business objects, thus you can imagine wanting to manipulate
them from the report. In this particular case I want to build up a TOC
during the build of the report, which right now I build up in a
database table.
DaveYou would have to write a data processing extension (non-trivial). Read up
on this in Books OnLine.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"dnote" <mrdnote@.yahoo.com> wrote in message
news:1170692326.111173.53510@.s48g2000cws.googlegroups.com...
> Hi there!
> I'm wondering if there is any way to access the datasources inside
> your custom code of a VS 2005.NET report. My datasources are made up
> of custom business objects, thus you can imagine wanting to manipulate
> them from the report. In this particular case I want to build up a TOC
> during the build of the report, which right now I build up in a
> database table.
> Dave
>
Saturday, February 25, 2012
Access shared data source inside custom assembly
I have a database connection string hard-coded in a SQL Server 2005 Reporting Services custom assembly. Since the connection string is environment-specific (dev/prod), I would like to read the connections string from a settings file, like is typically done for web.config. Using the shared data source is also a good option.
How do I accomplish this?
I looked into trying to use DataSourceReference(), but that does not seem to be allowed inside of a custom assembly. Thank you.
Only private data sources can be expression-based. You can think of the Report Server as a web application since it runs under IIS. Therefore, you can put your config settings in the C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\web.config just like you would do with a regular ASP.NET app. Assuming you've deployed your report to the report catalog, you can read these settings at runtime . Additional considerations:
1. This technique is not supported.
2. Since there is no HttpContext in in the VS.NET Report Designer, you need to check for this condition and default your settings so you report works in design mode. I have a report in this download that demostrates how you can do this.
Access shared data source inside custom assembly
I have a database connection string hard-coded in a SQL Server 2005 Reporting Services custom assembly. Since the connection string is environment-specific (dev/prod), I would like to read the connections string from a settings file, like is typically done for web.config. Using the shared data source is also a good option.
How do I accomplish this?
I looked into trying to use DataSourceReference(), but that does not seem to be allowed inside of a custom assembly. Thank you.
Check Jason's blog here
http://weblogs.asp.net/jgaylord/archive/2005/05/12/406639.aspx
HTH
Regards
Thank you. I read that blog, but it just seems to mention connection strings in general. The issue I am facing is that the Reporting Services assembly does not seem to allow me to access web.config, even though there is a web.config associated with RS. When I try to write "Imports System.Web.Configuration," VS2005 says it is not available and that the WebConfigurationManager is not available.
|||Ok, simply add the System.Configurations.Dll as a reference in your project.
Let me know if you need further help.
Regards
Friday, February 24, 2012
access report builder from custom code
builder to make ad-hoc reports, how would I go about doing this from inside
my application? thanks!You can use "reportbuilder.exe" file but I have not tried running this exe,
where the RS environment is not there. Moreover this is a part of SSRS and
ofcourse Sql server so probabily licensing issues will be there because this
is a seperate tool, but will have to check whether it works out of the SS &
SSRS environment first.
Amarnath
"Smokey Grindle" wrote:
> I am writing a .NET app, I'd like the user to have access to the report
> builder to make ad-hoc reports, how would I go about doing this from inside
> my application? thanks!
>
>
Monday, February 13, 2012
Access is denied exception when loading an assembly from custom data processing extension
I have been banging my head against this for the better part of today.
Here's the scenario. I have a custom data processing extension which
tries to make calls into another .NET assembly. As soon as this second
assembly is loaded, an "Access is denied: name_of_the_assembly"
System.Exception is thrown. I can't even catch this error as it seems
to occur on the assembly load and not on the first function call. Both
my data processing extension and second assembly have strong names and
are signed with the same key.
The rssvrpolicy.config is setup to allow FullTrust to my data
processing extension and second assembly. I have tried both URL
Membership Condtion as well as StrongName. Note that my custom data
processing extension works just fine if it doesn't call the second
assembly. Rolling everything back into a single assembly is not really
an option though.
OS: Windows Server 2003
Reporting Services SP1
IIS AppDomain Identity: NetworkService
Any ideas? Help please.
~JeffOk, I'm an idiot. It turns out that my data processing extension was
NOT signed but my second assembly was meaning that I had an untrusted
caller trying to call a trusted assembly and bomb! I went ahead and
signed everything and gave the proper StrongName membership in the
policy config and I'm good now.
I'm glad it turned out to be my problem because I couldn't figure out
for the life of me what I was doing wrong in regards to RS.
Hope this helps somebody else.
~Jeff
Access Global Variables in Body
However I get this msg when I use the following code.
Public Shared Function Hello() As String
Return Globals.UserID
End Function
ERROR :- There is an error on line 1 of custom code: [BC30469] Reference to
a non-shared member requires an object reference.
I need to get the global variables Execution time, Page Number within the
body to format the report appropriatly.
Thanks in advance to helpers !In order to access the Global (or parameter for that matter) you have to
fully qualify it in the code window.
There are two fixes to your problem.
1. drag a text box to the report area
2. past something like this into it:
=Globals!PageNumber & " of " & Globals!TotalPages
3. run the report.
--
OR (doing it by ref from the code)
--
if you need to ref them from the code, the you have to declare them first in
your code like so:
Function pn()
Dim pn as String
pn = Report.Globals!PageNumber
Return pn
End Function
Function tp()
Dim tp as String
tp = Report.Globals!TotalPages
Return tp
End Function
----
Once you have that in the code window, you can type:
=Code.pn()
or
=Code.tp()
--
to get the pagenumber or total page global respectfully
"d pak" wrote:
> Is this possible? I am trying to access the global variables via custom code.
> However I get this msg when I use the following code.
> Public Shared Function Hello() As String
> Return Globals.UserID
> End Function
> ERROR :- There is an error on line 1 of custom code: [BC30469] Reference to
> a non-shared member requires an object reference.
> I need to get the global variables Execution time, Page Number within the
> body to format the report appropriatly.
> Thanks in advance to helpers !
Thursday, February 9, 2012
Access denied to files
Hi,
Im trying to "use" files during my flow in two diferent kind of components (send email task and custom transformation), but the error i get is similar: access denied, file doesnt exists, is locked by another proccess or not enough rigths.
-In custom transofrmation i am trying to write to a file with the next code:
Dim sw As StreamWriter
If (Not File.Exists(".\test.txt")) Then
sw = File.CreateText(".\test.txt")
Else
sw = File.AppendText(".\test.txt")
End If
sw.Write("Numero de Registros en Empresas")
sw.WriteLine(Row.CuentaRegEmpresas)
sw.Write("Numero de Registros en Reporta")
sw.WriteLine(Row.CuentaRegReporta)
sw.Write("Numero de Registros de Facturas ampliadas")
sw.WriteLine(Row.CuentaRegFAmp)
sw.WriteLine()
- In send email tranformation i am trying to attach a different file (the log of the process) , but the error is that i dont have rights to access. If i try to send another file this error disappears...
Both files (test.txt and log.txt) have total control rights to all users, and arent locked or opened by any other process during the execution.
Edit: Thats the error trace i get:
en System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
en System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
en System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
en System.IO.StreamWriter.CreateFile(String path, Boolean append)
en System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
en System.IO.StreamWriter..ctor(String path, Boolean append)
en System.IO.File.AppendText(String path)
en ScriptComponent_14cd101f436a42b18dc68087869033b2.ScriptMain.Entrada0_ProcessInputRow(Entrada0Buffer Row)
en ScriptComponent_14cd101f436a42b18dc68087869033b2.UserComponent.Entrada0_ProcessInput(Entrada0Buffer Buffer)
en ScriptComponent_14cd101f436a42b18dc68087869033b2.UserComponent.ProcessInput(Int32 InputID, PipelineBuffer Buffer)
en Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ProcessInput(Int32 inputID, PipelineBuffer buffer)
You mention three different errors, can you be clear about which error happens when? Please post the exact error message as well.
Can you also explain more about the tasks, and the order they are executed within your package.
The code snippet above seems incomplete, and also rather strang, perhaps if you posted the full code it would make more sense. Based on what you have posted I'd say it is wrong, as opening the file for each row is a bad idea, and you do not close the file.
As an aside the syntax seems complicated, to append to a file, just use the constructor overload -
Code Snippet
StreamWriter stream = new StreamWriter("C:\Test.txt", true);
stream.WriteLine("Test");
stream.Close();
|||
Hi Darren,
Your are right, the problem of the custom transformation was that i did not close the StreamWriter, now it's working fine.
The other problem is that, at the end of the process i want to send the log file, but it seems like the process locks the file and cant be attached in the email... am i wrong? i will try to send the email in other package inside the same project... Its possible to send parameters to the new package?
Any other idea to send the log via email just at the end of the process?
Thanks
Edit: I have proved this solution and it doesnt work... log file cant be send using a different package inside the project.
|||Why is the file locked? If you are in control of writing the file, then you should have closed and therefore released all locks to the file, so the file should be available to send. You must have something open still. Ultimately you can use something like Process Moniotor of File? (I forget to find who has the lock), the old SysInternals tools, now MS.|||The file that is locked is the log of the process... i have read in other post that is not possible to send it becuase the own process locks it, so i decide to send via email only the errors stored in @.[System::ErrorDescription]variable when an error event is raised.
thanks