I want to display specific line to be color in alvlist how

i want to display specific line to be color in alvlist
i write the code as follows here document type is initial. then that line is to be
appeared as color line but problem is initially it is appeared correct later i moved to next previous screens  error lines are to be colored where i have to clear 
  loop at it_doclist where blart eq space.
      gt_layout-info_fieldname  = 'COLOR_LINE'.
      it_doclist-color_line = 'C600'.
      modify it_doclist .
      clear:it_doclist.
  endloop.
please help me exactly
Thanks
Ramana reddy

u r requiremnt is not clear...but any how check this code....
it has a form for assigning colors....
rewardif useful
REPORT zppb001_prd_posting_upload
       NO STANDARD PAGE HEADING LINE-SIZE 255
       MESSAGE-ID zpp.
INCLUDE bdcrecx1.
TYPE-POOLS  :slis.
DATA:   wk_success(5) TYPE c,     "To store the successfull Hits
        wk_failure(5) TYPE c,     "To store the failed Hits
        l_mstring(600),           "To store Message texts
        t_date TYPE zservice_date,"To store Uploaded Date
        wk_lines(5) TYPE c,       "To store No of Records
        lines(5) TYPE c,          "To store No of Records
        wk_len(150) TYPE c,       "To store File path
        wk_alp TYPE i,            "To store path length
        lent TYPE i,              "To store path length
        b(4).                     "To store File extension
DATA:   alvfld TYPE slis_t_fieldcat_alv WITH HEADER LINE,
        v_events TYPE slis_t_event WITH HEADER LINE,
        wk_events LIKE LINE OF v_events,
        it_list_comments TYPE slis_t_listheader,
        wk_list_comments LIKE LINE OF it_list_comments,
        wk_layout TYPE slis_layout_alv.
CONSTANTS: c_formname_top_of_page TYPE slis_formname
                               VALUE 'F_TOP_OF_PAGE'.
--TO STORE FINAL DATA TO BE POSTED--
Generated data section with specific formatting - DO NOT CHANGE  ***
DATA: BEGIN OF record OCCURS 0,
        budat_002(010),
        bktxt_004(025),
        matnr_005(018),
        werks_006(004),
        alort_007(004),
        erfmg_008(017),
      END OF record.
End generated data section ***
DATA: BEGIN OF messages OCCURS 0,       "TO STORE FINAL STATUS DISPLAY
       budat_002(010),
       bktxt_004(025),
       matnr_005(018),
       maktx TYPE makt-maktx,
       werks_006(004),
       alort_007(004),
       erfmg_008(017),
       msg_e(400),
       msg_s(600),
       msgtyp TYPE c,
       line_color(4),
      END OF messages.
DATA: BEGIN OF st_record1 ,
       matnr_005(018),
       werks_006(004),
       budat_002(010),
       bktxt_004(025),
       erfmg_007(017),
       erfmg_008(017),
       alort_007(004),
      END OF st_record1.
DEFINE alv_macro.
  move : &1 to alvfld-col_pos,
         &2 to alvfld-fieldname,
         &3 to alvfld-seltext_m.
  if &2 = 'MATNR_005' or &2 = 'MAKTX'.
    alvfld-fix_column = 'X'.
  endif.
  append alvfld.clear alvfld.
END-OF-DEFINITION.
DATA : record1 LIKE TABLE OF st_record1 WITH HEADER LINE,
       it_excel LIKE TABLE OF alsmex_tabline WITH HEADER LINE,
       messtab1 LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE,
       it_acc LIKE TABLE OF record WITH HEADER LINE,
       it_rej LIKE TABLE OF record WITH HEADER LINE.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
PARAMETERS: p_file TYPE localfile OBLIGATORY .
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
  CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
      static    = 'X'
    CHANGING
      file_name = p_file.
