Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default SplitVertical + C#

Hi,

How do I get data to display in the bottom half of the split pane?

I have 2 separate database queries now and I want the results of the first
one to appear in the top half and the results of the 2nd one to appear in the
bottom half.

Here's my split code...

oWB = (Excel._Workbook)(oXL.Workbooks.Add(System.Reflect ion.Missing.Value));
oSheet = (Excel._Worksheet)oWB.ActiveSheet;
Excel.Window xlWin = oXL.ActiveWindow;
xlWin.SplitVertical = 216f;

then queryA results...

int rowIndex = 2;

foreach (DataRow row in this.myDataSet1.Tables["myTableAdapter"].Rows)
{
string ExcelAccount = row["Account"].ToString();
string ExcelType = row["Type"].ToString();
string ExcelCurrency = row["Currency"].ToString();

oSheet.Cells[rowIndex, 1] = ExcelnAccount;
oSheet.Cells[rowIndex, 2] = ExcelType;
oSheet.Cells[rowIndex, 3] = ExcelCurrency;
rowIndex++;
}

QueryA should display in the top half only.

QueryB(similar code) should then display in the bottom half only.

Following the below example...

http://support.microsoft.com/kb/302084

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default SplitVertical + C#

Kev,

In Excel code, you would use

ActiveWindow.SplitRow = 0
ActiveWindow.SplitRow = 12
ActiveWindow.Panes(1).ScrollRow = 3
ActiveWindow.Panes(2).ScrollRow = 23

With variables, something like this:

lngRowNumOfSplit = 12
lngTopPaneRowNum = 3
lngBottomPaneRowNum = 35

ActiveWindow.SplitRow = 0
ActiveWindow.SplitRow = lngRowNumOfSplit
ActiveWindow.Panes(1).ScrollRow = lngTopPaneRowNum
ActiveWindow.Panes(2).ScrollRow = lngBottomPaneRowNum


How to convert that to C# is up to you.

HTH,
Bernie
MS Excel MVP


"obrienkev" wrote in message
...
Hi,

How do I get data to display in the bottom half of the split pane?

I have 2 separate database queries now and I want the results of the first
one to appear in the top half and the results of the 2nd one to appear in the
bottom half.

Here's my split code...

oWB = (Excel._Workbook)(oXL.Workbooks.Add(System.Reflect ion.Missing.Value));
oSheet = (Excel._Worksheet)oWB.ActiveSheet;
Excel.Window xlWin = oXL.ActiveWindow;
xlWin.SplitVertical = 216f;

then queryA results...

int rowIndex = 2;

foreach (DataRow row in this.myDataSet1.Tables["myTableAdapter"].Rows)
{
string ExcelAccount = row["Account"].ToString();
string ExcelType = row["Type"].ToString();
string ExcelCurrency = row["Currency"].ToString();

oSheet.Cells[rowIndex, 1] = ExcelnAccount;
oSheet.Cells[rowIndex, 2] = ExcelType;
oSheet.Cells[rowIndex, 3] = ExcelCurrency;
rowIndex++;
}

QueryA should display in the top half only.

QueryB(similar code) should then display in the bottom half only.

Following the below example...

http://support.microsoft.com/kb/302084

Thanks.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"