⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wksheet.h

📁 图像处理的压缩算法
💻 H
📖 第 1 页 / 共 5 页
字号:
			Object		ocrs;
			ocrs = CreateObject("ADODB.Recordset");
			ocrs.open("select * from customers", "Provider=SQLOLEDB; Data Source=myServer; Initial Catalog=northwind; User ID=myID; Password=myPassword;");
			Worksheet		wks("Data1");
			// Put changes in worksheet back to the recordset:
			BOOL			bRet = wks.UpdateRecordset(ocrs);
			out_int("bRet = ", bRet);
		}
	SeeAlso:
		Worksheet::PutRecordset
	
*/
	BOOL	UpdateRecordset(Object &objrs,
								int nRowBegin = 0,
								int nNumRows = -1,
								int nColBegin = 0,
								int nNumCols = -1);
/**
		Put the data from the worksheet into the recordset. The locktype of the recordset must be appropriate for
		adding data which means that it should not be read-only.
	Remarks:
		This function is available only for OriginPro versions, or with a special COM enabled license
	Parameters: 
		objrs or varobjrs	= the recordset
		nRowBegin			= the starting row in the worksheet
		nNumRows			= total number of rows to put,or -1 to put all rows.
		nColBegin			= the worksheet column from which to start (the first column will be used for the first field, etc.).
		nNumCols			= the number of columns to use, beginning with nColBegin, or -1 to use all columns to the right of nColBegin.
							  If there are less columns than fields, the remaining fields will be set to null.
 
	Return:
		TRUE for success; otherwise FALSE.
	Example:
		void	worksheet_recordset()
		{
			Object		ocrs;
			
			ocrs = CreateObject("ADODB.Recordset");
			
			ocrs.open("select * from customers", "Provider=SQLOLEDB; Data Source=myServer; Initial Catalog=northwind; User ID=myID; Password=myPassword;");
				
			Worksheet		wks("Data1");
			
			// Put changes in worksheet back to the recordset:
			BOOL			bRet = wks.UpdateRecordset(ocrs);
			out_int("bRet = ", bRet);
		}
	SeeAlso:
		Worksheet::PutRecordset
*/
	BOOL	UpdateRecordset(_VARIANT &varobjrs,
								int nRowBegin = 0,
								int nNumRows = -1,
								int nColBegin = 0,
								int nNumCols = -1);

								
#endif //#ifdef	ORIGIN_COM_SUPPORT

#if _OC_VER > 0x0703

	/**
		Create a copy of the worksheet wksSource and attaches it to the object.
	Parameters: 
		wksSource = the worksheet whose copy is made
		nOption	= enum {
						CREATE_TEMP = 0,		// it will be destroyed when destroying the object (when it exits the scope) and is created invisible
						CREATE_VISIBLE_SAME,	// visibility is that of the source worksheet
						CREATE_VISIBLE,			// create visible
						CREATE_HIDDEN,			// create hidden 
					   };
		DWORD dwCtrl = enum {
								DCTRL_COPY_DATA						= 0x00000001, // copy data from source worksheet
								DCTRL_COPY_IN_OPERATIONS			= 0x00000002, // copy operations that have worksheet as output (incoimng operations)
								DCTRL_COPY_OUT_OPERATIONS			= 0x00000004, // copy operations that have worksheet as input (outgoing operations)
								DCTRL_COPY_DEFAULT = DCTRL_COPY_DATA | DCTRL_COPY_OUT_OPERATIONS,
							}
 	Return:
		TRUE for success; otherwise FALSE.
	Example:
		void	worksheet_copy()
		{
			Worksheet	wks;
			Worksheet	wksSource("Data1");
			
			int			nOption = CREATE_VISIBLE_SAME;
			BOOL		bRet = wks.CreateCopy(wksSource, nOption);
			
			out_int("bRet = ", bRet);
		}
	SeeAlso:
		Datasheet::Create
	*/
	BOOL	CreateCopy(Worksheet &wksSource, int nOption = CREATE_VISIBLE_SAME, DWORD dwCtrl = DCTRL_COPY_DEFAULT);
