Showing posts with label dpe. Show all posts
Showing posts with label dpe. Show all posts

Monday, March 19, 2012

Data Processing Extensions and Data Sources

Anyone know about DPE? Specifically, I want to know if it can help me to
make a data source dynamic in a multi-user environment.
I need to integrate SRS into my web app, which allows the user to select a
database from a list before running a report. Several people could try to
run the same report at the same time. If I use the API
"SetDataReportSources" then this switches the data source for all users of
the report. As noted before in this group, this is a limitation of SQL RS.
What I really want to know is: Can I develop a DPE that allows me to
dynamically set the data source at run-time? This is a requirement for my
application, and I want to avoid creating multiple copies of reports or
passing the data source in a stored procedure. Either of these work-arounds
involve more maintenance and hassle for the future. Can DPE allow me to make
a permanent solution?
I looked in the books online, and read about implementing a connection
class. If I made my own connection object, could I set it dynamically at run
time?
Hopefully,
MalikI'm trying to do the same thing as well but we havn't had the time or
resource yet to finish it off. Once I have a DPE running I would be happy to
share it on gotdotnet. Or if you get there first maybe you could to.
Try this link for further info. This is where I got started. I have aslo
uploaded some VB code to Gavin's page to complement the C# he has already.
It's still not as straight forward as you might hope but it will acomplish
what you are after.
http://weblogs.asp.net/gavinjoyce/archive/2004/01/29/64339.aspx?Pending=true
Regards
Toby,.
"Abdul Malik Said" <diplacusis@.hotmNOSPAMail.com> wrote in message
news:O4sJVKDZEHA.556@.tk2msftngp13.phx.gbl...
> Anyone know about DPE? Specifically, I want to know if it can help me to
> make a data source dynamic in a multi-user environment.
> I need to integrate SRS into my web app, which allows the user to select a
> database from a list before running a report. Several people could try to
> run the same report at the same time. If I use the API
> "SetDataReportSources" then this switches the data source for all users of
> the report. As noted before in this group, this is a limitation of SQL RS.
> What I really want to know is: Can I develop a DPE that allows me to
> dynamically set the data source at run-time? This is a requirement for my
> application, and I want to avoid creating multiple copies of reports or
> passing the data source in a stored procedure. Either of these
work-arounds
> involve more maintenance and hassle for the future. Can DPE allow me to
make
> a permanent solution?
> I looked in the books online, and read about implementing a connection
> class. If I made my own connection object, could I set it dynamically at
run
> time?
> Hopefully,
> Malik
>

Data Processing Extensions - Parameters ?

Hi,
I am submitting a report to be run via sending the reportname and some
parameters via the RS WebService. Behind this I have a DPE. This all works
fine when there are no parameters. when I do pass params though, I have a
problem.
Trouble is that I cannot seem to lay my hands on the passed parameter values
(I presume a collection ?) when in my implementation class of the IDbCommand,
IDbCommandAnalysis interfaces
How can I obtain these params in the DPE ?
any help would be appreciated, thanks,The IDbCommandAnalysis interface serves the orthogonal purpose. It lets the
Report Designer know about the parameters that your query expects. During
runtime the Report Server calls IDataParameterCollection.Add to pass the
parameter values. This is where you will load them, e.g.:
public int Add(IDataParameter value)
{
Trace.WriteLine("DataSet Extension: Add(IDataParameter value");
if (((DsDataParameter)value).ParameterName != null)
{
return base.Add(value);
}
else
throw new ArgumentException("parameter must be named");
}
public DsDataParameter GetByName(string parameterName)
{
DsDataParameter parameter = null;
IEnumerator enumerator = this.GetEnumerator();
while (enumerator.MoveNext())
{
DsDataParameter tempParameter = (DsDataParameter) enumerator.Current;
if (tempParameter.ParameterName == parameterName)
{
parameter = tempParameter;
break;
}
}
return parameter;
}
Then, in your DataReader implementation you can get the parameters:
DsDataParameter parameter = m_parameters.GetByName(Util.DATA_SOURCE)
as DsDataParameter;
You can get a complete working DPE sample here:
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B8468707-56EF-4864-AC51-D83FC3273FE5
--
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/
----
"softgui" <softgui@.discussions.microsoft.com> wrote in message
news:FE3B6E92-4E95-42E7-8E1B-2868F9670CB0@.microsoft.com...
> Hi,
> I am submitting a report to be run via sending the reportname and some
> parameters via the RS WebService. Behind this I have a DPE. This all
works
> fine when there are no parameters. when I do pass params though, I have a
> problem.
> Trouble is that I cannot seem to lay my hands on the passed parameter
values
> (I presume a collection ?) when in my implementation class of the
IDbCommand,
> IDbCommandAnalysis interfaces
> How can I obtain these params in the DPE ?
> any help would be appreciated, thanks,
>|||Many thanks Teo.
- simon
"Teo Lachev [MVP]" <teo.lachev@.nospam.prologika.com> wrote in message
news:%23OFyCBoqEHA.3712@.TK2MSFTNGP15.phx.gbl...
> The IDbCommandAnalysis interface serves the orthogonal purpose. It lets
> the
> Report Designer know about the parameters that your query expects. During
> runtime the Report Server calls IDataParameterCollection.Add to pass the
> parameter values. This is where you will load them, e.g.:
> public int Add(IDataParameter value)
> {
> Trace.WriteLine("DataSet Extension: Add(IDataParameter value");
> if (((DsDataParameter)value).ParameterName != null)
> {
> return base.Add(value);
> }
> else
> throw new ArgumentException("parameter must be named");
> }
> public DsDataParameter GetByName(string parameterName)
> {
> DsDataParameter parameter = null;
> IEnumerator enumerator = this.GetEnumerator();
> while (enumerator.MoveNext())
> {
> DsDataParameter tempParameter = (DsDataParameter) enumerator.Current;
> if (tempParameter.ParameterName == parameterName)
> {
> parameter = tempParameter;
> break;
> }
> }
> return parameter;
> }
> Then, in your DataReader implementation you can get the parameters:
> DsDataParameter parameter = m_parameters.GetByName(Util.DATA_SOURCE)
> as DsDataParameter;
> You can get a complete working DPE sample here:
> http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=B8468707-56EF-4864-AC51-D83FC3273FE5
> --
> 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/
> ----
> "softgui" <softgui@.discussions.microsoft.com> wrote in message
> news:FE3B6E92-4E95-42E7-8E1B-2868F9670CB0@.microsoft.com...
>> Hi,
>> I am submitting a report to be run via sending the reportname and some
>> parameters via the RS WebService. Behind this I have a DPE. This all
> works
>> fine when there are no parameters. when I do pass params though, I have a
>> problem.
>> Trouble is that I cannot seem to lay my hands on the passed parameter
> values
>> (I presume a collection ?) when in my implementation class of the
> IDbCommand,
>> IDbCommandAnalysis interfaces
>> How can I obtain these params in the DPE ?
>> any help would be appreciated, thanks,
>>
>|||Hi Mr Softgui,
You can extend the DataParameter Extension to create your own types and then
cast them back into the (object) value property.
What do you think Teo?
Peter.
"softgui" wrote:
> Hi,
> I am submitting a report to be run via sending the reportname and some
> parameters via the RS WebService. Behind this I have a DPE. This all works
> fine when there are no parameters. when I do pass params though, I have a
> problem.
> Trouble is that I cannot seem to lay my hands on the passed parameter values
> (I presume a collection ?) when in my implementation class of the IDbCommand,
> IDbCommandAnalysis interfaces
> How can I obtain these params in the DPE ?
> any help would be appreciated, thanks,
>

