Solution: How to AutoFit Excel Content

I, like most, am new to Open XML.  I was trying to find a way to size the column to my largest item.  I mostly found that the current spec doesn't support it automatically.  After poking around I found a formula which I rework to calculate
the width based on the pixel width of the string.  I then found a way to size the column.
Here is the complete source code to do it.  I should mention that I am NOT searching for the largest string in the column but rather calculating 1 item.  Haven't quite figured out how to do search yet.
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Spreadsheet;
namespace AutoFit
class Program
static void Main(string[] args)
string docName = @"D:\Temp\MyFirstExcel.xlsx";
// Create a Wordprocessing document.
using (SpreadsheetDocument spreadsheetDocument = SpreadsheetDocument.Create(docName, SpreadsheetDocumentType.Workbook))
// Add a WorkbookPart to the document.
WorkbookPart workbookpart = spreadsheetDocument.AddWorkbookPart();
workbookpart.Workbook = new Workbook();
// Add a WorksheetPart to the WorkbookPart.
WorksheetPart worksheetPart = workbookpart.AddNewPart<WorksheetPart>();
worksheetPart.Worksheet = new Worksheet();
// IMPORTANT STUFF
string strText = "This is some really, really long text to display.";
double width = GetWidth("Calibri", 11, strText);
string strText2 = "123";
double width2 = GetWidth("Calibri", 11, strText2);
Columns columns = new Columns();
columns.Append(CreateColumnData(2, 2, width));
columns.Append(CreateColumnData(3, 3, width2));
worksheetPart.Worksheet.Append(columns);
// END OF IMPORTANT STUFF
SheetData sd = new SheetData();
worksheetPart.Worksheet.Append(sd);
// Add Sheets to the Workbook.
Sheets sheets = spreadsheetDocument.WorkbookPart.Workbook.AppendChild<Sheets>(new Sheets());
// Append a new worksheet and associate it with the workbook.
Sheet sheet = new Sheet()
Id = spreadsheetDocument.WorkbookPart.GetIdOfPart(worksheetPart),
SheetId = 1,
Name = "mySheet"
sheets.Append(sheet);
// Add Data
Row row = new Row();
Cell cell;
// String
cell = CreateSpreadsheetCellIfNotExist(worksheetPart.Worksheet, "B2");
cell.CellValue = new CellValue(strText);
cell.DataType = CellValues.String;
// Number
int count = 123;
cell = CreateSpreadsheetCellIfNotExist(worksheetPart.Worksheet, "C2");
CellValue cellValue = new CellValue(count.ToString());
cell.CellValue = cellValue;
cell.DataType = CellValues.Number;
workbookpart.Workbook.Save();
// Close the document.
spreadsheetDocument.Close();
private static double GetWidth(string font, int fontSize, string text)
System.Drawing.Font stringFont = new System.Drawing.Font(font, fontSize);
return GetWidth(stringFont, text);
private static double GetWidth(System.Drawing.Font stringFont, string text)
// This formula is based on this article plus a nudge ( + 0.2M )
// http://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.column.width.aspx
// Truncate(((256 * Solve_For_This + Truncate(128 / 7)) / 256) * 7) = DeterminePixelsOfString
Size textSize = TextRenderer.MeasureText(text, stringFont);
double width = (double)(((textSize.Width / (double)7) * 256) - (128 / 7)) / 256;
width = (double)decimal.Round((decimal)width + 0.2M, 2);
return width;
private static Column CreateColumnData(UInt32 StartColumnIndex, UInt32 EndColumnIndex, double ColumnWidth)
Column column;
column = new Column();
column.Min = StartColumnIndex;
column.Max = EndColumnIndex;
column.Width = ColumnWidth;
column.CustomWidth = true;
return column;
// Given a Worksheet and a cell name, verifies that the specified cell exists.
// If it does not exist, creates a new cell.
private static Cell CreateSpreadsheetCellIfNotExist(Worksheet worksheet, string cellName)
string columnName = GetColumnName(cellName);
uint rowIndex = GetRowIndex(cellName);
IEnumerable<Row> rows = worksheet.Descendants<Row>().Where(r => r.RowIndex.Value == rowIndex);
Cell cell;
// If the Worksheet does not contain the specified row, create the specified row.
// Create the specified cell in that row, and insert the row into the Worksheet.
if (rows.Count() == 0)
Row row = new Row() { RowIndex = new UInt32Value(rowIndex) };
cell = new Cell() { CellReference = new StringValue(cellName) };
row.Append(cell);
worksheet.Descendants<SheetData>().First().Append(row);
worksheet.Save();
else
Row row = rows.First();
IEnumerable<Cell> cells = row.Elements<Cell>().Where(c => c.CellReference.Value == cellName);
// If the row does not contain the specified cell, create the specified cell.
if (cells.Count() == 0)
cell = new Cell() { CellReference = new StringValue(cellName) };
row.Append(cell);
worksheet.Save();
else
cell = cells.First();
return cell;
// Given a cell name, parses the specified cell to get the column name.
private static string GetColumnName(string cellName)
// Create a regular expression to match the column name portion of the cell name.
Regex regex = new Regex("[A-Za-z]+");
Match match = regex.Match(cellName);
return match.Value;
// Given a cell name, parses the specified cell to get the row index.
private static uint GetRowIndex(string cellName)
// Create a regular expression to match the row index portion the cell name.
Regex regex = new Regex(@"\d+");
Match match = regex.Match(cellName);
return uint.Parse(match.Value);