#else
/**
		Create a copy of the worksheet wksSource and attaches it to the object.
	Parameters: 
		wksSource = the worksheet whose copy is made
		nOption	= enum {
						CREATE_TEMP = 0,		// it will be destroyed when destroying the object (when it exits the scope) and is created invisible
						CREATE_VISIBLE_SAME,	// visibility is that of the source worksheet
						CREATE_VISIBLE,			// create visible
						CREATE_HIDDEN,			// create hidden 
					   };






 	Return:
		TRUE for success; otherwise FALSE.
	Example:
		void	worksheet_copy()
		{
			Worksheet	wks;
			Worksheet	wksSource("Data1");
			
			int			nOption = CREATE_VISIBLE_SAME;
			BOOL		bRet = wks.CreateCopy(wksSource, nOption);
			
			out_int("bRet = ", bRet);
		}
	SeeAlso:
		Datasheet::Create
*/
	BOOL	CreateCopy(Worksheet &wksSource, int nOption = CREATE_VISIBLE_SAME);
	

#endif
/**
		Open a new worksheet from the supplied OGW file and attaches it to the object.
	Parameters: 
		lpcszTemplate = the OGW file name
		nOption	= enum {
						CREATE_TEMP = 0,	// it will be destroyed when destroying the object (when it exits the scope) and is created invisible
						CREATE_VISIBLE_SAME,	// visibility is that which is stored in the OGW file
						CREATE_VISIBLE,		// create visible
						CREATE_HIDDEN,		// create hidden
						}; 
	Return:
		TRUE for success; otherwise FALSE.
	Example:
		void	worksheet_open()
		{
			Worksheet	wks;
			string		strOGW = "c:\\myfile.ogw";
			
			int			nOption = CREATE_VISIBLE_SAME;
			BOOL		bRet = wks.Open(strOGW, nOption);
			
			out_int("bRet = ", bRet);
		}
*/
	BOOL	Open(LPCSTR lpcszFileName, int nOption = CREATE_VISIBLE);
	
/**
		Show [Hide] column labels in Origin c 

	Parameters:
		bShow = TRUE (default) shows Column Labels
				FALSE will hide Column Labels
	Return:
		None.
	Example:
		void show_wks_labels()
		{
			Worksheet wks("data1");
			string strLabel = "Elapsed\n(in sec.)";
			BOOL b = wks.Columns(0).SetLabel(strLabel);
			wks.ShowLabels();
		}
	SeeAlso:
		Column::SetLabel, Column::GetLabel
*/
	void	ShowLabels(BOOL bShow = TRUE);
/**
		Dump the contents of the worksheet into the designated target window.
	Parameters: 
		dwTarget = enum {
							TYPETARGET_SCRIPT_WINDOW	= 0x00000001UL,		// to the Script window
							TYPETARGET_NAMED_WINDOW		= 0x00000002UL,		// to the particular Notes window
							TYPETARGET_OUTPUTLOG		= 0x00000004UL,		// to output log
							TYPETARGET_SHOW_ERROR		= 0x00000008UL,		// show errors
						};
			These bits cab be combined.
			Note: TYPETARGET_SHOW_ERROR is a constant which should be combined (bitwise "OR-ed") with other constants. 
			In the case it is combined with TYPETARGET_NAMED_WINDOW, it will report into Script Window (or other output) 
			when the Notes window with the supplid name does not exist.In other words, it is supposed to make the Type method 
			"report" method errors (same as type.wks() method of LabTalk works). If TYPETARGET_SHOW_ERROR is supplid alone, 
			nothing should happen.

		lpcszNotesWindow =	the name of the notes window to receive the output 
							(used only for TYPETARGET_NAMED_WINDOW).
		numCols = the number of columns in one block
		nTab = tab width (if 0, use worksheet column width as tab width)
		nRepeatCol = the 1-offset index of the column which is to appear at 
						the beginning of every block
	Return:
		TRUE for sccess otherwise FALSE.
	Example:
		void	worksheet_type()
		{
			Worksheet	wks("Data1");
			BOOL		bRet = wks.Type(TYPETARGET_OUTPUTLOG | TYPETARGET_SHOW_ERROR, NULL, 2, 0, 1);
			
			out_int("bRet = ", bRet);
		}
*/
#if _OC_VER > 0x0703	
	BOOL	Type(DWORD dwTarget, LPCTSTR lpcszNotesWindow = NULL, int numCols = 5, int nTab = 0, int nRepeatCol = 0, TreeNode &trRanges = NULL);
