Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6781229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:35:58+00:00 2026-05-26T16:35:58+00:00

I have a data flow component, comprise of the following : 1.) Read Excel

  • 0

I have a data flow component, comprise of the following :

1.) Read Excel file
2.) “Script transformation component”
3.) Write to a flat file

Everything works fine, however I was trying to add header & footer.
Both header & footer are custom and have to be derived from the data in the file.

I can open the file in C# and write the low level code, but this seems to be a pretty common task & I thought there would be something generic.

Let me know if someone has done this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:35:59+00:00Added an answer on May 26, 2026 at 4:35 pm

    The approach listed in the Toolbox.com article will certainly work. (You’ll need to add another data flow, but data flows are cheap.)

    On the other hand, since you’ve already got a Script Component in your existing data flow, you can use that to generate the header and trailer rows.

    First, change the SynchronousInputID of the Script Component output to None so that you can generate additional rows:

    enter image description here

    Next, update the ProcessInputRow() method and add a FinishOutputs() method along these lines:

    [Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
    public class ScriptMain : UserComponent
    {
        private bool _headerWritten = false;
    
        public override void IncomingRows_ProcessInputRow(IncomingRowsBuffer Row)
        {
            if (!_headerWritten)
            {
                // Code to write the header row goes here
                _headerWritten = true;
            }
            OutgoingRowsBuffer.AddRow();
            // do whatever other processing you need for this row of input
        }
    
        public override void FinishOutputs()
        {
            base.FinishOutputs();
            // Code to write the footer row goes here
        }
    }
    

    This approach requires a bit more code but lets you do everything in one pass, which for sufficiently huge files may be important. (On the other hand, an Excel spreadsheet shouldn’t be that big …)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my data flow i read data from flat file and insert to oledb
I have a Data Flow Task that does some script component tasks, sorts, then
I have a simple data flow. The source is a small flat file with
I have an SSIS package which reads an Excel File (Data Flow Source) and
I have a SSIS package which reads an Excel File (Data Flow Source) and
I have data of program usage in excel file, the data has date and
I have the following Data Flow task in my SSIS package: alt text http://img228.imageshack.us/img228/358/ssis1.png
I have a data flow with a derived column. I want to convert the
I have a SSIS Data Flow Task with an OleDb Source, Conditional Split (w/
In a Data Flow, I have an Derived Column task. In the expression for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.