I used this code in vb.net but I am not able to set the width of the column. Can You please provide the code for vb.net as well. I am new to vb.net and has worked with c# only so finding it difficult to deal with it.
For testing the code I tried with a fixed width of the column of my code but I am not able to get it right. I always get the default column width once the excel is generated.
 

Similar Messages

  • How to Display the content of Excel file into Webdynpro Table

    Hi Experts
    I am following the Blog to upload a file in to the webdynpro context,but my problem is after uploading a excel file i need to extract the content from that Excel file and that content should be displayed in the webdynpro table.Can any body please guide me how to read the content from excel and to Display in the Table.
    Thanks and Regards
    Kalyan

    HI,
    Take for example, if Excel file contains 4 fields,
    Add jxl.jar to JavaBuild path and Use this snippet
    File f=new File("sample.xls");
    Workbook w=Workbook.getWorkbook(f);
    Sheet sh=w.getSheet(0);
    int cols=sh.getColumns();
    int rows=sh.getRows();
    Cell c=null;
    String s1=null;
    String s2=null;
    String s3=null;
    String s4=null;
    ArrayList al=new ArrayList();
    int j=0;
    for(int i=1;i<rows;i++)
    ITableElement table=wdContext.createTableElementz
         s1=sh.getCell(0,i).getContents();
         s2=sh.getCell(1,i).getContents();
         s3=sh.getCell(2,i).getContents();
         s4=sh.getCell(3,i).getContents();
                             table.setName(s1);
         table.setAddress(s2);
         table.setDesignation(s3);
         table.setDummy(s4);
         al.add(j,table);
         j++;                    
    wdContext.nodeTable().bind(al);
    Regards
    LakshmiNarayana

  • How to process Excel attachment contents?

    I'm looking to read excel attachments to an instance and use attachment contents in the process. Any help will be highly appreciated.
    Thnx,
    MK
    Edited by goelmk at 11/19/2007 10:19 AM

    I can think of two alternatives:
    1- Use COM (introspect Excel, and use it to open the files)
    2- Use a Java library that can read Excel (for example:
    http://poi.apache.org/ )
    You must first download the attachment to a temporary folder. The filename
    should be unique (i.e.: you can use the instance number as part of the
    name 'this.id.number')
    The following code should download all attachments:
    bytesWritten as Int
    fileName as String
    files as String[]
    //Download all attachments
    for each attachment in attachments
    do
         fileName = attachment.fileName + "_" + this.id.number
         writeFromBinaryTo BinaryFile
              using data = attachment.contents,
                   name = fileName,
                   append = false
              returning bytesWritten
         if bytesWritten != attachment.contentSize then
              //Something is wrong, handle de error...
         else
              files[] = fileName
         end
    end
    for each file in files
    do
         //Use the desired API to process each of the files
    end
    Which choice of API you use, depends on the environment, performance
    constraints, etc. If you choose COM, you must make sure that the
    downloaded files are available on the machine where the COMBridge is
    running (for example by using a network share), and that you're not
    overloading Excel (i.e. not too many concurrent instances, Excel is not
    intended for heavy concurrent use).
    POI should be easier to work with, but your mileage may vary depending on
    how 'standard' the Excel files are (macros that run on load, probably
    won't work).
    Hope this helps,
    Juan
    On Mon, 19 Nov 2007 15:19:36 -0300, Manoj Goel wrote:
    I'm looking to read excel attachments to an instance and use attachment
    contents in the process. Any help will be highly appreciated.
    Thnx,
    MK
    Edited by goelmk at 11/19/2007 10:19 AM--
    Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

  • Please tell me How to send   excel file content  to   MAILBOX

    Hello ,
    Can anybody tell me how to send  Excel  file  data to  Mailbox

    Hi,
    Check this sample code.
    INITIALIZATION .
    CLASS cl_abap_char_utilities DEFINITION LOAD.
    gf_etb = cl_abap_char_utilities=>horizontal_tab. "For horrizontal tab
    gf_cr = cl_abap_char_utilities=>cr_lf. "For enter
    gf_lf = cl_abap_char_utilities=>newline. "For new line
    Declaration
      DATA:    lwa_hd_change TYPE sood1,
               lt_objcont    TYPE STANDARD TABLE OF soli,
               lwa_objcont   TYPE soli,
               lt_receivers  TYPE STANDARD TABLE OF soos1,
               lwa_receivers TYPE soos1 ,
               lt_att_cont   TYPE STANDARD TABLE OF soli,
               lwa_att_cont  TYPE soli,
               lt_packing    TYPE STANDARD TABLE OF soxpl,
               lwa_packing   TYPE soxpl,
               lf_sent       TYPE sonv-flag,
               lf_size       TYPE i.
      CONSTANTS: lc_obj(11)  TYPE c VALUE 'BOMSouthco',
                 lc_desc(20) TYPE c VALUE 'BOM Download',
                 lc_lang(1)  TYPE c VALUE 'E',
                 lc_raw(3)   TYPE c VALUE 'RAW',
                 lc_net(1)   TYPE c VALUE 'U',
                 lc_mail(4)  TYPE c VALUE 'MAIL',
                 lc_xls(3)   TYPE c VALUE 'XLS',
                 lc_ext(3)   TYPE c VALUE 'EXT'.
    Passing values to the strutures used in SO_OBJECT_SEND function module
      lwa_hd_change-objla      = lc_lang.
      lwa_hd_change-objnam     = lc_obj.
      lwa_hd_change-objdes     = lc_desc.
      lwa_hd_change-objlen     = 255.
      lwa_objcont-line = text-t29.
      APPEND lwa_objcont TO lt_objcont.
      CLEAR lwa_objcont.
      lwa_receivers-recextnam  = text-t31.
      lwa_receivers-recesc     = lc_net.
      lwa_receivers-sndart     = lc_mail.
      lwa_receivers-sndex      = 'X'.
      lwa_receivers-sndpri     = 1.
      lwa_receivers-mailstatus = 'E'.
      APPEND lwa_receivers TO lt_receivers.
      CLEAR lwa_receivers.
      lwa_receivers-recextnam  = text-t30.
      lwa_receivers-recesc     = lc_net.
      lwa_receivers-sndart     = lc_mail.
      lwa_receivers-sndex      = 'X'.
      lwa_receivers-sndpri     = 1.
      lwa_receivers-mailstatus = 'E'.
      APPEND lwa_receivers TO lt_receivers.
      CLEAR lwa_receivers.
    Passing values for the attachment file
      LOOP AT gt_output INTO gwa_output.
        CONCATENATE gf_lf  gwa_output-matnr  gf_etb  gwa_output-idnrk  gf_etb
                    gwa_output-type   gf_etb  gwa_output-menge   gf_etb
                    gwa_output-meins  gf_etb  gwa_output-comp    gf_etb
          INTO lwa_att_cont-line.
        APPEND lwa_att_cont TO lt_att_cont.
        CLEAR lwa_att_cont.
      ENDLOOP.
      CHECK lt_att_cont IS NOT INITIAL.
      DESCRIBE TABLE lt_att_cont LINES lf_size.
      lwa_packing-transf_bin = ' '.
      lwa_packing-head_start = 1.
      lwa_packing-head_num   = 0.
      lwa_packing-body_start = 1.
      lwa_packing-body_num   = lf_size.
      lwa_packing-file_ext   = lc_xls.
      lwa_packing-objlen     = lf_size * 255.
      lwa_packing-objtp      = lc_ext.
      lwa_packing-objdes     = lc_desc.
      lwa_packing-objnam     = lc_obj.
      APPEND lwa_packing TO lt_packing.
      CLEAR lwa_packing.
      CHECK gf_error IS NOT INITIAL. "Check if unix file is written
    FM to send email to the intended recipients
      CALL FUNCTION 'SO_OBJECT_SEND'
        EXPORTING
          object_hd_change           = lwa_hd_change
          object_type                = lc_raw
        IMPORTING
          sent_to_all                = lf_sent
        TABLES
          objcont                    = lt_objcont
          receivers                  = lt_receivers
          packing_list               = lt_packing
          att_cont                   = lt_att_cont
        EXCEPTIONS
          active_user_not_exist      = 1
          communication_failure      = 2
          component_not_available    = 3
          folder_not_exist           = 4
          folder_no_authorization    = 5
          forwarder_not_exist        = 6
          note_not_exist             = 7
          object_not_exist           = 8
          object_not_sent            = 9
          object_no_authorization    = 10
          object_type_not_exist      = 11
          operation_no_authorization = 12
          owner_not_exist            = 13
          parameter_error            = 14
          substitute_not_active      = 15
          substitute_not_defined     = 16
          system_failure             = 17
          too_much_receivers         = 18
          user_not_exist             = 19
          originator_not_exist       = 20
          x_error                    = 21
          OTHERS                     = 22.
      IF sy-subrc = 0.
        MESSAGE s004 WITH text-t34.
      ENDIF.
      COMMIT WORK.
    Reward if helpful.
    Regards,
    Ramya

  • How to link Excel ActiveX document?

    I would like to display the contents of an Excel workbook on the
    front panel of a VI. I have created an OLE container on the
    panel and inserted an Excel Worksheet document as the object.
    Labview has set refnum type to excel.workbook and everything
    works fine except one thing: I can't seem to find the right
    methods/properties for linking this object to an existing file
    so I can display its contents. NI's website has an example of
    how to create and populate a new document on the front panel,
    but I couldn't find and example of how to get the contents of an
    existing file into the OLE document. Is there an example, or
    does someone know how to do this? Thanks in advance for your
    help.
    * Sent from RemarQ http://www.remarq
    .com The Internet's Discussion Network *
    The fastest and easiest way to search and participate in Usenet - Free!

    I have seen this working for some folks in my company. They moved their spreadsheets into SharePoint, and changed the references to other spreadsheets from file paths to be the urls of the items in SharePoint.
    w: http://www.the-north.com/sharepoint | t: @JMcAllisterCH | YouTube: http://www.youtube.com/user/JamieMcAllisterMVP

  • MS WORD TABLE commands such as "AutoFit to contents" can be achieved in LabVIEW report generation?

    LV 7.1 and Report Generation Toolkit 1.1.
    I generate a report by the tookit.But tables are in disorder because of the different contents in cells.
    Is there a way(or any function) in LabVIEW to made it like "AutoFit to contents" or "AutoFit to window" in WORD.
    Thanks
    =======================
    Windows XP SP2+LabVIEW 7.1
    Attachments:
    Report.vi ‏98 KB

    Where is this VI that you say to take the "Data" output from located?  I can not find it on the Palette.
    I need to do the same thing to a word report I am creating, autofit the tables to contents (except certain ones) and need to know how to access that property.
    EDIT - Nevermind - I found it.
    http://digital.ni.com/public.nsf/allkb/dc08b6a56dbe00a586256f1d006826dc
    Thanks,
    Ryan
    Message Edited by RVallieu on 04-26-2006 04:14 PM
    Ryan Vallieu
    Automation System Architect

  • How to insert HTML content in a IVIEW

    Hi,
    How to insert HTML content in a iview any body help me with the solution.
    Thanks & Regards
       kiran.B

    Hi,
    You can just spit out HTML in the request object:
    request.write("<B>Whatever</B>");
    Or if you have a single HTML page, you might want to just add it to KM and create an iView from it.
    Hope this helps.
    Daniel

  • How do I copy content from an entire row into a different table?

    How do I copy content from an entire row of one table into a different table?  When I try to copy/paste the selected row into a row of the same size  and configuration in another table in the same document, the cells change width, the formatting and border thicknesses change, and the text gets squeezed.  When I was working with tables in Microsoft Word, there was no problem selecting text from a row in one table and placing it into a similar row and configuration in another table.

    Hi Christopher Morgan
    And welcome to apple discussions. With regard to your main question ....
    Q: Can this be done?
    A: It can but not easily (in that you may take a hit in quality). Apps like MpegStream Clip or DVDXDV may help:
    http://www.dvdxdv.com/NewFolderLookSite/Products/DVDxDV.products.htm
    It converts it back to a QT file for use with iDvd (or iMovie).
    Hope this helps but if not just come on back.
    Disclaimer: Apple does not necessarily endorse any suggestions, solutions, or third-party software / products that may be mentioned in this topic. Apple encourages you to first seek a solution at Apple Support. The following links are provided as is, with no guarantee of the effectiveness or reliability of the information. Apple does not guarantee that these links will be maintained or functional at any given time. Use the information above at your own discretion.

  • How to Delete the Content of a Table?

    Hi,
    Please, i need to modify the content of a table, but before i want to delete this content. See follow the code that is used actually:
    DELETE (pr_name_table).
    MODIFY (pr_name_table) FROM TABLE prt_table.
    MESSAGE s000(zbrx) WITH text-i02 pr_name_table.
    The ABAP Editor don't accept the expression "DELETE (pr_name_table).".
    How to delete this content???
    Best Regards,
    Daniel Sanchez

    Hi,
    Thanks for helps! The problem been resolved with this solution:
    >> Call of Call:
    IF sy-subrc IS INITIAL.
          PERFORM z_upload_table TABLES t_zpf0012 t_bkp_zpf0012
                                    USING  c_zpf0012.
    ENDIF.
    >> In the Form: (after processing of Form)
    FORM z_upload_table TABLES prt_table prt_table2
                           USING  pr_nome_table.
      IF sy-subrc <> 0.
        MESSAGE i000(zbrx) WITH text-i03 l_file.
      ELSE.
        DELETE (pr_name_table) FROM TABLE prt_table2.
        MODIFY (pr_name_table) FROM TABLE prt_table.
      ENDIF.
    Best Regards,
    Daniel Sanchez

  • HT4527 How to transfer iPhone content (playlists, notes, calendar, contacts) to a MBP's iTunes library after a crash where I had to reinstall everything?

    I have a MBP and the hard drive crashed. I had to reinstall everything from zero. I didn't have a back-up of everything. Now my iTunes library does not recognize my iPhone and ask me to erase it to sync it. How can I transfer content from my iPhone to my MPB and rebuild iTunes library from my iPhone?

    I have discovered the solution and it involves an issue I suspected. After the restore of my old Time Machine Lion files to my new MBP running ML, the restore restored my computer back to Lion. After an install of ML, my computer worked perfectly except the fancy Scroll and zoom featured we all love from the trackpad. Ha already installed ML on other partitions and the trackpad worked perfectly on them.  Even the guest login's trackpad worked perfectly but not the main admin account.
    First thought was to create a new admin account and copy everything from the old admin to the new admin and then delete the old admin account. Hated the idea because all files had to be copied rather than moved.
    So what was left to do. I had thought of deleting all the apple preferences from the library and replace them with the contents of the library on another partition in ML. First I deleted old preferences many of which were old Lion preferences. That didn't solve the issue.
    I forgot that Lion and ML HIDE the user library so I was working on the wrong library. Discovered the Terminal command "chflags nohidden ~/Library" and I chose to reveal the user library on a ML partition.
    Solution:
    I booted into another ML partition. I guess that I could have booted into the new admin user account and changed the permissions  to access the old admin users Library But I chose to boot
    from another ML partition: copy ALL the com.apple. XXXXX.plist files and the folder  BY Host. It has special hidden files. Other  way is to copy the Preferences folder we'll say into the Desktop.
    I then proceeded to delete ALL the com.apple…….plist files and the Host folder into the trash. Then I copied all the apple.com…plist files and the Host folder and then rebooted. And now my wonderful Trackpad works as mountain Lion intended it to work.
    I'm leaving this solution because there's someone else in the MacWorld with the same issue.
    Ted

  • Reading Excel contents

    Hi Experts,
    For example  I have a excel file in "https://www.abc.com/xyz.xls" location.
    How to read excel file contents and display that excel file in my program.
    Please suggest steps to do.
    Please help me....
    Thanks
    Sridhar

    Hi,
    First download the file on to your desktop and then try this code.
    data:
    t_tab LIKE TABLE OF  alsmex_tabline WITH HEADER LINE,
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = p_file
          i_begin_col             = 1
          i_begin_row             = 1
          i_end_col               = 5
          i_end_row               = 4
        TABLES
          intern                  = t_tab
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT t_tab.
        WRITE t_tab-value .
        AT END OF row.
          write :/
        ENDAT.
      ENDLOOP.
    regards
    padma

  • How can I download content of wiki pages from Office 365 online Sharepoint site using c#?

    How can I download content of wiki pages from Office 365 online Sharepoint site using c#?
    Ratnesh[MSFT]

    Hi,
    According to your post, my understanding is that you want to download content of wiki pages on SharePoint Online.
    If just for getting the text of the page, I suggest you convert page to PDF file first and then download the PDF file via a Visual Web Part as a Sandboxed solution.
    A sample about export HTML to PDF:
    http://hamang.net/2008/08/14/html-to-pdf-in-net/
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Patrick Liang
    TechNet Community Support

  • How do I rotate content, not the frame (Javascript)

    Hi guys, I'm using InDesign CC 2014.
    I need to figure out how to affect the content of a placed image, not the surrounding frame. I know how to set the rotation angle of the selected object's frame:
    myRectagle = minhaPagina.rectangles.add(meuDocumento.layers.item(-1), undefined, undefined, {geometricBounds:[myY1, myX1, myY2, myX2], strokeWeight:0, strokeColor:meuDocumento.swatches.item("RED")});
    myRectagle.rotationAngle = 45
    For a frame, works fine, but I cannot understand how to leave the frame as it is and just rotate the content. I.E., normally, if I grab the direct selection tool and click an image (hovering over the image inside the frame turns to the hand tool), I can then manipulate the content without affecting the outside frame. But I want to do this with an JavaScript.
    Regards!

    Hello guys,
    Turned out I even managed to solve the problem bit by now, for those who go through the same, following the solution:
    Instead of:
    myRectagle.rotationAngle = 45
    used:
    myRectagle.graphics[0].rotationAngle = 45
    Regards to all.

  • How to open Excel Template save it under a different name and then write and save data to it at regualar intervals

    I have an excel template that I have created. I am opening that template, saving it under a different name, and then writing and saving data to that excel sheet at regular intervals. It is giving me an error 5, I understand what this means and I am trying to work around it.  However after too many hours spent trying to figure it out, I have asked for any help or input. I have attached an example vi, not the actual one since it is very involved.
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    Power Cycle Test 3.0 Excel Save Testing.vi ‏18 KB

    This snippet encapsulates most of the previous suggestions, and adds a few of my own.
    The first code shows one (simplified) way of building the output file name.  It incorporates the Build Path function to combine Report File Path with the file name (don't need initial "\"), builds the File Name with Format into String, getting the Time part of the name from Format Date/Time String.  I also use Build Path to get the Template path.  Inside the For Loop, another Format into String gets the data that is placed in the 10 Excel cells.  We don't write anything yet -- we're only filling in the cells in the WorkSheet (think of how you use Excel -- you could, but probably don't, save the WorkBook after every cell entry, you wait until you are all done and then do a Save, followed by closing Excel).  Finally, when we are done, we save the file using the output name we want to use, then close Excel (which disposes of the Report Object).  If we want to generate another report, with another (time-based) name, we can put this code into a sub-VI and simply call it again.
    Don't worry if you don't have LabVIEW 2014 (which was used to save this snippet) -- most of the code comes from the original that you posted, so it should be a pretty simple edit to change that code to match this.
    Bob Schor

  • UCM how to clear "Workflow Content Items In Queue"

    Hi
    How to clear "Workflow Content Items In Queue", if i click "Remove item from Queue" under Action also content item is remains in workflow queue.
    How to fix it?
    Thanks
    Deepak

    Hi Srinath,
    I have checked the idc analyze. "check search index" is not running shows error. please check the log file below without selecting "check search index" other three(check database, check file system, generate report) ends with 0 errors. Is there any other solution to clear the workflow items?
    Analyzing tables...
    WARNING: Checking dRevClassID<->dDocName consistency can take several minutes on large repositories!
    Finished checking 47 entries.
    Errors Found: 0
    Errors Fixed: 0
    Analyzing filesystem...
    Finished checking 47 entries.
    Errors Found: 0
    Errors Fixed: 0
    Generate report
    Number of items grouped by: dReleaseState
    Workflow : 4
    Old : 6
    Current : 37
    Number of items grouped by: dStatus
    Edit : 2
    Released : 43
    Review : 2
    Number of items grouped by: dProcessingState
    Converted : 42
    Metadata Only : 5
    Number of items grouped by: dStatus, dReleaseState
    Current and Released : 37
    Workflow and Review : 2
    Old and Released : 6
    Workflow and Edit : 2
    Thanks
    Deepak

Maybe you are looking for

  • Job Cancelled with an error "Data does not match the job def: Job terminat"

    Dear Friends, The following job is with respect to an inbound interface that transfers data into SAP. The file mist.txt is picked from the /FI/in directory of the application server and is moved to the /FI/work directory of application server for pro

  • Win 8.1 Updated Hosed my Laptop

    Hi, A few weeks ago, I was prompted on my HP ENVY TouchSmart Sleekbook 4-1115dx (C2K73UA) with auto-update for Wins 8.1.  I accepted and now my computer will not boot up and it rendered it unusable. It attempts to start up but then just goes black fo

  • Several paths   with the virtual-directory-mapping    in weblogic.xml

    Hello! I don´t know if this is well posted here. Sorry, and my english is aswful :(. I´m trying to put several paths for jsp files in an application, similar to how the extendend document root works in websphere. How can I get this on weblogic? With

  • 64 bit Flash beta - where?

    I have read about a beta version of a 64 bit Flash driver, yet when I attempt to access it to download, I just get into a loop of moving back and forth between various webpages when clicking on the links to the beta download. Has the file been remove

  • ...Simplest way to make Jar Files...

    I know there have been numerous questions about jar files and that this has probably been answered before. I am using Forte to develop a program. The program runs fine in Forte, and I used the jar packager to create a jar file. When I double click th