Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Combobox output problem.
#1
Hello.
Thank you always for the help.


For example:
KBS.xls
- Sheet_KBS
- Sheet2
- Sheet3

SBS.xls
-Sheet_SBS
- Sheet2
- Sheet3

KBS Combox Click after -> Combobox Sheet output -> KBS_Sheet...
But, -> SBS Click after -> Including KBS sheet and SBS sheet output problem.

I wanted KBS only, and SBS only output.

Function SmartControl_CrawlingBot_Opt
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
ExeQmGridDll
DlgGrid s.Init(hDlg 1201)
str ExcelFilePath="$desktop$\*.xls"

if(hDlg) goto messages
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x108 0 0 266 240 "CrawlingBot_Option"
;1101 Button 0x54012003 0x0 8 32 58 10 "예시:파일독"
;1201 QM_Grid 0x56031041 0x0 4 56 260 140 "0[]A[]B"
;1202 Button 0x54032000 0x0 4 40 48 14 "전체선택"
;1203 ComboBox 0x54230243 0x0 152 40 52 213 ""
;1204 ComboBox 0x54230243 0x0 208 40 52 213 ""
;1301 Static 0x54000000 0x0 116 28 48 13 "처리옵션"
;3 Button 0x54032000 0x0 8 8 48 14 "적용사이트"
;4 Button 0x54032000 0x0 60 8 48 14 "검색대상"
;5 Button 0x54032000 0x0 112 8 48 14 "처리옵션"
;END DIALOG
;DIALOG EDITOR: "" 0x2040202 "*" "2" "" ""

int x(58) y(1045)
str controls = "1101 1201 1203 1204"
str c1101 qmg1201 cb1203 cb1204
cb1203="&전체"
cb1204="&전체"
if(!ShowDialog(dd &SmartControl_CrawlingBot_Opt &controls 0 0 0 0 x y)) ret
ret
;messages
sel message
,case WM_INITDIALOG

,;Start_Page
,DT_Page(hDlg 0)

,;Set_grid
,s.ColumnsAdd("저작권,15%,0[]분류,10%,7[]제목,45%,7[]가격,15%,7[]제외단어,18%,7" 1)
,s.GridStyleSet(2|16|32)

,;Get_excel
,SmartControl_getExcel_Filename ExcelFilePath 1203 hDlg


,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
str combobox_text
sel wParam
,case [STN_CLICKED<<16|3,4,5] ;;Option_group
,err-
,sel wParam
,,case STN_CLICKED<<16|3
,,DT_Page(hDlg 1)
,,case STN_CLICKED<<16|4
,,DT_Page(hDlg 2)
,,case STN_CLICKED<<16|5
,,DT_Page(hDlg 3)


,case CBN_SELENDOK<<16|1203
,,CB_SelectedItem(id(1203 hDlg) combobox_text)
,,SmartControl_getExcel_Sheetname ExcelFilePath combobox_text 1204 hDlg


,case CBN_SELENDOK<<16|1204
,,CB_SelectedItem(id(1204 hDlg) combobox_text)
,,out combobox_text

,,case IDOK
,,case IDCANCEL

ret 1

Function SmartControl_getExcel_Filename
Code:
Copy      Help
function# [$ExcelFilePath] [#ID] [#hDlg]

int Excel_ListName Excel_SheetName

Dir ExcelData
str Excel_path Excel_name

foreach(ExcelData ExcelFilePath FE_Dir) ;;★★Path_Change★★
,Excel_path=ExcelData.FullPath;; out Excel_path
,Excel_name=ExcelData.FileName;; out Excel_name
,Excel_name.findreplace(".xls" "")

,;Add ExcelFile
,Excel_ListName=id(ID hDlg)
,CB_Add(Excel_ListName Excel_name)

Function SmartControl_getExcel_Sheetname
Code:
Copy      Help
function# [$ExcelFilePath] [$FileName] [#ID] [#hDlg]

int Excel_ListName Excel_SheetName

Dir ExcelData
str Excel_path Excel_name

foreach(ExcelData ExcelFilePath FE_Dir) ;;★★Path_Change★★
,Excel_path=ExcelData.FullPath;; out Excel_path
,if find(Excel_path FileName 0 1)>=0
,,out Excel_path

,,ExcelSheet es.Init("" 8 Excel_path)
,,Excel.Application ea=es.ws.Application
,,Excel.Workbook wb
,,Excel.Worksheet ws
,,foreach wb ea.Workbooks
,,,str wbName=wb.Name
,,,int nSheets=wb.Worksheets.Count
,,,;out "%i worksheets in %s:" nSheets wbName
,,,foreach ws wb.Worksheets
,,,,str wsName=ws.Name
,,,,;out wsName

,,,,Excel_ListName=id(ID hDlg)
,,,,CB_Add(Excel_ListName wsName)


Attached Files Image(s)
   


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)