Missing Header Row When Exporting Data to Excel and Program Runs Slow

Hello all,
I am new to programming. I’ve dabbled with VB.NET at times over the years but this is the first time I’m trying C#. Although, it’s been quite a while since I’ve done any type of programming other than writing SQL queries at work. For the sake of trying to
learn I have given myself a project that is something I can actually use at work. Right now I'm doing it at home. I’m querying a database on SQL Server 2008 R2; putting the data from the DB into a DataViewGrid and then exporting the data into Excel and saving
the file on my C:\ drive. On the form I have two buttons; one that queries the DB and the other to do the export. The code below does work but I have two issues that I need assistance with:
All of the SQL table data goes into Excel properly with the exception of it is missing the header row.
After I click the Export button it takes a long time to create the Excel file. It takes between 2.5 and 3 minutes. It is not a big file (only 447 rows and 125 KB in size) so I don’t know why it takes so long. Does it have anything to do with the number
of times Microsoft.Office.Interop.Excel is being referenced? I read somewhere online that is an old COM method although I’m not familiar with what a COM method is
and why it would make things run so slow.
When I click the button to run the SQL query and load the DataGridView it runs immediately.
I plan on taking this project further such as adding date parameters including validation on the dates and then maybe adding buttons that can be used to insert, update and delete records. But I don’t want to go any further until the two issues mentioned
above are resolved. Any assistance / guidance will be greatly appreciated. Here’s the code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using Exccel = Microsoft.Office.Interop.Excel;
using System.IO;
namespace Bills_DB_DataGridView
    public
partial
class
Form1 :
Form
SqlCommand sqlCMD;
SqlDataAdapter sqlDA;
        SqlCommandBuilder sqlCB;
DataSet sqlDS;
DataTable sqlDT;
public Form1()
InitializeComponent();           
private
void btnExit_Click(object sender,
EventArgs e)
this.Close();
private
void btnLoad_Click(object sender,
EventArgs e)
string sqlCon =
"Data Source = localhost\\DAVE_DB; Initial Catalog=Bills;Integrated security = true;";
string sqlQry =
"SELECT * FROM Acct ORDER BY Name, PaymentDate";
SqlConnection connection =
new
SqlConnection(sqlCon);
connection.Open();
sqlCMD = new
SqlCommand(sqlQry, connection);
sqlDA = new
SqlDataAdapter(sqlCMD);
       sqlCB = new
SqlCommandBuilder(sqlDA);
sqlDS = new
DataSet();
sqlDA.Fill(sqlDS, "Acct");
sqlDT = sqlDS.Tables["Acct"];
connection.Close();
dataGridView1.DataSource = sqlDS.Tables["Acct"];
            dataGridView1.SelectionMode =
DataGridViewSelectionMode.FullRowSelect;
private
void btnExport_Click(object sender,
EventArgs e)
Microsoft.Office.Interop.Excel.Application xlApp;
Microsoft.Office.Interop.Excel.Workbook xlWorkBook;
Microsoft.Office.Interop.Excel.Worksheet xlWorkSheet;
object misValue = System.Reflection.Missing.Value;
Int32 i, j;
xlApp = new Microsoft.Office.Interop.Excel.Application();        
xlWorkBook = xlApp.Workbooks.Add(misValue);
xlWorkSheet = (Microsoft.Office.Interop.Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);          
for (i = 0; i <= dataGridView1.RowCount - 2; i++)
for (j = 0; j <= dataGridView1.ColumnCount - 1; j++)
xlWorkSheet.Cells[i + 1, j + 1] = dataGridView1[j, i].Value.ToString();
xlWorkSheet.Cells[1, 2].EntireColumn.NumberFormat = "@";
//Format column 2 to text
xlWorkSheet.Cells[1, 2].HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignRight;
xlWorkBook.SaveAs(@"c:\Bills\Bills.xls", Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookNormal,
misValue, misValue, misValue, misValue, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);
xlWorkBook.Close(true, misValue, misValue);
xlApp.Quit();
releaseObject(xlWorkSheet);
releaseObject(xlWorkBook);
releaseObject(xlApp);
private
void releaseObject(object obj)
try
System.Runtime.InteropServices.Marshal.ReleaseComObject(obj);
obj = null;
catch (Exception ex)
obj = null;
MessageBox.Show("Exception Occured while releasing object "
+ ex.ToString());
finally
GC.Collect();
Thank you,
Dave
David Young

