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

Friday, February 17, 2012

Creating Error Output for Custom Components

Hi,

I have a 2 custom components - source and destination.

I want to create an error output for each, to allow the users of my component to handle errors the way they choose.

I only found a property in IDTSOuptut90 named isErrorOut - a boolean property indicating whether this output is an error output or not.

Does anyone have additional documentation / articles / code samples regarding how to really populate the rows in the error output?

Thanks

You add the output in ProvideComponentProperties, as others, and that property is pretty much the key-

// Error Output
IDTSOutput90 outError = ComponentMetaData.OutputCollection.New();
outError.Name = ErrorOutput;
outError.Description = "Error output for rows that caused an unexpected error.";
outError.SynchronousInputID = inp.ID;
outError.ExclusionGroup = 1;
outError.IsErrorOut = true;

In ProcessInput you would then direct rows to thje normal output or the error output.

int iError = ComponentMetaData.OutputCollection[ErrorOutput].ID;
buffer.DirectErrorRow(iError, 0, buffer.CurrentRow);

I don’t believe there are no samples in the recent batch on Microsoft.com/downloads/ and from memory I’m sure the Source sample that ships with the product includes error output usage.

Creating Dynamic dimension Security with Custom Procedure

Hi All,

We are trying to implement dynamic dimension security using a Custom procedure written in C#.

If we create a single entry in the return set everything works fine (See Below)

Microsoft.AnalysisServices.AdomdServer.Expression Expression = new Microsoft.AnalysisServices.AdomdServer.Expression();

Expression.ExpressionText = "[Sub Branch Id].[All Branch].[4]";

Microsoft.AnalysisServices.AdomdServer.Member Member = Expression.CalculateMdxObject(null).ToMember();

TupleBuilder.Add(Member);

SetBuilder.Add(TupleBuilder.ToTuple());

However when we try and add a second item to the Tuple builder the object returns the error : The 'Sub Branch Id' Hierarchy appears more than once in the tuple.

Code snippet :

{

Microsoft.AnalysisServices.AdomdServer.Expression Expression = new Microsoft.AnalysisServices.AdomdServer.Expression();

Expression.ExpressionText = "[Sub Branch Id].[All Branch].[2]";

Microsoft.AnalysisServices.AdomdServer.Member Member = Expression.CalculateMdxObject(null).ToMember();

TupleBuilder.Add(Member);

Expression=null;

Member=null;

}

{

Microsoft.AnalysisServices.AdomdServer.Expression Expression = new Microsoft.AnalysisServices.AdomdServer.Expression();

Expression.ExpressionText = "[Sub Branch Id].[All Branch].[3]";

Microsoft.AnalysisServices.AdomdServer.Member Member = Expression.CalculateMdxObject(null).ToMember();

TupleBuilder.Add(Member);

Expression=null;

Member=null;

}

SetBuilder.Add(TupleBuilder.ToTuple());

Please can some one help resolve this issue as its becoming critical for the project that we are currently working on, otherwise we will have to revisit the security model.

TIA

Hello,

most likely you don't create a new tuple for each new member. Create a new instance of TupleBuilder to resolve it.

Radim

|||

Thanks for the Help Radmin, It was that.