AT SELECTION-SCREEN ON p_file.
  wk_len = p_file.
  CONDENSE wk_len NO-GAPS.
  lent = STRLEN( wk_len ).
  wk_alp = lent - 4.
  b = wk_len+wk_alp(lent).
  IF ( b NE '.txt' ) AND ( b NE '.xls' ).
    MESSAGE e939.
    CLEAR p_file.
    STOP.
  ENDIF.
START-OF-SELECTION.
  PERFORM upload_fun.
  PERFORM open_group.
  PERFORM fill_bdc_table.
  PERFORM close_group.
  PERFORM assign_colors.
  PERFORM f_event_build.
  SORT messages BY matnr_005 ASCENDING.
  PERFORM assign_columns.
  PERFORM count.
  IF ctu = 'X'.
    PERFORM alv.
  ENDIF.
  FREE:messages,messtab1,record1.
END-OF-SELECTION.
--FORM UPLOAD_FUN--
FORM upload_fun.
REFRESH: record1, it_acc, it_rej, record, messages, messtab1, it_excel.
  PERFORM fetch_from_flat_file.
  CLEAR it_excel.
  DESCRIBE TABLE it_excel.
  IF sy-tfill = 0.
    MESSAGE i937. STOP.
  ENDIF.
  LOOP AT it_excel.
    CASE it_excel-col.
      WHEN '0001'. MOVE: it_excel-value TO record1-matnr_005.
      WHEN '0002'. MOVE: it_excel-value TO record1-werks_006.
      WHEN '0003'. MOVE: it_excel-value TO record1-budat_002.
      WHEN '0004'. MOVE: it_excel-value TO record1-bktxt_004.
      WHEN '0005'. MOVE: it_excel-value TO record1-erfmg_007.
      WHEN '0006'. MOVE: it_excel-value TO record1-erfmg_008.
      WHEN '0007'. MOVE: it_excel-value TO record1-alort_007.
    ENDCASE.
    AT END OF row.
      APPEND record1. CLEAR record1.
    ENDAT.
  ENDLOOP.
  DELETE record1 WHERE matnr_005 EQ ' '.
--DO NOT UPLOAD WHERE PRD QTY = 0--
  DELETE record1 WHERE ( erfmg_007 = 0 OR erfmg_007 = ' ' )
                  AND  ( erfmg_008 = 0 OR erfmg_008 = ' ' ).
  DESCRIBE TABLE record1[].
  IF sy-tfill > 0.
--MOVE ACCEPTED QTY AND FETCH THE RESPECTIVE STGLOC-**
    LOOP AT record1 WHERE erfmg_007 NE 0 AND erfmg_007 NE ' '.
      MOVE:    record1-budat_002 TO it_acc-budat_002,
               record1-bktxt_004 TO it_acc-bktxt_004,
               record1-matnr_005 TO it_acc-matnr_005,
               record1-werks_006 TO it_acc-werks_006,
               record1-erfmg_007 TO it_acc-erfmg_008.
      APPEND it_acc. CLEAR: it_acc,record1.
    ENDLOOP.
--MOVE ELPRO FOR THE ACCEPTED ENTRIES--
    LOOP AT it_acc.
      SELECT SINGLE elpro INTO it_acc-alort_007
                                        FROM mkal CLIENT SPECIFIED
                                        WHERE mandt = sy-mandt
                                        AND matnr = it_acc-matnr_005
                                        AND werks = it_acc-werks_006.
      MODIFY it_acc TRANSPORTING alort_007. CLEAR: it_acc.
    ENDLOOP.
--MOVE PRD QTY FOR REJECTED QTY--
    LOOP AT record1 WHERE erfmg_008 NE 0 AND erfmg_008 NE ' '.
      MOVE: record1-budat_002 TO it_rej-budat_002,
            record1-bktxt_004 TO it_rej-bktxt_004,
            record1-matnr_005 TO it_rej-matnr_005,
            record1-werks_006 TO it_rej-werks_006,
            record1-erfmg_008 TO it_rej-erfmg_008,
            record1-alort_007 TO it_rej-alort_007.
      APPEND it_rej. CLEAR: it_rej, record1.
    ENDLOOP.