Hello again Kristin,
I tried the code snippet to include the headers in the Excel file but it didn't work for me. Maybe I put the code in the wrong place? Again I have put the code below including where I placed the snippet. I get no error message and the application runs. Am
I doing something wrong?
Thank you,
Dave
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using Exccel = Microsoft.Office.Interop.Excel;
using System.IO;
namespace Bills_DB_DataGridView
    public partial class Form1 : Form
        SqlCommand sqlCMD;
        SqlDataAdapter sqlDA;
        SqlCommandBuilder sqlCB;
        DataSet sqlDS;
        DataTable sqlDT;
        public Form1()
            InitializeComponent();            
        private void btnExit_Click(object sender, EventArgs e)
            this.Close();
        private void btnLoad_Click(object sender, EventArgs e)
            string sqlCon = "Data Source = localhost\\DAVE_DB; Initial Catalog=Bills;Integrated security = true;";
            string sqlQry = "SELECT * FROM Acct ORDER BY Name, PaymentDate";
            SqlConnection connection = new SqlConnection(sqlCon);
            connection.Open();
            sqlCMD = new SqlCommand(sqlQry, connection);
            sqlDA = new SqlDataAdapter(sqlCMD);
            sqlCB = new SqlCommandBuilder(sqlDA);
            sqlDS = new DataSet();
            sqlDA.Fill(sqlDS, "Acct");
            sqlDT = sqlDS.Tables["Acct"];
            connection.Close();
            dataGridView1.DataSource = sqlDS.Tables["Acct"];
            dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
        private void btnExport_Click(object sender, EventArgs e)
            Microsoft.Office.Interop.Excel.Application xlApp;
            Microsoft.Office.Interop.Excel.Workbook xlWorkBook;
            Microsoft.Office.Interop.Excel.Worksheet xlWorkSheet;
            object misValue = System.Reflection.Missing.Value;
            Int32 i, j;
            xlApp = new Microsoft.Office.Interop.Excel.Application();         
            xlWorkBook = xlApp.Workbooks.Add(misValue);
            // storing header part in Excel
            xlWorkSheet = (Microsoft.Office.Interop.Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);  
            for (int h = 1; h < dataGridView1.Columns.Count + 1; h++)
                if (dataGridView1.Columns[h - 1].Visible)
                    xlWorkSheet.Cells[1, h] = dataGridView1.Columns[h - 1].HeaderText;
            xlWorkSheet = (Microsoft.Office.Interop.Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);           
            for (i = 0; i <= dataGridView1.RowCount - 2; i++)
                for (j = 0; j <= dataGridView1.ColumnCount - 1; j++)
                    xlWorkSheet.Cells[i + 1, j + 1] = dataGridView1[j, i].Value.ToString();
                    xlWorkSheet.Cells[1, 2].EntireColumn.NumberFormat = "@"; //Format column 2 to text
                    xlWorkSheet.Cells[1, 2].HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignRight;
            xlWorkBook.SaveAs(@"c:\Bills\Bills.xls", Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlExclusive,
misValue, misValue, misValue, misValue, misValue);
            xlWorkBook.Close(true, misValue, misValue);
            xlApp.Quit();
            releaseObject(xlWorkSheet);
            releaseObject(xlWorkBook);
            releaseObject(xlApp);
        private void releaseObject(object obj)
            try
                System.Runtime.InteropServices.Marshal.ReleaseComObject(obj);
                obj = null;
            catch (Exception ex)
                obj = null;
                MessageBox.Show("Exception Occured while releasing object " + ex.ToString());
            finally
                GC.Collect();
David Young