The source example we're using was from Teo Lacevs book, applied MS Analysis Services 2005. On Teo's Forum we have found the correct syntax (though not in C#), and it does work.

This is the link to the solution, http://prologika.com/CS/forums/thread/1861.aspx

Tuesday, February 14, 2012

Creating Custom Sequence Container

I have a package that is going to have roughly 20 sequence containers in it. Each of these containers is going to have the same start task and the same end task. The data flow task(s) in each sequence container will differ. So I was thinking I would create a custom sequence container that would implement the common steps I need in each of my containers. I started to create a task that would inherit from Sequence, but I found that it is sealed. Bummer.

What is involved in creating a sequence task by inheriting from Task? I see that Sequence implements IDtsSequence. But looking at this interface, it seems like I would have to build the logic to execute the workflow contained in my sequence.

Any pointers?

-Darrell

Darrell,

What you're talking about here is task reuse right? So implementing a new type of container won't help you and you cannot do it anyway as far as I am aware.

The only unit of reuse in SSIS currently is a package so you will need to hive off that repeatable functionality into another package and call it using the Execute Package Task.

There are huge improvements to be made in the area of reusability and reuse of tasks rather packages is my numero uno for vNext. Read more here: http://blogs.conchango.com/jamiethomson/archive/2005/02/05/929.aspx

-Jamie

|||

I don't think I explained my issue well enough if you think that a new type of container won't help. I want to create a container that when it "starts" will update a status in a table and when it "ends" it will update the status again. I planned to use a custom property in my custom container object so that each instance of my container can differentiate itself in the status table. What my container "contains" would vary with each instance in the package. Hence, the control needs to be a container.

Bummer I can't make my own.

-Darrell

|||

Darrell Davis wrote:

I don't think I explained my issue well enough if you think that a new type of container won't help. I want to create a container that when it "starts" will update a status in a table and when it "ends" it will update the status again. I planned to use a custom property in my custom container object so that each instance of my container can differentiate itself in the status table. What my container "contains" would vary with each instance in the package. Hence, the control needs to be a container.

Bummer I can't make my own.

-Darrell

Containers in the context that we are talking about them do not and should not affect external data. That is not what they are for. They are to affect control-flow, nothing else.

Updating tables can be done very easily using the Execute SQL Task. Use the right tool for the job is I guess what I'm saying here.

If you want to achieve the thing that you are looking to achieve with what you refer to as a custom property, all you need to do is scope a variable to the Sequence container that holds that container's "ID". Each of your 20 sequence containers has an identically named variable scoped to it with a different value.

Hope that helps.

-Jamie

|||To be clear, sequence containers are not extensible, you cannot write your own. You could perhaps write the the start and end processes as task, that require minimal setup. This would make for faster development, and also encapsulat ethe logic in a reusable unit and also make them easy to maintain, that is just change the task code and redeploy, not maintain n packages or n instances of the task in a package.|||

Thanks, that's what I ended up doing. I created a new Task which has my start code and my end code. It has a property which indicates which MainPipe to execute in what would be the body of the sequence. It loads the TaskHost that contains the MainPipe at runtime and passes in the variables that are neccessary. It is not as elegant as it would be if I could subclass Sequence, but it seems to work pretty well for what I need. It reduces the number of tasks in my package from around 180 to 30. Also, as you poitned out, it allows me to modify my start and end code one place in my custom task and then just redeploy.

Thanks,
-Darrell

Creating Custom Scripts Problem

When I ran the sp_script_synctran_commands to generate my custom scripts for my Immediate Updating subscriber on the publisher, it appears the script generated that I need to run on the subscriber is being truncated.
What can I do about that?
in QA go to Tools - Options and click on the results tab. Make sure Maximum
characters per column is 8192.
"JLS" <jlshoop@.hotmail.com> wrote in message
news:uK2JrZx5FHA.3188@.TK2MSFTNGP15.phx.gbl...
When I ran the sp_script_synctran_commands to generate my custom scripts for
my Immediate Updating subscriber on the publisher, it appears the script
generated that I need to run on the subscriber is being truncated.
What can I do about that?
|||Thanx that worked!
Jude
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message news:%23Y2FwNz5FHA.2676@.TK2MSFTNGP15.phx.gbl...
in QA go to Tools - Options and click on the results tab. Make sure Maximum
characters per column is 8192.
"JLS" <jlshoop@.hotmail.com> wrote in message
news:uK2JrZx5FHA.3188@.TK2MSFTNGP15.phx.gbl...
When I ran the sp_script_synctran_commands to generate my custom scripts for
my Immediate Updating subscriber on the publisher, it appears the script
generated that I need to run on the subscriber is being truncated.
What can I do about that?

Creating custom merge profile

You can also in the Create Publication Wizard, select
Yes, minimize the amount of data on the Optimize
Synchronization page (@.keep_partition_changes = true),
and consider if column-level tracking is appropriate for
the business needs.
The timeout parameterss are usually adjusted only when
timeouts are an issue, and won't optimize your process.
You might want to look at this article to get more info
on Optimization:
http://www.microsoft.com/technet/pro.../sql/2000/main
tain/mergperf.mspx
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
Hi Paul,
thanks a lot.
Janez

Creating custom controls

Hi all,
Using SQL Server 2000, Visual Studio .NET and the Report Project Wizard I've
nearly been able to create the kind of reports I like.
What I'd like to do now is to create a custom control and have it appear on
the Report Items toolbox along with the other report controls (Textbox,
Line, Table, Matrix etc.). I've tried creating an empty class:
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using Microsoft.ReportDesigner;
using Microsoft.VisualStudio;
using Microsoft.ReportDesigner.Controls;
using Microsoft.ReportDesigner.Drawing;
using Microsoft.ReportDesigner.Serialization;
using System.Collections.Specialized;
using System.Xml.Serialization;
using Microsoft.ReportDesigner.Interop;
namespace ReportControl
{
public sealed class MyReportControl :
Microsoft.ReportDesigner.Controls.ReportControl
{
}
}
But when I build this as a dll and try and add it into the Report Items
toolbox I get the following error "File or assembly name
Microsoft.DataWarehouse, or one of its dependencies, was not found." I've
had a good look around on Google for any information on this error or
information on how to create a custom control for sql reporting services
without finding any. Could anybody please tell me if it is possible to
create custom controls for SQL 2000 reporting services? If so, is there any
information I can read on it?
I've read on:
http://msdn.microsoft.com/SQL/2005/2005Webcasts/ReportingServicesQandA.aspx
that:
"Sachin Asked: Can Reporting services be used to pull up reports from a C#
Windows Forms application?
Answered: Yes, this will be easily possible using the new Reporting Services
Winforms control which will ship in Visual Studio 2005."
Does this mean that I'll be able to use my own custom-created
System.Windows.Forms.Control within this new Reporting Services Winforms
control?
Many thanks for any head-ups on any of these questions,
Best Regards,
Christopher Ireland> "Sachin Asked: Can Reporting services be used to pull up reports from a C#
> Windows Forms application?
> Answered: Yes, this will be easily possible using the new Reporting
> Services
> Winforms control which will ship in Visual Studio 2005."
> Does this mean that I'll be able to use my own custom-created
> System.Windows.Forms.Control within this new Reporting Services Winforms
> control?
No. The Winforms control can only be used to process and render existing
reports.
However, RS 2005 will add a so-called CustomReportItem. You can write
controls that implement certain interfaces and can then plug into report
designer and into report processing.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Christopher Ireland" <cireland@.gmail.com> wrote in message
news:e7oxVjOQFHA.1500@.TK2MSFTNGP09.phx.gbl...
> Hi all,
> Using SQL Server 2000, Visual Studio .NET and the Report Project Wizard
> I've
> nearly been able to create the kind of reports I like.
> What I'd like to do now is to create a custom control and have it appear
> on
> the Report Items toolbox along with the other report controls (Textbox,
> Line, Table, Matrix etc.). I've tried creating an empty class:
> using System;
> using System.Collections;
> using System.ComponentModel;
> using System.Drawing;
> using System.Data;
> using System.Windows.Forms;
> using Microsoft.ReportDesigner;
> using Microsoft.VisualStudio;
> using Microsoft.ReportDesigner.Controls;
> using Microsoft.ReportDesigner.Drawing;
> using Microsoft.ReportDesigner.Serialization;
> using System.Collections.Specialized;
> using System.Xml.Serialization;
> using Microsoft.ReportDesigner.Interop;
> namespace ReportControl
> {
> public sealed class MyReportControl :
> Microsoft.ReportDesigner.Controls.ReportControl
> {
> }
> }
> But when I build this as a dll and try and add it into the Report Items
> toolbox I get the following error "File or assembly name
> Microsoft.DataWarehouse, or one of its dependencies, was not found." I've
> had a good look around on Google for any information on this error or
> information on how to create a custom control for sql reporting services
> without finding any. Could anybody please tell me if it is possible to
> create custom controls for SQL 2000 reporting services? If so, is there
> any
> information I can read on it?
> I've read on:
> http://msdn.microsoft.com/SQL/2005/2005Webcasts/ReportingServicesQandA.aspx
> that:
> "Sachin Asked: Can Reporting services be used to pull up reports from a C#
> Windows Forms application?
> Answered: Yes, this will be easily possible using the new Reporting
> Services
> Winforms control which will ship in Visual Studio 2005."
> Does this mean that I'll be able to use my own custom-created
> System.Windows.Forms.Control within this new Reporting Services Winforms
> control?
> Many thanks for any head-ups on any of these questions,
> Best Regards,
> Christopher Ireland
>|||"Robert Bruckner [MSFT]" <robruc@.online.microsoft.com> wrote in message
news:#Jh53L7QFHA.4028@.tk2msftngp13.phx.gbl...
> > "Sachin Asked: Can Reporting services be used to pull up reports from a
C#
> > Windows Forms application?
> > Answered: Yes, this will be easily possible using the new Reporting
> > Services
> > Winforms control which will ship in Visual Studio 2005."
> >
> > Does this mean that I'll be able to use my own custom-created
> > System.Windows.Forms.Control within this new Reporting Services Winforms
> > control?
> No. The Winforms control can only be used to process and render existing
> reports.
> However, RS 2005 will add a so-called CustomReportItem. You can write
> controls that implement certain interfaces and can then plug into report
> designer and into report processing.
Excellent. Thank you very much Robert, I'll look into it.
Best Regards,
Christopher Ireland.|||"Christopher Ireland" <cireland@.gmail.com> wrote in message
news:e8x6rO#QFHA.2384@.tk2msftngp13.phx.gbl...
> "Robert Bruckner [MSFT]" <robruc@.online.microsoft.com> wrote in message
> news:#Jh53L7QFHA.4028@.tk2msftngp13.phx.gbl...
> > However, RS 2005 will add a so-called CustomReportItem. You can write
> > controls that implement certain interfaces and can then plug into report
> > designer and into report processing.
> Excellent. Thank you very much Robert, I'll look into it.
Hi Robert,
It seems that when using the VS2005 Beta 2 (April 2005) along with the SQL
Server 2005 CTP (April 2005), CustomReportItem is sealed although there is a
ICustomReportItem interface.
I don't suppose you know where I could get an example of how to author a
custom control for SQL Server 2005 CTP (April 2005) ReportingServices using
VS2005 Beta 2 (April 2005), something along the lines of the SimpleControl
Sample for Windows Forms control?
Many thanks,
Chris.|||Well, since I worked on the design and the implementation, I certainly
should know how it works :). I want to add that CustomReportItem (CRI) in RS
2005 serves one main purpose: allow the integration of additional charting
capabilities. Hence, a CustomReportItem at this point can create an image
(with image maps) or a textbox, but not yet complex RDL report items at
processing time. The new data grouping RDL structure of the CustomReportItem
will also show how we will make table or matrix more powerful in future
releases.
The ICustomReportItem interface is the way to go. We are working on making
an interesting but yet not too complex sample publicly available that shows
how to implement a CRI design-time control (for report designer) and a CRI
processing control (for report server). We hope to have the sample and
documentation ready when we release RS 2005.
In the meantime you may want to look for a session at the upcoming TechEd
2005 conference presented by Andrew Bryan (Dundas Software). He will talk
about their work using the CRI approach (derived from complex prototypes we
have built) and how to build your own CRI controls:
http://www.msteched.com/content/sessions.aspx, Session BIN335 - "SQL Server
2005 Reporting Services Custom Report Items", Thursday, June 9, 5:00 PM -
6:15 PM.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Christopher Ireland" <cireland@.gmail.com> wrote in message
news:u2zQD%23%23TFHA.616@.TK2MSFTNGP12.phx.gbl...
> "Christopher Ireland" <cireland@.gmail.com> wrote in message
> news:e8x6rO#QFHA.2384@.tk2msftngp13.phx.gbl...
>> "Robert Bruckner [MSFT]" <robruc@.online.microsoft.com> wrote in message
>> news:#Jh53L7QFHA.4028@.tk2msftngp13.phx.gbl...
>> > However, RS 2005 will add a so-called CustomReportItem. You can write
>> > controls that implement certain interfaces and can then plug into
>> > report
>> > designer and into report processing.
>> Excellent. Thank you very much Robert, I'll look into it.
> Hi Robert,
> It seems that when using the VS2005 Beta 2 (April 2005) along with the SQL
> Server 2005 CTP (April 2005), CustomReportItem is sealed although there is
> a
> ICustomReportItem interface.
> I don't suppose you know where I could get an example of how to author a
> custom control for SQL Server 2005 CTP (April 2005) ReportingServices
> using
> VS2005 Beta 2 (April 2005), something along the lines of the SimpleControl
> Sample for Windows Forms control?
> Many thanks,
> Chris.
>|||"Robert Bruckner [MSFT]" <robruc@.online.microsoft.com> wrote in message
news:#r1drZAUFHA.3352@.TK2MSFTNGP12.phx.gbl...
> Well, since I worked on the design and the implementation, I certainly
> should know how it works :).
Excellent! Many thanks for taking some time out to answer mine (and others)
questions!!
> The ICustomReportItem interface is the way to go. We are working on making
> an interesting but yet not too complex sample publicly available that
shows
> how to implement a CRI design-time control (for report designer) and a CRI
> processing control (for report server). We hope to have the sample and
> documentation ready when we release RS 2005.
That would be fantastic.
In the meantime I wonder if you're up for giving me a couple of tips in the
meantime <g>. My first objective is to get my custom component on the Report
Items ToolBox, so I created a simple dummy class that looks like this:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.ReportingServices.Interfaces;
using Microsoft.ReportingServices.ReportProcessing;
using Microsoft.ReportingServices.ReportRendering;
namespace MyReportControl
{
public class MyNonDundasChart : ReportItem
{
public MyNonDundasChart() { }
}
public class MyReportControl : ICustomReportItem
{
private CustomReportItem customItem;
public ChangeType Process()
{
return ChangeType.None;
}
public Action Action
{
get { return new Action(); }
}
public CustomReportItem CustomItem
{
set { customItem = value;}
}
public ReportItem RenderItem
{
get { return new MyNonDundasChart(); }
}
}
}
However, when I try and add MyReportControl.dll into the Report Items
ToolBox, I get the following error:
There are no components in
"C:\Test\ReportProject1\MyReportControl\bin\Debug\MyReportControl.dll" that
can be placed on the toolbox.
Any chance of giving me a couple of "preview" pointers? Please <gg>?
> In the meantime you may want to look for a session at the upcoming TechEd
> 2005 conference presented by Andrew Bryan (Dundas Software). He will talk
> about their work using the CRI approach (derived from complex prototypes
we
> have built) and how to build your own CRI controls:
> http://www.msteched.com/content/sessions.aspx, Session BIN335 - "SQL
Server
> 2005 Reporting Services Custom Report Items", Thursday, June 9, 5:00 PM -
> 6:15 PM.
Maybe I'll look into getting the DVD set which may have this session on it;
Orlando, Florida is quite a way from Girona, Catalonia :-)
Best Regards,
Chris.|||Well, writing and integrating your design time control is not that simple.
Also registering it in the VS toolbox is not trivial at this point in VS
2005 Beta 2 and requires a set of manual steps (this will hopefully change
and be simplified with VS 2005 RTM). I would recommend you wait till we have
the sample ready.
Regarding the TechEd session - it seems to be pretty popular so far (based
on the registrations). Popular sessions are more likely to be recorded and
available on the post-conference DVD set.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Christopher Ireland" <cireland@.gmail.com> wrote in message
news:%23HQGV2iUFHA.3244@.TK2MSFTNGP15.phx.gbl...
> "Robert Bruckner [MSFT]" <robruc@.online.microsoft.com> wrote in message
> news:#r1drZAUFHA.3352@.TK2MSFTNGP12.phx.gbl...
>> Well, since I worked on the design and the implementation, I certainly
>> should know how it works :).
> Excellent! Many thanks for taking some time out to answer mine (and
> others)
> questions!!
>> The ICustomReportItem interface is the way to go. We are working on
>> making
>> an interesting but yet not too complex sample publicly available that
> shows
>> how to implement a CRI design-time control (for report designer) and a
>> CRI
>> processing control (for report server). We hope to have the sample and
>> documentation ready when we release RS 2005.
> That would be fantastic.
> In the meantime I wonder if you're up for giving me a couple of tips in
> the
> meantime <g>. My first objective is to get my custom component on the
> Report
> Items ToolBox, so I created a simple dummy class that looks like this:
> using System;
> using System.Collections.Generic;
> using System.Text;
> using Microsoft.ReportingServices.Interfaces;
> using Microsoft.ReportingServices.ReportProcessing;
> using Microsoft.ReportingServices.ReportRendering;
> namespace MyReportControl
> {
> public class MyNonDundasChart : ReportItem
> {
> public MyNonDundasChart() { }
> }
> public class MyReportControl : ICustomReportItem
> {
> private CustomReportItem customItem;
> public ChangeType Process()
> {
> return ChangeType.None;
> }
> public Action Action
> {
> get { return new Action(); }
> }
> public CustomReportItem CustomItem
> {
> set { customItem = value;}
> }
> public ReportItem RenderItem
> {
> get { return new MyNonDundasChart(); }
> }
> }
> }
>
> However, when I try and add MyReportControl.dll into the Report Items
> ToolBox, I get the following error:
> There are no components in
> "C:\Test\ReportProject1\MyReportControl\bin\Debug\MyReportControl.dll"
> that
> can be placed on the toolbox.
> Any chance of giving me a couple of "preview" pointers? Please <gg>?
>> In the meantime you may want to look for a session at the upcoming TechEd
>> 2005 conference presented by Andrew Bryan (Dundas Software). He will talk
>> about their work using the CRI approach (derived from complex prototypes
> we
>> have built) and how to build your own CRI controls:
>> http://www.msteched.com/content/sessions.aspx, Session BIN335 - "SQL
> Server
>> 2005 Reporting Services Custom Report Items", Thursday, June 9, 5:00 PM -
>> 6:15 PM.
> Maybe I'll look into getting the DVD set which may have this session on
> it;
> Orlando, Florida is quite a way from Girona, Catalonia :-)
> Best Regards,
> Chris.
>

Creating Custom code with DBNull and Report Parameters

How can I force report parameter to accept a null value. I tried using the check box for null values to no avail. I am creating a custom code to get around this problem. I used the simple IIf statement below:

=IIF (Parameters!MarketID.Value = "None", IsDBNull.Value, Parameters!MarketID.Value)

...I was getting an error message like this:

The value expression for the report parameter ‘MarketID’ contains an error: [BC30455] Argument not specified for parameter 'value' of 'Public Shared Function IsDBNull(value As Object) As Boolean'.

How can I frame the IIf statement?

Thx in advance

You could try replacing IsDBNull.Value with System.DBNull.Value