Showing posts with label extra. Show all posts
Showing posts with label extra. Show all posts

Sunday, March 11, 2012

Add Spaces before text

Hi,

I want to add some extra spaces before a text value. I'm using the below expression

=IIF(Fields!ParentLevel.Value=2or Fields!ParentLevel.Value=1,Space(4) & UCase(Fields!Business_Unit_Name.Value),(Fields!Business_Unit_Name.Value))

Spaces are added when I preveiw the report in VS.NET IDE. However, If I deploy the report on Report Server and view the report in Browser (IE7) I'm not able to see extra spaces that I'm seeing in preview.

Is there anything I'm missing here?

Quick help is highly appreciated.

Thanks and Regards,
Chakra

Hi,
This will more than likely be a html render "issue" as opposed to your code.
Instead of inserting spaces try inserting 4 non-breaking spaces...

Add Serial No in Report.rdlc

hi forum

how to add Serial No in "Report.rdlc". I want to add SNo. in as a extra field in Report.

SNo. ItemName Price

1 abc 10

2 xyz 20

I did not understand your question properly. You want the field to be coming from the database or it can be directly calculated in the report.

If you want it in the report directly then you can use the function RowNumber("table") if there is a detail section. if there is no detail section and there is a group then you can use the expression

RunningValue(AnyGroupField,Countdistinct,"Group1")

Saturday, February 25, 2012

add extra path to new component fails

I have a derived column component which has an regular output and an error output.

This works fine.

I want to add an extra regular output path.

I create a new OLEDB destination component and name it X

I right click on the derived column component and select "add path"

I then select X as the recipient of the new path.

And it errors with this garbage below

How can all the inputs be used up, it is a new component! It doesn't have any inputs!

Anyone know why this is happening (apart from the fact that it is not possible for me to go more than about 4 hours without encoutering another cryptic SSIS error that has no corresponding help topic on the MS website)

error message: (once again the MS help topic returns nothing)

===================================

All the available inputs on the target component are connected to outputs. Edit this component to define new inputs before proceeding. (Microsoft Visual Studio)


For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%u00ae+Visual+Studio%u00ae+2005&ProdVer=8.0.50727.762&EvtSrc=Microsoft.DataTransformationServices.Design.SR&EvtID=DtsComponentNoOutputsFree&LinkId=20476


Program Location:

at Microsoft.DataTransformationServices.Design.PipelineTaskDesigner.AddNewPath(PipelineComponentMetadata sourceDtsComponentObject, PipelineComponentMetadata destinationDtsComponentObject)
at Microsoft.DataTransformationServices.Design.DataFlowDiagram.OnAddPath(MenuCommand sender, CommandHandlingArgs args)
at Microsoft.DataWarehouse.Design.CommandHandlingInfoMap.HandleCommand(MenuCommand menuCommand)
at Microsoft.DataWarehouse.Design.ComponentDiagram.InvokeCommand(MenuCommand menuCommand)
at Microsoft.DataTransformationServices.Design.DataFlowDiagram.InvokeCommand(MenuCommand menuCommand)
at Microsoft.DataWarehouse.Design.ComponentDiagram.Microsoft.DataWarehouse.Interfaces.ICommandTarget.InvokeCommand(MenuCommand menuCommand)

Most transformations have only one output. If you would like for the same output information to go to more than one component you should use the multicast transform after the derived column and have that pass on the output to as many places as you would like.|||

how stupid that it is shown as a menu option, and that it even goes through the process of allowing you to select another component

|||

Adolf,

'Add Path' option is just the equivalent of joining DF components via red/green arrows; it is not for creating additional outputs in a component.

If you need an additional data stream, you would need to use the multicast transformation or perhaps an scritp component.

Add Extra Error Columns - From The Component?

I've read a MSDN article on enhancing error outputs with a script component. This solution added the script component astride the error output, and it was able to add a column with the error description text.

I would like to do something a little different. I'd like to add information from my custom component. When the component causes an error, it generally "knows why" - it has available to it the information that made it decide there was an error. I'd like to include that information in error outputs, but I haven't seen a way to do that.

Is this even possible using the error output directly? I could abandon error outputs and use Conditional Split, along with an "iserror" column plus my extra columns, but I'd prefer not to do that.