Similar Messages

  • Questions when export data to excel

    My platform
    Windows2000(Chinese version).
    Oracle 9i R2 charset ZHS16GBK
    Patch 2323002,2632931,2499827
    JDev903 + BI Beans 903a
    There are two problems
    1. Everything goes well. But when the project is deployed, the Export function will return a error page.
    2. When export data to .csv or .txt using BIB control "ExportOptions", it appears that the chinese fonts all are displayed as "????"

    We need more information on issue #1. What information does the the
    error page contain? If it contains a stack trace / BI Beans error, then
    please post it. If it does not, then please look for an exception
    stack / error in the servlet log. And finally, does the export work
    when running the project in JDeveloper?
    Issue #2 can be resolved by setting the export character encoding.
    What type of application are you trying to deploy (
    JSP, UIX, or Generated Servlet Application )? The mechanism for
    specifying the export character encoding is different for each type of
    application. UTF-8 encoding works on most systems so that is a safe
    default, but the Chinese version of Windows may require a more specific
    character set, such as WINDOWS-936 ( Simplified Chinese ), BIG5 (
    Traditional Chinese ), or WINDOWS-950 ( Traditional Chinese).

  • Export data to excel and table column headers

    I noticed that with LV 2012 when I call the method "Export Data to Excel" for a table, the table headers (= column names) are not exported to excel.
    Am I right? I think that the column names should be exported too...
    As a matter of fact when you call the method "Export to simplified image" the column names are included
    How can I export the table column names to excel?
    Vix
    In claris non fit interpretatio
    Using LV 2013 SP1 on Win 7 64bit
    Using LV 8.2.1 on WinXP SP3
    Using CVI 2012 SP1 on Win 7 64bit, WinXP and WinXP Embedded
    Using CVI 6.0 on Win2k, WinXP and WinXP Embedded

    In this document there is a full description of how to export data from LabVIEW to Excel.
    Using a table, the method "Export data to excel" should export the "currently selected data", and data can be programmatically selected using ActiveCell property (as described here).
    With ActiveCell I can select the column headers too (using negative numbers for row and/or column), and I do this.
    And so I expect that when I select "Export data to Excel", the column headers should be exported too (because I selected them!).
    I think that the actual behavior is a bug, rather that an expected behavior.
    Don't you agree?
    Vix
    In claris non fit interpretatio
    Using LV 2013 SP1 on Win 7 64bit
    Using LV 8.2.1 on WinXP SP3
    Using CVI 2012 SP1 on Win 7 64bit, WinXP and WinXP Embedded
    Using CVI 6.0 on Win2k, WinXP and WinXP Embedded

  • Issue in cell format when exporting data to excel

    Hello there,
    I have an ABAP program that selects data from tables into an internal table and writes the data in CSV (excel) file.
    I have a very weird issue when writing the file: The data is written properly, though the dates in my data, which is written in yyyymmdd format, has different cell format in the csv file itself. I'll expain:
    Let's say I've written into CSV file a table with name and birthdate, and I have 2000 records. From record 1 to 1475, when I right-click on the date cells in those lines, and choose "cell format", I can see it's in "general" format. From line 1476 on, when I do that I see that the date cells are in format of "custom" with pattern 'yyyymmdd'.
    I want all the cells to be "general". How do I do that?
    Thanks in advance

    Hi Daniel,
    Try using these Function Module......................
    Before filling final internal table write those condition.................................
    Data:  gv_date   TYPE mch1-vfdat,
             gv_vdate(10) TYPE c.
    CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
           EXPORTING
             date_internal            = gv_date
           IMPORTING
             date_external            = gv_vdate
           EXCEPTIONS
             date_internal_is_invalid = 1
             OTHERS                   = 2.
         IF sy-subrc <> 0.
    * Implement suitable error handling here
         ENDIF.

  • Date issue when exporting data to Excel from SSRS report, where date is less than 1/1/1900

    Hi,
    I am using SSRS report to display the data from database. In that data, One of the column is DATE. when I am exporting to Excel all that dates are displaying fine except 1/1/1800 12:00 AM. Instead of 1/1/1800 12:00 AM it is displaying XXXXXXXXXXXXXX values.
    Please help me to fix the issue.
    Please let me know if more clarification required.
    Thanks In advance.

    Hello,
    We can use Cstr() function to convert the Date type data to String data. Suppose we have a field named DateTime, please refer to the expression below:
    =Cstr(Fields!DateTime.Value)
    Then we can get a string type data. There is an article about SSRS expression, you can refer to it.
    http://msdn.microsoft.com/en-us/library/ms157328.aspx
    If you have any questions, please feel free to let me know.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • Missing data when exporting webi to excel (not 65536 limit problem)

    Hi guys
    I just meet a problem about webi that it will miss data when exporting webi to excel.
    It's not about 65536 limitation, as my webi report do some aggregration and limitation and never beyond that limitation.
    Also there are 2 tabs in my reports, if I split the 2 tabs into 2 separate reports and export them separately, then problem disappeared.
    Any ideas on this?

    Hello Claes
    according to:
    http://help.sap.com/erp2005_ehp_05/helpdata/en/c1/eda0f591ec12408b25e7a1b369ca45/frameset.htm
    Tools => Import and Export => Specifying the Sequence of the External Data Structure => External File Structure: Specification
    Table EST07 should be part of export file. I am not sure if the packing requirement ist part of EST07.
    Furthermore wirh ECC 6.0 EnhPAck3 some changes happend generally in the area of DG classification.
    E.g. Dynamic dangerous goods classification. I am not sure if these changes are "included" in some sense in the EH&S data download.
    With best regards
    C.B.
    PS: please check this link on the top:
    http://help.sap.com/erp2005_ehp_05/helpdata/en/c1/eda0f591ec12408b25e7a1b369ca45/frameset.htm
    Refer to "Table Assignment: Specifications"
    I believe packaging requirement is part of table EST0B but this is part of the download file.
    Edited by: Christoph Bergemann on Aug 27, 2011 7:12 PM
    Edited by: Christoph Bergemann on Aug 27, 2011 7:13 PM

  • How to repeat binding dates in header row when tadaset in table must be paginated?

    I need to make a form which is filled by XDP file (this file is made by other SW (payroll)).
    This form contains table. There are some binded (filled) text fields in a header row and some filled text fields in a body row. (For example - name is in header row, some personal dates are in body row). Body row is dynamic, count of body rows is different for each name.
    When the table overflows the page, I need to repeat the header row with name on the second page.
    And here is a problem. Header row is repeated, but text field (with name) is empty.
    Files for example are : http://www.ulozto.net/soubory/strelenkas/documents/
    Thank you very much

    loop at ot into wa.
    at first header one
    write second header.
    endloop.
    declear one internal table append both values in come internal table .
    pass the header in comen internal table.
    Message was edited by:
            Karthikeyan Pandurangan

  • Export data to Excel

    Hello All,
                I am trying to export data to Excel from a report output. Its a simple report. I have tried the below FM
    CALL FUNCTION 'RH_START_EXCEL_WITH_DATA'
    EXPORTING
      DATA_FILENAME             =
      DATA_PATH_FLAG            = 'W'
      DATA_ENVIRONMENT          =
      DATA_TABLE                =
      MACRO_FILENAME            =
      MACRO_PATH_FLAG           = 'E'
      MACRO_ENVIRONMENT         =
      WAIT                      = 'X'
      DELETE_FILE               = 'X'
    EXCEPTIONS
      NO_BATCH                  = 1
      EXCEL_NOT_INSTALLED       = 2
      INTERNAL_ERROR            = 3
      CANCELLED                 = 4
      DOWNLOAD_ERROR            = 5
      NO_AUTHORITY              = 6
      FILE_NOT_DELETED          = 7
      OTHERS                    = 8
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    This FM when executed without passing any data is able to open an empty excel sheet but when I try to pass an internal table to DATA_TABLE  its giving a dump. The run time error is CALL_FUNCTION_CONFLICT_TYPE.
    Error:
    **"The function module interface allows you to specify only fields      
    of a particular type under "TABNAME". The field "ITAB1" specified here
    has a different field type."**
    Please let me know if Im missing something.
    Thanks in advance.

    Hi SAP,
    Simply List -> Save -> File -> spreadsheet -> file.xls
    Or check this weblog..
    <a href="/people/dennis.vandenbroek/blog/2007/02/14/simple-function-module-to-export-any-internal-table-to-ms-excel:///people/dennis.vandenbroek/blog/2007/02/14/simple-function-module-to-export-any-internal-table-to-ms-excel
    or
    try this code..
    DATA : file_name TYPE ibipparms-path,
    lc_filename TYPE string.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    PROGRAM_NAME = SYST-CPROG
    DYNPRO_NUMBER = SYST-DYNNR
    FIELD_NAME = ' '
    IMPORTING
    file_name = file_name .
    lc_filename = file_name.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE =
    filename = lc_filename
    filetype = 'DAT'
    TABLES
    data_tab = gt_itab.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Revert back for more help
    Reward points if helpful
    Regards
    Naresh

  • Problem while exporting data to Excel sheet.......

    Hi
    I have written the following code to export data to excel sheet...
    data:
           conv_out TYPE REF TO cl_abap_conv_out_ce,
           content TYPE xstring.
    data : itab_slsrl type table of znslsrlitm.
    data: xml_out TYPE string.
    Data:
    Node_slsrl type ref to If_Wd_Context_Node,
    Elem_slsrl type ref to If_Wd_Context_Element,
    Stru_slsrl type ref to if_wd_context_element .
    call transformation ('ID') source tab = itab_slsrl[] result xml xml_out.
    CALL FUNCTION 'CRM_IC_XML_STRING2XSTRING'
    EXPORTING
    INSTRING = xml_out
    IMPORTING
    OUTXSTRING = content.
    conv_out = cl_abap_conv_out_ce=>create( encoding = 'UTF-8' ).
    DATA: lv_filename TYPE string.
    conv_out->convert( exporting data = xml_out IMPORTING buffer = content ).
    cl_wd_runtime_services=>attach_file_to_response(
    i_filename = 'Sales_order_release.xls'
    i_content = content
    i_mime_type = 'application/msexcel'
    i_in_new_window = i_in_new_window
    i_inplace = i_inplace ).
    But when i am trying to export data to excel sheet i am getting
    following error...
    "Switch from current encode to specified encoding is not supported"
    "<?xml version="1.0" encoding='utf-16"?>"
    if i change encoding utf-8 to utf-16 in my code its giving dump..
    "The conversion of certain code pages is not supported"
    Did i miss any step...?
    How to resolve this problem please help me....
    Thanks & Regards
    Sowmya.....

    Hi Sowmya,
    I do had a similar issue, but I avoided that problem temporarily by commenting the following code.
        l_conv_out = cl_abap_conv_out_ce=>create( encoding = 'UTF-8'  ).
    attach the first file
    l_conv_out->convert( exporting data = l_xml_out IMPORTING buffer = l_content  ).
    Once this is done, you can export the data to Excel and open it and see too...But this is a temporary solution only. Implement this solution to get to understand more flaws of this.
    Regards
    Raja Sekhar
    Edited by: Raja Sekhar on Dec 26, 2007 7:51 PM

  • Export data to excel in alv

    hi everybody ,
    could you give me an example about export data to excel with no ole objects?

    You can use FM - ALV_XXL_CALL , it exports the data with formatting and column heading.
    REPORT  ZSKC_ALV_XXL.
    TYPE-POOLS : KKBLO.
    DATA : ITAB LIKE T100 OCCURS 0,
           T_FCAT_LVC TYPE LVC_S_FCAT OCCURS 0 WITH HEADER LINE,
           T_FCAT_KKB TYPE KKBLO_T_FIELDCAT.
    START-OF-SELECTION.
    * Get data.
      SELECT * UP TO 20 ROWS
      FROM   T100
      INTO   TABLE ITAB
      WHERE  SPRSL = SY-LANGU.
      CHECK SY-SUBRC EQ 0.
    * Create the field catalog.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
       EXPORTING
          I_STRUCTURE_NAME             = 'T100'
        CHANGING
          CT_FIELDCAT                  = T_FCAT_LVC[]
        EXCEPTIONS
          INCONSISTENT_INTERFACE       = 1
          PROGRAM_ERROR                = 2
          OTHERS                       = 3.
      CHECK SY-SUBRC EQ 0.
    * make sure you pass the correct internal table name in the field catalog.
      t_fcat_lvC-tabname = 'ITAB'.
      MODIFY T_FCAT_LVC TRANSPORTING TABNAME WHERE TABNAME NE SPACE.
    * Transfer to KKBLO format.
      CALL FUNCTION 'LVC_TRANSFER_TO_KKBLO'
        EXPORTING
          IT_FIELDCAT_LVC                 = T_FCAT_LVC[]
        IMPORTING
          ET_FIELDCAT_KKBLO               = T_FCAT_KKB
       EXCEPTIONS
         IT_DATA_MISSING                 = 1
         IT_FIELDCAT_LVC_MISSING         = 2
         OTHERS                          = 3.
      CHECK SY-SUBRC EQ 0.
    * Call XXL.
      CALL FUNCTION 'ALV_XXL_CALL'
        EXPORTING
          I_TABNAME                    = 'ITAB'
          IT_FIELDCAT                  = T_FCAT_KKB
        TABLES
          IT_OUTTAB                    = ITAB[]
        EXCEPTIONS
          FATAL_ERROR                  = 1
          NO_DISPLAY_POSSIBLE          = 2
          OTHERS                       = 3.
      IF SY-SUBRC <> 0.
      ENDIF.

  • Error message when importing data using Import and export wizard

    Getting below error message when importing data using IMPORT and EXPORT WIZARD
    Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    <dir>
    <dir>
    Messages
    Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80004005  Description: "Could not allocate a new page for database REPORTING' because of insufficient disk space in filegroup 'PRIMARY'.
    Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.".
    (SQL Server Import and Export Wizard)
    Error 0xc0209029: Data Flow Task 1: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "Destination - Buyer_.Inputs[Destination Input]" failed because error code 0xC020907B occurred, and the error row disposition on "Destination
    - Buyer_First_Qtr.Inputs[Destination Input]" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure.
    (SQL Server Import and Export Wizard)
    Error 0xc0047022: Data Flow Task 1: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "Destination - Buyer" (28) failed with error code 0xC0209029 while processing input "Destination Input" (41). The
    identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information
    about the failure.
    (SQL Server Import and Export Wizard)
    Error 0xc02020c4: Data Flow Task 1: The attempt to add a row to the Data Flow task buffer failed with error code 0xC0047020.
    (SQL Server Import and Export Wizard)
    </dir>
    </dir>
    Error 0xc0047038: Data Flow Task 1: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on Source - Buyer_First_Qtr returned error code 0xC02020C4.  The component returned a failure code when the pipeline engine called PrimeOutput().
    The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.
    (SQL Server Import and Export Wizard)
    Smash126

    Hi Smash126,
    Based on the error message” Could not allocate a new page for database REPORTING' because of insufficient disk space in filegroup 'PRIMARY'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting
    autogrowth on for existing files in the filegroup”, we can know that the issue is caused by the there is no sufficient disk space in filegroup 'PRIMARY' for the ‘REPORTING’ database.
    To fix this issue, we can add additional files to the filegroup by add a new file to the PRIMARY filegroup on Files page, or setting Autogrowth on for existing files in the filegroup to increase the necessary space.
    The following document about Add Data or Log Files to a Database is for your reference:
    http://msdn.microsoft.com/en-us/library/ms189253.aspx
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Problem in exporting data to excel in nwds 7.3

    Hi All,
    I was using the following code for exporting data to excel in NWDS 7.3
    private IWDCachedWebResource getCachedWebResource(byte[] file, String name,
    WDWebResourceType type) {
    IWDCachedWebResource cachedWebResource = null;
    if (file != null) {
    cachedWebResource = WDWebResource.getWebResource(file, type);
    cachedWebResource.setResourceName(name);
    return cachedWebResource;
    I was getting the error in the following line cachedWebResource = WDWebResource.getWebResource(file, type); when I clicked the quick help it ststed the getWebResource method is depricated.  Kindly provide some assistance on what is the new method in its place.
    Thank you
    Regards,
    Preet Kaur

    Hi Ganesh,
    Thanks that worked fine, but when we go further we are facing problem ie
    byte[] excelXMLFile;
    IWDCachedWebResource cachedExcelResource = null;
    String fileName = dataNode.getNodeInfo().getName() + ".xls";
    try {
    // create Excel 2003 XML data as a byte array for the given context node,
    // attributes and headers
    excelXMLFile = toExcel(dataNode, columnInfos).getBytes("UTF-8");
    // create a cached Web Dynpro XLS resource for the given byte array
    // and filename
    cachedExcelResource = getCachedWebResource(
    excelXMLFile, fileName, WDWebResourceType.XLS);
    // Store URL and file name of cached Excel resource in context.
    if (cachedExcelResource != null) {
    wdContext.currentContextElement().setExcelFileURL(
    cachedExcelResource.getURL());
    wdContext.currentContextElement().setExcelFileName(
    cachedExcelResource.getResourceName());
    // Open popup window with a link to the cached Excel file Web resource.
    openExcelLinkPopup();
    } else {
    wdComponentAPI.getMessageManager().reportException(
    "Failed to create Excel file from table!", true);
    } catch (UnsupportedEncodingException e) {
    wdComponentAPI.getMessageManager().reportException(
    e.getLocalizedMessage(), true);
    } catch (WDURLException e) {
    wdComponentAPI.getMessageManager().reportException(
    e.getLocalizedMessage(), true);
    The above bold lines also would need to be converted to inputstream, but not sure how to correct that
    We are following the below pdf for the implementation.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/edc2f3c2-0401-0010-8898-acd5b6a94353?QuickLink=index&overridelayout=true
    Thank you
    Regards,
    Jaspreet Kaur

  • Taglib to export data into excel?

    Has anyone used a taglib to export data into excel, I have seen one post but when I went to the web site @http://www.servletsuite.com/servlets/exceltag.htm
    It only has the jar file and .tld file is invalid.
    When I just give the jar file, it complains that it can not find the .tld file, so I was wondering if anyone here has some knowledge about this?
    Thanks a lot for your help!

    The displaytag library can do excel exports.
    http://displaytag.sourceforge.net/11/

  • Export data into Excel from PL/SQL Block

    Hi,
    Please tell me how to export data into excel comming out from PL/SQL code in APEX.
    We can simply export data into excel if we have Report region, but my query is dynamic for which i had to use PL/SQL block. Now i want to export that data into excel.
    Thanks & Regards,
    Smith

    Hi,
    Take a look here http://spendolini.blogspot.com/2006/04/custom-export-to-csv.html
    Regards
    Paul

  • Set the name of cell or cells' range for a report and when export it to excel the names will be defined.

    Hello,
    I have an C# application that exports report from Reporting Services to Excel files.
    I would like to know if there is a possibility to set the name of the cell or range of cells in the report (via Report Builder or somewhere else) and when open the Excel the names are set. Similar functinality when you open the Excel and go Formulas/Define
    Name and set the name for a unique cell or range.
    Regards,

    Hi there,
    I don't believe this is possible in Reporting Services.  One workaround, if you don't know the exact range at runtime, might be to put hidden characters (white?) in your sheet at start and end of range, then do some postprocessing on the file using
    VSTO or perhaps a 3rd-party tool like this one.  
    http://www.aspose.com/reporting-services/excel-component.aspx
    If you do know the range it should be much easier.
    cheers,
    Andrew
    Andrew Sears, T4G Limited, http://www.performancepointing.com

Maybe you are looking for