#else
	BOOL	Type(DWORD dwTarget, LPCTSTR lpcszNotesWindow = NULL, int numCols = 5, int nTab = 0, int nRepeatCol = 0);
#endif

/**
		Get the minimum begining and maximum ending row indices for the specified columns in this Worksheet.
	Parameters:
		iR1=Output minimum begining row index (0 based)
		iR2=Output maximum ending row index (0 based)
		iC1=Input begining column index (0 based offset, default 0 is first column)
		iC2=Input ending column index (0 based offset, default -1 to indiate last column)
		bExcludeMissingValues=TRUE (default) advances iR1 to first row with non-missing value and retards iR2 to last row with with non-missing value.
		FALSE will not modify iR1 and iR2
	Return:
		Returns TRUE on success and FALSE on failure.
	Example:
		void wks_get_range()
		{
			Worksheet wks = Project.ActiveLayer();
			int nR1, nR2;
			
			wks.GetRange(nR1, nR2);
			// need to convert to LabTalk indexing by +1
			printf("%s[%d:%d]\n", wks.GetPage().GetName(), nR1+1, nR2+1);
			// show for each column and check consistency
			foreach(Column cc in wks.Columns)
			{
				Dataset aa(cc);
				printf("Col(%s)[%d:%d]\n",cc.GetName(), aa.GetLowerIndex()+1, aa.GetUpperIndex()+1);
			}
		}
*/
	BOOL GetRange( int& iR1, int& iR2, int iC1 = 0, int iC2 = -1, BOOL bExcludeMissingValues = TRUE);
/**
		Set the begining and ending row indices for the specified columns in this Worksheet.
	Parameters:
		iR1=Input begining row index (0 based)
		iR2=Input ending row index (0 based)
		iC1=Input begining column index (0 based offset, default 0 is first column)
		iC2=Input ending column index (0 based offset, default -1 is last column)
	Return:
		Returns TRUE on success and FALSE on failure.
	Example:
		// usage
		// wks_set_range 1 0;// to clear worksheet
		// wks_set_range 3 200;// show rows from 3 to 200
		void wks_set_range(int nBegin, int nEnd)
		{
			Worksheet wks = Project.ActiveLayer();
			// convert LabTalk index into C index
			int nR1 = nBegin -1;
			int nR2 = nEnd -1;
			
			wks.SetRange(nR1, nR2);
		}
*/
	BOOL SetRange( int iR1, int iR2, int iC1 = 0, int iC2 = -1 ); 