This might be possible. Try the following (I'm assuming your custom component is synchronous):

1. In your implementation of ProvideComponentProperties, create 2 outputs that are synchronous to the same input, put them in the same exclusion group and mark one of them as the error output. By marking it as an error output, you'll automatically get the 2 error output columns and the output should show up red in the designer. Then add a third column to that output for your error description.

2. In PreExecute, use FindColumnByLineageID to get the handle to the error description column you added. If you can't get the handle, then this isn't possible (I haven't tried it, but I can't think of anything in the API to keep you from getting it).

3. If you got the handle, use it in ProcessInput to set the error description before calling RedirectErrorRow.

|||

Ted Lee - MSFT wrote:

This might be possible. Try the following (I'm assuming your custom component is synchronous):

1. In your implementation of ProvideComponentProperties, create 2 outputs that are synchronous to the same input, put them in the same exclusion group and mark one of them as the error output. By marking it as an error output, you'll automatically get the 2 error output columns and the output should show up red in the designer. Then add a third column to that output for your error description.

That part worked. The extra column was added to the error output. Unfortunately:

Ted Lee - MSFT wrote:

2. In PreExecute, use FindColumnByLineageID to get the handle to the error description column you added. If you can't get the handle, then this isn't possible (I haven't tried it, but I can't think of anything in the API to keep you from getting it).

The above caused an error during PreExecute:

The output "TranslateProvidersErrorOutput" (347) is a synchronous output and the buffer type cannot be retrieved for a synchronous output.

The code I tried is:

Code Snippet

public override void ProvideComponentProperties()

{

ComponentMetaData.UsesDispositions = true;

IDTSInput90 input = ComponentMetaData.InputCollection.New();

input.Name = "TranslateProvidersInput";

input.ErrorRowDisposition = DTSRowDisposition.RD_FailComponent;

IDTSOutput90 output = ComponentMetaData.OutputCollection.New();

output.Name = "TranslateProvidersOutput";

output.SynchronousInputID = input.ID;

output.ExclusionGroup = 1;

// The new code:

IDTSOutput90 errorOutput = ComponentMetaData.OutputCollection.New();

errorOutput.Name = "TranslateProvidersErrorOutput";

errorOutput.SynchronousInputID = input.ID;

errorOutput.ExclusionGroup = 1;

errorOutput.IsErrorOut = true;

IDTSOutputColumn90 extraColumn = errorOutput.OutputColumnCollection.New();

extraColumn.Name = "ErrorDescription";

extraColumn.SetDataTypeProperties(DataType.DT_WSTR, 255, 0, 0, 0);

_extraColumnLineageID = extraColumn.LineageID;

// The original code:

//AddErrorOutput(

//"TranslateProvidersErrorOutput", input.ID, output.ExclusionGroup);

IDTSRuntimeConnection90 connection =

ComponentMetaData.RuntimeConnectionCollection.New();

connection.Name = "ADONET";

}

public override void PreExecute()

{

IDTSOutput90 errorOutput = ComponentMetaData.OutputCollection[1];

_extraColumnIndex =

BufferManager.FindColumnByLineageID(

errorOutput.Buffer, _extraColumnLineageID);

}

The hightlighted code is what failed.

I don't yet understand how buffers work with multiple outputs, so I can't figure out any other way to get the column index. I'm stuck at that point, for now.

If anyone has more ideas, I'll be glad to try them. One workaround I thought of was to add the extra columns to the default output and see if they get replicated to the error output when the default error output is created. This would have the unfortunate side-effect of proliferating error-only columns throughout the data flow, but should work well enough if the extra columns are truly required.

It will be necessary for components in the flow to not add one of these columns if it is already present.

|||

John,

I've got this working in my destination component: adding error messages, row #, time, etc.

The difference I think is in this line:

IDTSOutput90 errorOutput = ComponentMetaData.OutputCollection[1];

_extraColumnIndex =

BufferManager.FindColumnByLineageID(

errorOutput.Buffer, _extraColumnLineageID);

The equivalent in my code would be:

IDTSInput90 input = ComponentMetaData.InputCollection[0];

_extraColumnIndex =

BufferManager.FindColumnByLineageID(

input.Buffer, _extraColumnLineageID);

It is the input buffer that actually has the slots for the new error columns.

Martin

Add Extra Error Columns - From The Component?

I've read a MSDN article on enhancing error outputs with a script component. This solution added the script component astride the error output, and it was able to add a column with the error description text.

I would like to do something a little different. I'd like to add information from my custom component. When the component causes an error, it generally "knows why" - it has available to it the information that made it decide there was an error. I'd like to include that information in error outputs, but I haven't seen a way to do that.

Is this even possible using the error output directly? I could abandon error outputs and use Conditional Split, along with an "iserror" column plus my extra columns, but I'd prefer not to do that.

This might be possible. Try the following (I'm assuming your custom component is synchronous):

1. In your implementation of ProvideComponentProperties, create 2 outputs that are synchronous to the same input, put them in the same exclusion group and mark one of them as the error output. By marking it as an error output, you'll automatically get the 2 error output columns and the output should show up red in the designer. Then add a third column to that output for your error description.

2. In PreExecute, use FindColumnByLineageID to get the handle to the error description column you added. If you can't get the handle, then this isn't possible (I haven't tried it, but I can't think of anything in the API to keep you from getting it).

3. If you got the handle, use it in ProcessInput to set the error description before calling RedirectErrorRow.

|||

Ted Lee - MSFT wrote:

This might be possible. Try the following (I'm assuming your custom component is synchronous):

1. In your implementation of ProvideComponentProperties, create 2 outputs that are synchronous to the same input, put them in the same exclusion group and mark one of them as the error output. By marking it as an error output, you'll automatically get the 2 error output columns and the output should show up red in the designer. Then add a third column to that output for your error description.

That part worked. The extra column was added to the error output. Unfortunately:

Ted Lee - MSFT wrote:

2. In PreExecute, use FindColumnByLineageID to get the handle to the error description column you added. If you can't get the handle, then this isn't possible (I haven't tried it, but I can't think of anything in the API to keep you from getting it).

The above caused an error during PreExecute:

The output "TranslateProvidersErrorOutput" (347) is a synchronous output and the buffer type cannot be retrieved for a synchronous output.

The code I tried is:

Code Snippet

public override void ProvideComponentProperties()

{

ComponentMetaData.UsesDispositions = true;

IDTSInput90 input = ComponentMetaData.InputCollection.New();

input.Name = "TranslateProvidersInput";

input.ErrorRowDisposition = DTSRowDisposition.RD_FailComponent;

IDTSOutput90 output = ComponentMetaData.OutputCollection.New();

output.Name = "TranslateProvidersOutput";

output.SynchronousInputID = input.ID;

output.ExclusionGroup = 1;

// The new code:

IDTSOutput90 errorOutput = ComponentMetaData.OutputCollection.New();

errorOutput.Name = "TranslateProvidersErrorOutput";

errorOutput.SynchronousInputID = input.ID;

errorOutput.ExclusionGroup = 1;

errorOutput.IsErrorOut = true;

IDTSOutputColumn90 extraColumn = errorOutput.OutputColumnCollection.New();

extraColumn.Name = "ErrorDescription";

extraColumn.SetDataTypeProperties(DataType.DT_WSTR, 255, 0, 0, 0);

_extraColumnLineageID = extraColumn.LineageID;

// The original code:

//AddErrorOutput(

//"TranslateProvidersErrorOutput", input.ID, output.ExclusionGroup);

IDTSRuntimeConnection90 connection =

ComponentMetaData.RuntimeConnectionCollection.New();

connection.Name = "ADONET";

}

public override void PreExecute()

{

IDTSOutput90 errorOutput = ComponentMetaData.OutputCollection[1];

_extraColumnIndex =

BufferManager.FindColumnByLineageID(

errorOutput.Buffer, _extraColumnLineageID);

}

The hightlighted code is what failed.

I don't yet understand how buffers work with multiple outputs, so I can't figure out any other way to get the column index. I'm stuck at that point, for now.

If anyone has more ideas, I'll be glad to try them. One workaround I thought of was to add the extra columns to the default output and see if they get replicated to the error output when the default error output is created. This would have the unfortunate side-effect of proliferating error-only columns throughout the data flow, but should work well enough if the extra columns are truly required.

It will be necessary for components in the flow to not add one of these columns if it is already present.

|||

John,

I've got this working in my destination component: adding error messages, row #, time, etc.

The difference I think is in this line:

IDTSOutput90 errorOutput = ComponentMetaData.OutputCollection[1];

_extraColumnIndex =

BufferManager.FindColumnByLineageID(

errorOutput.Buffer, _extraColumnLineageID);

The equivalent in my code would be:

IDTSInput90 input = ComponentMetaData.InputCollection[0];

_extraColumnIndex =

BufferManager.FindColumnByLineageID(

input.Buffer, _extraColumnLineageID);

It is the input buffer that actually has the slots for the new error columns.

Martin