--MOVE ACCEPTED AND REJECTED READINGS TO FINAL TABLE
    APPEND LINES OF it_acc TO record. APPEND LINES OF it_rej TO record.
    FREE : it_rej, it_acc, record1.
  ELSE.
    MESSAGE i937.
    STOP.
  ENDIF.
ENDFORM.                    " UPLOAD_FUN
--FORM fill_bdc_table--
FORM fill_bdc_table.
  IF NOT record[] IS INITIAL.
    LOOP AT record.
      PERFORM bdc_dynpro USING 'SAPLBARM' '0800'.
      PERFORM bdc_field  USING 'BDC_CURSOR' 'RM61B-BKTXT'.
      PERFORM bdc_field  USING 'BDC_OKCODE' '=ISTDA'.
      PERFORM bdc_field  USING 'RM61B-BUDAT' record-budat_002.
      PERFORM bdc_field  USING 'RM61B-BKTXT' record-bktxt_004.
      PERFORM bdc_field  USING 'RM61B-MATNR' record-matnr_005.
      PERFORM bdc_field  USING 'RM61B-WERKS' record-werks_006.
      PERFORM bdc_field  USING 'RM61B-ALORT' record-alort_007.
      PERFORM bdc_field  USING 'RM61B-ERFMG' record-erfmg_008.
      PERFORM bdc_dynpro USING 'SAPLCOWB' '0130'.
      PERFORM bdc_field  USING 'BDC_OKCODE' '=WEIT'.
      PERFORM bdc_field  USING 'BDC_CURSOR' 'G_COWB_HEADER-MNGTXT'.
      PERFORM bdc_transaction USING 'MFBF'.
      CLEAR messtab.
      messtab1[] = messtab[].
      LOOP AT messtab1 WHERE msgtyp = 'S' OR msgtyp = 'E'.
        SELECT SINGLE * FROM t100 WHERE sprsl = messtab1-msgspra
                                  AND   arbgb = messtab1-msgid
                                  AND   msgnr = messtab1-msgnr.
        IF sy-subrc = 0.
          l_mstring = t100-text.
          PERFORM store_messages.
          CLEAR l_mstring.
        ENDIF.
      ENDLOOP.
      MOVE-CORRESPONDING record TO messages.
     SELECT SINGLE maktx INTO messages-maktx FROM makt CLIENT SPECIFIED
                                             WHERE mandt = sy-mandt
                                          AND matnr = messages-matnr_005
                                          AND spras = 'EN'.
      APPEND messages.
      CLEAR: messages, messtab1. REFRESH messtab1.
    ENDLOOP.
  ENDIF.
ENDFORM.                    "fill_bdc_table
--FORM assign_columns--
FORM assign_columns .
  REFRESH alvfld.
  alv_macro '1' 'MATNR_005' 'PART NO'.
  alv_macro '2' 'MAKTX' 'DESCRIPTION'.
  alv_macro '3' 'WERKS_006' 'PLANT'.
  alv_macro '4' 'BUDAT_002' 'POSTING DATE'.
  alv_macro '5' 'BKTXT_004' 'SHIFT'.
  alv_macro '6' 'ERFMG_008' 'QUANTITY'.
  alv_macro '7' 'ALORT_007' 'STGLOC'.
  alv_macro '8' 'MSG_E' 'ERRORS DUE TO'.
  alv_macro '9' 'MSG_S' 'STATUS'.
ENDFORM.                    " assign_columns
--FORM f_event_build--
FORM f_event_build .
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
      i_list_type = 0
    IMPORTING
      et_events   = v_events[].
  READ TABLE v_events WITH KEY name = slis_ev_top_of_page
                                           INTO wk_events.
  wk_layout-info_fieldname = 'LINE_COLOR'.
  wk_layout-colwidth_optimize    = 'X'.
  IF sy-subrc = 0.
    MOVE c_formname_top_of_page TO wk_events-form.
    MODIFY v_events FROM wk_events INDEX sy-tabix.
  ENDIF.
ENDFORM.                    " f_event_build
--FORM f_top_of_page--
FORM f_top_of_page.
  WRITE sy-datum TO t_date.
  CLEAR: it_list_comments[].
  wk_list_comments-typ  = 'H'. "H=Header, S=Selection, A=Action
  wk_list_comments-key  = ''.
CONCATENATE 'UPLOADED STATUS FOR PRODUCTION POSTING ON - ' t_date INTO
                             wk_list_comments-info SEPARATED BY space.
  APPEND wk_list_comments TO it_list_comments.
  CLEAR wk_list_comments.
  DESCRIBE TABLE messages LINES wk_lines.
  lines = wk_lines.
  wk_list_comments-typ  = 'S'. "H=Header, S=Selection, A=Action
  wk_list_comments-key  = ''.
  CONCATENATE 'Total No of Hits:' lines INTO wk_list_comments-info
                                                  SEPARATED BY space.
  APPEND wk_list_comments TO it_list_comments.
  CLEAR wk_list_comments.
  wk_list_comments-typ  = 'S'. "H=Header, S=Selection, A=Action
  wk_list_comments-key  = ''.
  CONCATENATE 'Successfull Hits:' wk_success INTO
            wk_list_comments-info SEPARATED BY space.
  APPEND wk_list_comments TO it_list_comments.
  CLEAR wk_list_comments.
  wk_list_comments-typ  = 'S'. "H=Header, S=Selection, A=Action
  wk_list_comments-key  = ''.
  CONCATENATE '    Failed Hits:' '   ' wk_failure INTO
                          wk_list_comments-info
                          SEPARATED BY space.
  APPEND wk_list_comments TO it_list_comments.
  CLEAR wk_list_comments.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      i_logo             = 'ENJOYSAP_LOGO'
      it_list_commentary = it_list_comments.
ENDFORM.                    "F_TOP_OF_PAGE
--FORM assign_colors--
FORM assign_colors .
  LOOP AT messages.
    CASE messages-msgtyp.
      WHEN 'E'.
        messages-line_color = 'C601'.
      WHEN 'S'.
        messages-line_color = 'C501'.
    ENDCASE.
    MODIFY messages TRANSPORTING line_color.
  ENDLOOP.
ENDFORM.                    " assign_colors
--FORM COUNT--
FORM count .
  CLEAR: wk_failure, wk_success.
  LOOP AT messages.
    CASE messages-msgtyp.
      WHEN 'E'.
        ADD 1 TO wk_failure.
      WHEN 'S'.
        ADD 1 TO wk_success.
    ENDCASE.
  ENDLOOP.
ENDFORM.                    " COUNT
--FORM ALV--
FORM alv .
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      i_callback_program = sy-repid
      is_layout          = wk_layout
      it_fieldcat        = alvfld[]
      it_events          = v_events[]
    TABLES
      t_outtab           = messages
    EXCEPTIONS
      program_error      = 1
      OTHERS             = 2.
ENDFORM.                    " ALV
--FETCH_FROM_FLAT_FILE--
FORM fetch_from_flat_file .
  CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
      filename                = p_file
      i_begin_col             = 1 "From 1st Column
      i_begin_row             = 2 "From 2nd row
      i_end_col               = 7 "Till 7th Column
      i_end_row               = 65000 "Till Row
    TABLES
      intern                  = it_excel
    EXCEPTIONS
      inconsistent_parameters = 1
      upload_ole              = 2
      OTHERS                  = 3.
ENDFORM.                    " FETCH_FROM_FLAT_FILE
--FORM STORE_MESSAGES--
FORM store_messages.
  IF l_mstring CS '&1'.
    REPLACE '&1' WITH messtab1-msgv1 INTO l_mstring.
    REPLACE '&2' WITH messtab1-msgv2 INTO l_mstring.
    REPLACE '&3' WITH messtab1-msgv3 INTO l_mstring.
    REPLACE '&4' WITH messtab1-msgv4 INTO l_mstring.
  ELSE.
    REPLACE '&' WITH messtab1-msgv1 INTO l_mstring.
    REPLACE '&' WITH messtab1-msgv2 INTO l_mstring.
    REPLACE '&' WITH messtab1-msgv3 INTO l_mstring.
    REPLACE '&' WITH messtab1-msgv4 INTO l_mstring.
  ENDIF.
  CONDENSE l_mstring.
  IF messtab1-msgtyp = 'E'.
CONCATENATE messages-msg_s l_mstring INTO l_mstring SEPARATED BY space.
    MOVE l_mstring TO messages-msg_e.
    MOVE 'E' TO messages-msgtyp.
    MOVE 'Document Not Posted' TO messages-msg_s.
  ELSEIF messtab1-msgtyp = 'S'.
CONCATENATE messages-msg_s l_mstring INTO l_mstring SEPARATED BY space.
    MOVE l_mstring TO messages-msg_s.
    MOVE 'S' TO messages-msgtyp.
  ENDIF.
ENDFORM.                    " store_messages

Similar Messages

  • The display has lines and the color is strange.

    The Retina display has lines and the color is very light when I turn on iPad mini. When I woke up and turned it on this morning, it happened. I have no idea what happened since the iPad mini has been gotten no physical damage.

    Hi:
    I would try a hard reset of the notebook.
    http://h10025.www1.hp.com/ewfrf/wc/document?docnam​e=c01684768&cc=us&dlc=en&lc=en&jumpid=reg_r1002_us​...
    If that doesn't work and considering all of the other steps you took to remedy the issue, I would say the BIOS update wrecked something permanently.

  • I want to make specific lines from the x-axis dotted

    As you can see here, I want the line from the 750 Hz, 3000 Hz and 6000 Hz to be dotted, can anybody help me with that?

    This is not a feature Numbers supports.  You can turn off grid lines, then draw lines using the shapes menu in the tool bar:
    Graph without X-axis gridlines
    Graph without X-axis gridlines.  Adding a line using Shapes menu:
    Chart with some x-axis gridlines as dashed lines

  • How to display spectral lines in color band

    I want to display a line spectrum in color band format.  What I have are two arrays: wavelength and intensity. I can plot the graph like the bottom one and I want to convert it to the top color band. The considerations are:
    1. the color must agree with the wavelength.  For instant, the 650 nm corresponds to the red color and the 490 matches the blue
    2. the line intensity is indicated by the line width of the color line.  For instant, the 650 nm line is a strong one and its red line in the color band is the widest.   The 435 nm line is a weak one so it is barely see (but still visible) in the color band.
    I would like to know if labview has any built-in function to assist me with this job.  If not, any idea of implementing this?
    Thanks in advance for any suggesting.

    I am thinking of an alternative way to implement this, but not sure if LabView can handle:
    1. First, set a standard color spectrum as background:
    2. Then, make the spectral line image as 2D, and put it in front of the color spectrum with the wavelength aligned.  The picture below has the y-axis offset a bit to show my concept:
    For the 2D spectral line image, I have the max intensity set as white and the min set at black.  WHAT IF I can set the min as "opaque" and max as "100% transparent"?  Is it possible?
    I started my labview programming last year so sometime I may think labview can "fly".  If this concept is too crazy (a.k.a. impossible) , just let me know.  Thanks!

  • Display specific row to display multiple time in jsf table 11.1.1.2.0 with

    HI ALL,
    I'm using jdeveloper 11.1.1.2.0 with ADF 11g.
    I have to display the values in jsf frm table where i'm using DislayCertDetailVO . In dis VO i'm having a column no.of certificaties .taking dis column value when i navigate to other page jsf by selecting a specific row. here i have to display the selected row in multiple times based on the no.of.certificates column value.
    I want to display specific row to display multiple time to repeat same row in a table in jsf based on the value from bean or table in database.
    Edited by: user9010551 on Apr 28, 2010 6:14 AM
    Edited by: user9010551 on Apr 28, 2010 10:33 PM

    Hi, Trying it once more to give more clarity of my scenario.
    I have to navigate from 1 screen to the other by picking a given table record/row from the 1st screen. While displaying the record on the 2nd screen the catch is that, I have to display it as many times as the value in a cell of the selected record.
    eg.
    screen 1
    col1   col2     col3
    2 order1 item1
    [next]
    On clicking next it should look like
    screen2
    col1           col2            col3           col4
    order1 item1
    order1 item1
    where col3 and col4 will be editable by the user and col1 is the value depends how many times i have repeat the row/record
    Hope this give more clarity.

  • How to not to display any line items for val flds values are zero in KE30?

    Dear All,
    In KE30,in one of my reports,  i do not want to display such line items for which all values are zero for all val flds, it should only display the line items for which there is any value, i have tried Zeros hide in KE35 in formatting menu>other format>hide zeros, but unofrtunately it didnt came out.
    Regards
    Rashid
    Edited by: rashinuet on Feb 20, 2012 4:38 PM

    Dear Abhishek,
    I have tried that as well in ke35 and made this option activated on my val flds like sales revenue for hide zero values, but it didnt came out as well, then in i tried ke32 change report >Extras menu>form settings, this adopts all the settings in the report from the form you have assigned, but this is not working, i am failed to understand what has gone wrong.
    Regards

  • Statusbar displaying current line number?

    Hi,
    I am building a swing application where I have one text editor and one status bar. I want to display current line no in status bar. I tried with getCaretPosition() but it does not returns line number, is there any other way to get current line number to display it on status bar? Thanks.

    is there any other way to get current line number Did you search the forum?
    How about the keywords "current line number", taken directly from your question. So you can see its really not that hard to think of keywords to use in a search.

  • How to read specific line in a file through UNIX shell script..

    Dear Friends,
    I have generated .ldt file under admin/import/US folder through FND_LOAD script for Download the responsibility.
    I registred Shell script (Host concurrent program) in Oracle apps. Now i want to read the file in speciific line which i was generated in admin/import/US folder through unix shell script. Please help me how to read specific line and the i want to replace that which i am going to read the specific line.
    Thanks in advance..
    Regards,
    Velu.

    Hi,
    Thanks for reply,
    My requirement i have to find the specific line in a file and find and replace needed word over there it's should happen programatically. i want to read specific line in a file Once complete find and replace the condition should exists. The loop will go to next file and read the same line in next file also do the same process upto how many files over there.i am doing through UNIX shell script. Please help me out to find the
    Your suggestion is highly appriciated.
    Thanks,
    Velu.

  • Display the Line level details in the Notification - Urgent

    Hi,
    I have developed a Approval Workflow for customized form.
    I want to display the Line level details in the Notification/Message.Please guide me to do this?
    Thanks

    You can make use of the attribute type DOC. See 'To Define a Document Attribute' in the Workflow Development Guide. Then you just include it in the body of the message the same way you do with other attributes.
    Regards,
    Alejandro.

  • Hao to display two lines in one Graph

    Hi, I want to display two lines in one graph in different color , what should I do? Thanks.

    Hello Carlos,
    the help window for a waveform graph/chart only mentions "single plot
    with waveform datatype". To get more plots on one graph you have to
    build an 2D-array  of  points. Just look at the help window!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • I want to display the narrative view as All Choices

    Hi Experts,
    If ‘All choices’ option is selected, I want to display the narrative view as All Choices.
    How do I achieve it?
    Waiting for your reply....
    Regards,
    Sathyan

    Hi Sathyan,
    Set a presentation variable for that prompt.
    and in request, go to the column formula,
    CASE WHEN '@{pv_var}' IS NULL THEN 'ALL CHOICES' ELSE col_name END
    Regards,
    Raghu

  • Having trouble reading specific lines from a text file and displaying them in a listbox

    I am trying to read specific lines from all of the text files in a folder that are reports. When I run the application I get the information from the first text file and then it returns this error: "A first chance exception of type 'System.ArgumentOutOfRangeException'
    occurred in mscorlib.dll"
    Below is the code from that form. 
    Option Strict On
    Option Infer Off
    Option Explicit On
    Public Class frmInventoryReport
    Public Function ReadLine(ByVal lineNumber As Integer, ByVal lines As List(Of String)) As String
    Dim intTemp As Integer
    intTemp = lineNumber
    Return lines(lineNumber - 1)
    lineNumber = intTemp
    End Function
    Public Function FileMatches(ByVal folderPath As String, ByVal filePattern As String, ByVal phrase As String) As Boolean
    For Each fileName As String In IO.Directory.GetFiles(folderPath, filePattern)
    If fileName.ToLower().Contains(phrase.ToLower()) Then
    Return True
    End If
    Next
    Return False
    End Function
    Private Sub frmInventoryReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim intcase As Integer = 1
    Dim strTemp, strlist, strFile As String
    Dim blnCheck As Boolean = True
    strFile = "Report Q" & intcase.ToString & ".txt"
    Do While blnCheck = True
    strFile = "Report Q" & intcase.ToString & ".txt"
    Dim objReader As New System.IO.StreamReader("E:\Furry Friends Animal Shelter Solution\Furry Friends Animal Shelter\" & strFile)
    Dim allLines As List(Of String) = New List(Of String)
    Do While objReader.Peek <> -1
    allLines.Add(objReader.ReadLine())
    Loop
    objReader.Close()
    strlist = ReadLine(1, allLines) & "" & ReadLine(23, allLines)
    lstInventory.Items.Add(strlist)
    intcase += 1
    strTemp = intcase.ToString
    strFile = "Report Q" & intcase.ToString & ".txt"
    blnCheck = FileMatches("E:\Furry Friends Animal Shelter Solution\Furry Friends Animal Shelter\", "*.txt", intcase.ToString)
    Loop
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim intcase As Integer = 1
    Dim strTemp, strlist, strFile As String
    Dim blnCheck As Boolean = True
    strFile = "Report Q" & intcase.ToString & ".txt"
    Do While blnCheck = True
    strFile = "Report Q" & intcase.ToString & ".txt"
    Dim objReader As New System.IO.StreamReader("E:\Furry Friends Animal Shelter Solution\Furry Friends Animal Shelter\" & strFile)
    Dim allLines As List(Of String) = New List(Of String)
    Do While objReader.Peek <> -1
    allLines.Add(objReader.ReadLine())
    Loop
    objReader.Close()
    strlist = ReadLine(1, allLines) & "" & ReadLine(23, allLines)
    lstInventory.Items.Add(strlist)
    intcase += 1
    strTemp = intcase.ToString
    strFile = "Report Q" & intcase.ToString & ".txt"
    blnCheck = FileMatches("E:\Furry Friends Animal Shelter Solution\Furry Friends Animal Shelter\", "*.txt", intcase.ToString)
    Loop
    End Sub
    End Class
    Sorry I'm just beginning coding and I'm still a noob. Any help is appreciated. Thank you!

    Ok, so if I'm following this correctly you should be able to just loop through all of the files in that folder whose file name matches the pattern and then read the first 22 lines, recording only the first and the last.
    Exactly how you store the animal data probably depends on how you are going to display it and what else you are going to do with it.  Is there anything other than name and cage number that should be associated with each animal?
    You might want to make a dataset with a datatable to describe the animal, or you might write a class, or you might just use something generic like a Tuple.  Here's a simple class example:
    Public Class Animal
    Public Property Name As String
    Public Property Cage As String
    Public Overrides Function ToString() As String
    Return String.Format("{0} - {1}", Name, Cage)
    End Function
    End Class
    With that you can use a routine like the following to loop through all of the files and read each one:
    Dim animals As New List(Of Animal)
    Dim folderPath As String = "E:\Furry Friends Animal Shelter Solution\Furry Friends Animal Shelter\"
    For Each filePath As String In System.IO.Directory.GetFiles(folderPath, "Report Q?.txt")
    Using reader As New System.IO.StreamReader(filePath)
    Dim lineIndex As Integer = 0
    Dim currentAnimal As New Animal
    While Not reader.EndOfStream
    Dim line As String = reader.ReadLine
    If lineIndex = 0 Then
    currentAnimal.Name = line
    ElseIf lineIndex = 22 Then
    currentAnimal.Cage = line
    Exit While
    End If
    lineIndex += 1
    End While
    animals.Add(currentAnimal)
    End Using
    Next
    'do something to display the animals list
    Then you might bind the animals list to a ListBox, or loop through the list and populate a ListView.  If you decided to fill a datatable instead of making Animal instances, then you might bind the resulting table to a DataGridView.
    There are lots of options depending on what you want and what all you need to do.
    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

  • I love osx mountain lion my question is why was air play taken out of specific app like quick time and iTunes i dont always want to display my whole computer when i am in airplay mode

    i love osx mountain lion my question is why was air play taken out of specific app like quick time and iTunes i dont always want to display my whole computer when i am in airplay mode

    Funny, my iTunes still has AirPlay capability without AirPlay Mirroring active.

  • Displaying cursor at a specific line

    Hi!
    I'm developing a text editor in AWT as a part of an assignment. Now when the text editor is rendered i want to display the cursor at the end of the last line. Did a lot of searching but couldn't find it.
    Plz help.
    Thanks
    Sutirtha

    So, did you read the API for Caret and find a method that does this?
    Sets the caret position to some position.
    db

  • I am trying to display three lines of text but blank lines are being inserted between them.

    I have a section on the right side of my homepage for upcoming events.  It was displaying fine until I changed the data and now the three lines are displaying blank lines between each one. 
    Here is the code.
    <h2 class="meeting"> </h2>
          <h2 class="meeting"><a href="http://www.astm.org/MEETINGS/filtrexx40.cgi?+-P+TERM+D02+searchresults.frm">ASTM D02 2014</a></h2>
       <img class="news-image" src="images/news/Sheraton San Diego.jpg" width="100" height="61" /> 
       <p class="news-text">December 7-11, 2014</p>
          <p>Sheraton San Diego Hotel and Marina</p>
          <p>San Diego, CA</p>
      </div>
    ASTM D02 2014
    December 7-11, 2014
    Sheraton San Diego Hotel and Marina
    San Diego, CA
    The picture is displaying to the right but I want to get rid of the blank lines between the text. I am using Dreamweaver CS5 Version 11.0 Please help.

    Sorry I inserted the wrong code. 
    <div id="rightsideUpcomingevents">
       <h2 class="upcoming">Upcoming Events</h2>
          <h2 class="meeting"><a href="http://www.gulfcoastconference.com">Gulf Coast Conference</a></h2>
       <img class="news-image" src="images/news/hotel_moody.jpg" width="100" height="61" /> 
       <p class="news-text">October 14-15, 2014</p>
          <p class="news-text">Moody Gardens Convention Center</p>
          <p class="news-text">Galveston, TX</p>
          <h2 class="meeting"> </h2>
          <h2 class="meeting"><a href="http://www.astm.org/MEETINGS/filtrexx40.cgi?+-P+TERM+D02+searchresults.frm">ASTM D02 2014</a></h2>
       <img class="news-image" src="images/news/Sheraton San Diego.jpg" width="100" height="61" /> 
       <p class="news-text">December 7-11, 2014</p>
          <p class="news-text">Sheraton San Diego Hotel and Marina</p>
          <p class="news-text">San Diego, CA</p>
      </div>
    .rightside-text
    {padding:0px; color:#172B61;}
    .news-image {float:right; margin-right:10px; }
    .news-text { padding:0px; color:#000;}

Maybe you are looking for