/**
		Get the minimum begining and maximum ending row indices for the specified columns in this Worksheet.
	Parameters:
		iR1=Output minimum begining row index (0 based)
		iC1=Input begining column index(0 based)
		iR2=Output maximum ending row index (0 based)
		iC2=Input ending column index(0 based)
		bExcludeMissingValues=TRUE (default) advances iR1 to first row with non-missing value and retards iR2 to last row with with non-missing value.
		FALSE will not modify iR1 and iR2
	Return:
		Returns TRUE on success and FALSE on failure.
	Example:
		void wks_get_bound()
		{
			Worksheet wks = Project.ActiveLayer();
			int nR1, nR2;
			
			wks.GetBounds(nR1, 0, nR2, -1);
			// need to convert to LabTalk indexing by +1
			printf("%s[%d:%d]\n", wks.GetPage().GetName(), nR1+1, nR2+1);
			// show for each column and check consistency
			foreach(Column cc in wks.Columns)
			{
				Dataset aa(cc);
				printf("Col(%s)[%d:%d]\n",cc.GetName(), aa.GetLowerIndex()+1, aa.GetUpperIndex()+1);
			}
		}

*/
	BOOL GetBounds( int& iR1, int iC1, int& iR2, int iC2, BOOL bExcludeMissingValues = TRUE);

/**
		Set the begining and ending row indices for the specified columns in this Worksheet.
	Parameters:
		iR1=Input begining row index (0 based)
		iC1=Input begining column index (0 based offset, default 0 is first column)
		iR2=Input ending row index (0 based)
		iC2=Input ending column index (0 based offset, default -1 is last column)
	Return:
		Returns TRUE on success and FALSE on failure.
	Example:
		// usage
		// wks_set_bound 1 0;// to clear worksheet
		// wks_set_bound 3 200;// show rows from 3 to 200
		void wks_set_bound(int nBegin, int nEnd)
		{
			Worksheet wks = Project.ActiveLayer();
			// convert LabTalk index into C index
			int nR1 = nBegin -1;
			int nR2 = nEnd -1;
			
			wks.SetBounds(nR1, 0, nR2);
		}
*/
	 BOOL SetBounds( int iR1 = 0, int iC1 = 0, int iR2 = -1, int iC2 = -1 );

/**
		Set the ending row indices for the specified columns in this Worksheet.
		Index values are 0 based offsets so use SetUpperBound(-1) to dispaly no
		rows.
	Parameters:
		iR2=Input ending row index (0 based)
		iC1=Input begining column index (0 based offset, default 0 is first column)
		iC2=Input ending column index (0 based offset, default -1 is last column)
	Return:
		Returns TRUE on success and FALSE on failure.
	Example:
		Worksheet wks = Project.ActiveLayer();
		
		int nR2 = 25;		
		wks.SetUpperBound(nR2);

*/
	BOOL SetUpperBound( int iR2, int iC1 = 0, int iC2 = -1 );
/**
		Set the begining row indices for the specified columns in this Worksheet.
	Parameters:
		iR1=Input begining row index (0 based)
		iC1=Input begining column index (0 based offset, default 0 is first column)
		iC2=Input ending column index (0 based offset, default -1 is last column)
	Return:
		Returns TRUE on success and FALSE on failure.
	Example:
		Worksheet wks = Project.ActiveLayer();
		
		int nR1 = 5;		
		wks.SetLowerBound(nR1);
*/
	BOOL SetLowerBound( int iR1, int iC1 = 0, int iC2 = -1 );
	/**
		A Collection of all Columns in a Worksheet
	Example:
		Worksheet wks = Project.ActiveLayer();
		if( wks )
		{
			int ii = 1;
			foreach(Column cc in wks.Columns)
			{
				printf("Col(%d)'s name is %s\n",ii++, cc.GetName()); 
			}
		}
	*/
	Collection<Column> Columns;
/**
	Remarks: 
		Used to call Column member functions directly with a '.' after the function call	
	Parameters: 
		nCol = Column number with zero offset (-1 refers to *Active* column)
	Return: 
		A Column
	Example: 
		Worksheet wks("Data1");
		ASSERT(wks.Columns(0).IsValid());
*/	
	Column	Columns(int nCol = -1);		//Return a column - can be used to call column members directly with a '.' after function call

/**
	Remarks: 
		Used to call Column member functions directly with a '.' after the function 
		call	
	Parameters: 
		lpcszName = Column name
	Return: 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -