Solved

Crosstab-Multiple Selected values in powerscript variable

Posted on 2004-04-08
7
319 Views
Last Modified: 2013-12-26
Hi All,

How do I do multiple selection in a Crosstab object ? And depending on selection i want to do some processing. Consider following scenario:-

      Column1      Column2      Column3      Column4      Column5
      01/01/04      02/01/04      03/01/04      04/01/04      05/01/04
Row1                              
Row2      Selected      Selected      Selected            
Row3                              
Row4                              
Row5            Selected      Selected      Selected      
Row6                              
Row7                              
Row8      Selected      Selected      Selected      Selected      Selected
Row9                              
Row10                              

In the above crossatab object I have enabled the "Mouse Selection" property. Using control button on the keyboard I can do multiple selection within the crosstab. Now my question here is I want to store these selected values in powerscript variable like

for first row
     ls_str[1] = 'Row2'
     ld_from[1] = '01/01/04'
     ld_to[1] = '03/01/04'
next

for second row
     ls_str[2] = 'Row5'
     ld_from[2] = '02/01/04'
     ld_to[2] = '04/01/04'
next

for last row
     ls_str[3] = 'Row8'
     ld_from[3] = '01/01/04'
     ld_to[3] = '05/01/04'
next

pls. get back to me for any clarification.

awaiting for a solution...........

0
Comment
Question by:JatinVaishnav
7 Comments
 
LVL 15

Accepted Solution

by:
namasi_navaretnam earned 500 total points
ID: 10782866
In the clicked event of the datawindow you can use ObjectAtpointer function to obtain row/column info. row is a predefined parameter in the clicked event.


In clicked event:
String dwobjectname

dwobjectname = dw_1.GetObjectAtPointer()
messagebox("debug", dwobjectname + '||' + string(row) )

Also try:
long ll_row, ll_col
ll_col = dw_1.getclickedcolumn()
ll_row = dw_1.GetClickedRow()

MessageBox("debug", string(ll_col) + '|' + string(ll_row))

long ll_data[1000, 1000]
ll_data[ll_row, ll_col] = dw_1.GetItemNumber(ll_row, ll_col)

MessageBox("data",  string(ll_data[ll_row, ll_col]))

regards-

0
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 10782870
Please close open questions.

Regards :)
0
 
LVL 14

Expert Comment

by:sandeep_patel
ID: 10784333
namasi,
i think it will not fulfil jatin's requirement b'coz he wants the value of column heading in crosstab. not the value at cross-section of row and column.

so if in a cross-tab,
emp_code is as row and hire_date is as column and pay_amt is as value then your solution gives 'pay_amt' i.e. value.
but jatin wants hire_date i.e. column and rownumber

rownumber is not the problem only column heading value is the problem..

m i right ?
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
LVL 8

Expert Comment

by:Vikas_Dixit
ID: 10785213
Have you tried this :

ls_selected_data = This.Object.DataWindow.Selected.Data)

--VIkas
0
 
LVL 8

Expert Comment

by:Vikas_Dixit
ID: 10785221
Ignore the bracket......... :)
0
 
LVL 8

Expert Comment

by:Vikas_Dixit
ID: 10785358
Also see :
dw_control.Object.DataWindow.Selected
This will return you the list of selected columns in the format :
startrow1/endrow1/startobj1/endobj1;startrow2/endrow2/startobj2/endobj2;...
Map this to wnat you got from This.Object.DataWindow.Selected.Data

Regards,
VIkas
0
 

Author Comment

by:JatinVaishnav
ID: 10796988
Hi All,

Thanks for your reply.

I can't accept namasi's answer the same reason what sandeep has explained.

I have tried Vikas's solution also but i can't accept as it is giving the data within the column and not the column header.

I got the column header values from dw_1.Describe("t_2"+String(mid(ls_col,14))+".Text").

I owe half the points to namasi.

Bye


Thanks
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question