Data Processing Extension & SQLClient

I have a business requirement that requires implementing column "masks"
depending on the user running the report. It seems as if a DPE would be my
best solution. Ie. I propose modifying the DataReader to blank dataset
columns in specific circumstances. To prove my concept I would need to
experiment with an extension the delivers the same functionality of the
supplied SQLClient extension. However all the examples that I can find are
based on XML files, event log readers etc. etc. Has anyone got code for an
extension that just reads a DB!Hi LiamD,
You can mask some of the fields using multiples alternatives, using or not
DPE;
1.- Stored Procedures (w/o DPE)
http://www.biasecurities.com/blogs/jim/archive/2004/04/22/453.aspx
2.- Web Services (w DPE) http://www.rdlcomponents.com
3.- Plain DPE http://weblogs.asp.net/gavinjoyce/archive/2004/01/29/64339.aspx
And you can skip the whole XML world
Thanks
Jerry
"LiamD" wrote:
> I have a business requirement that requires implementing column "masks"
> depending on the user running the report. It seems as if a DPE would be my
> best solution. Ie. I propose modifying the DataReader to blank dataset
> columns in specific circumstances. To prove my concept I would need to
> experiment with an extension the delivers the same functionality of the
> supplied SQLClient extension. However all the examples that I can find are
> based on XML files, event log readers etc. etc. Has anyone got code for an
> extension that just reads a DB!|||Jerry
Thanks for your reply. Unfortunately none of the DPE's you reference help -
i.e. None of the open an actual DB connection to run the sql from the
commandtext. This is what I want to do.
Liam|||Another alternative is write a SQL Extended SP and use the XML, for example
http://www.rdlcomponents.com/EXSP/default.aspx
You may find other ways to use XML or WS in SQL as well.
Jerry
"LiamD" wrote:
> Jerry
> Thanks for your reply. Unfortunately none of the DPE's you reference help -
> i.e. None of the open an actual DB connection to run the sql from the
> commandtext. This is what I want to do.
> Liam
>

Data Processing Extension - parameters not created

Hi,
I'm writing a Data Processing Extension (DPE) for Reporting Services 2000,
using the FsiExtension sample as a basis. My problem is that the
CreateParameter method of the command class doesn't get called, so when I am
to execute my datareader, the parameters aren't there. I have added the
parameters manually to the dataset in the report, but they don't get carried
over to the DPE. I've debugged the code, and the CreateParameter never gets
called. The strange thing is that I had it working earlier, because I then
could access the parameter collection in the debugger, but now suddenly it
fails.
public IDataParameter CreateParameter()
{
return (IDataParameter)(new dbpDataParameter());
}
Any tips?
Brgds
JonasI found the problem, my class only implemented IDbComamand. When I added
IDbCommandAnalysis and
a GetParameters method it worked like it should.
/Jonas
"Jonas" <Jonas@.nospam.pl> wrote in message
news:OyFcwrwiGHA.4512@.TK2MSFTNGP04.phx.gbl...
> Hi,
> I'm writing a Data Processing Extension (DPE) for Reporting Services 2000,
> using the FsiExtension sample as a basis. My problem is that the
> CreateParameter method of the command class doesn't get called, so when I
> am to execute my datareader, the parameters aren't there. I have added the
> parameters manually to the dataset in the report, but they don't get
> carried over to the DPE. I've debugged the code, and the CreateParameter
> never gets called. The strange thing is that I had it working earlier,
> because I then could access the parameter collection in the debugger, but
> now suddenly it fails.
> public IDataParameter CreateParameter()
> {
> return (IDataParameter)(new dbpDataParameter());
> }
>
> Any tips?
> Brgds
> Jonas
>