Matrix with CFL and RecordSet with DoQuery
Hello Experts,
How to use Matrix with CFL and RecordSet with DoQuery
Hi Manish,
Refer to SDK sample on CFL at ...\SAP\SAP Business One SDK\Samples\COM UI\VB.NET\17.ChooseFromList
Go to SDK Help, Developer's Guide -> DI DPI -> Reference -> Overview -> Objects -> Recordset
see the Example "Recordset Operations sample" at the bottom of the page
HTH
Aravind
Similar Messages
-
How to fill matrix with the output of recordset query?
Hi all,
I want a user matrix to load data when I hit a button and the data to be filled is the output of an sql query. binding the matrix columns with table columns and then load the matrix with DBDatasource attached to that table will not do in this case as the columns in the sql query are from several different tables or views.
writing following line to do this takes several minutes to load the data:
For j = 0 To Reordset.RecordCount - 1
Matrix.AddRow()
Matrix.Columns.Item("col1").Cells.Item(i).Specific.value = Recordset.Fields.Item("cardcode").Value
Recordset.movenext()
next
Is there any other way to fill the matrix in this case, which loads the data faster?
Regards,Hello Binita,
I've tested the CFL for DataTable-Matrixes in my test-AddOn. But there's still one problem left. Maybe you find it out (I will need this in the future too...).
The ChooseFromList must be added behind the DataTable-Bind, which is done on every MTX-Load (it's not from the sample above, so the UIDs are new ones):
oDt = oDts.Item("dt_test")
query = "SELECT * FROM [@T_CONVTOOLS01]"
oDt.ExecuteQuery(query)
oMtx.Columns.Item("0").DataBind.Bind("dt_test", "Code")
oMtx.Columns.Item("1").DataBind.Bind("dt_test", "U_Alpha01")
oMtx.Columns.Item("2").DataBind.Bind("dt_test", "U_Price01")
oMtx.Columns.Item("3").DataBind.Bind("dt_test", "U_Quant01")
oMtx.Columns.Item("4").DataBind.Bind("dt_test", "U_Date01")
AddChooseFromLists()
oMtx.LoadFromDataSource()
...where AddChooseFromLists() is...
Private Shared Sub AddChooseFromLists()
Try
Dim oCfls As SAPbouiCOM.ChooseFromListCollection
Dim oCons As SAPbouiCOM.Conditions
Dim oCon As SAPbouiCOM.Condition
Dim oCfl As SAPbouiCOM.ChooseFromList
Dim oCflCreationParams As SAPbouiCOM.ChooseFromListCreationParams
Dim oBtn As SAPbouiCOM.Button
Dim oMtx As SAPbouiCOM.Matrix
Dim oCol As SAPbouiCOM.Column
Dim oEtx As SAPbouiCOM.EditText
oMtx = oForm.Items.Item("MTX_TEST02").Specific
oCfls = oForm.ChooseFromLists
oCflCreationParams = SboCon.SboUI.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
oCflCreationParams.MultiSelection = False
oCflCreationParams.ObjectType = SAPbouiCOM.BoLinkedObject.lf_BusinessPartner
oCflCreationParams.UniqueID = "CFL_C1"
oCfl = oCfls.Add(oCflCreationParams)
'### OPTION:
'# Shown ChooseFromList restricted by Conditions
oCons = oCfl.GetConditions()
oCon = oCons.Add()
oCon.Alias = "CardType"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = "C"
oCfl.SetConditions(oCons)
oCol = oMtx.Columns.Item("1")
oCol.ChooseFromListUID = "CFL_C1"
oCol.ChooseFromListAlias = "CardCode"
Catch e As Exception
Microsoft.VisualBasic.MsgBox(className & ".AddChooseFromLists()" & vbCrLf & "Exception:" & vbCrLf & e.Message.ToString)
End Try
End Sub
But I'm running into problems when trying to set the MTX-Cell via DataTable at the CFL-Event (see comment):
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
Dim oMtx As SAPbouiCOM.Matrix
Dim oCFLEvent As SAPbouiCOM.IChooseFromListEvent
Dim oCFL As SAPbouiCOM.ChooseFromList
Dim oDataTable As SAPbouiCOM.DataTable
Dim cflID As String
Dim oDt As SAPbouiCOM.DataTable = oForm.DataSources.DataTables.Item("dt_test")
oCFLEvent = pVal
cflID = oCFLEvent.ChooseFromListUID
'Dim oForm As SAPbouiCOM.Form
'oForm = SboConnection.SboUI.Forms.Item(FormUID)
oCFL = oForm.ChooseFromLists.Item(cflID)
If Not oCFLEvent.BeforeAction Then
oDataTable = oCFLEvent.SelectedObjects
If oDataTable Is Nothing Then Exit Sub
'############## Matrix Test #######################################################################
If (oCFLEvent.ItemUID = "MTX_TEST02") Then
oMtx = oForm.Items.Item("MTX_TEST02").Specific
'### CFL Results to UserForm
oDt.Rows.Offset = oCFLEvent.Row - 1
MsgBox(oDt.GetValue("U_Alpha01", oCFLEvent.Row - 1))
MsgBox(oDataTable.GetValue("CardCode", 0))
' PROBLEM - can't get this working - don't know at the moment:
' on other forms SetValue works....
oDt.SetValue("U_Alpha01", oCFLEvent.Row - 1, oDataTable.GetValue("CardCode", 0))
' this also gives me problems...:
'oMtx.Columns.Item("1").Cells.Item(oCFLEvent.Row).Specific.value = oDataTable.GetValue("CardCode", 0)
oForm.Update()
End If
End If
End If
The CFL-Form opens and returns the choosen value(s) at the CFL-event. But writing to MTX still not works with this code...
Maybe you find the last piece. If so: please write here.
Cheers,
Roland
p.s.:
David Nussböck wrote
LOL - ROLAND WAS FASTER ))
...just one minute... -
hi friends,
i have created program which is matrix with clf. inthat program i have created 7 coloumns values as employee id, firstname,floor,desg,time,extrahour,otallowance. here i have created cfl in employee id column. when i press tab button in employee id the values like employee id,firstname,floor,desg should store in appropriate column. plz tell me how can i do that? can u tell me whats the coding?hi
here is the complete coding .. it is working for me...
Public Class Class1
Public WithEvents SBO_Application As SAPbouiCOM.Application
Dim oform As SAPbouiCOM.Form
Dim oitem As SAPbouiCOM.Item
Dim oedit, oedit1 As SAPbouiCOM.EditText
Dim ocompany As SAPbobsCOM.Company
Dim olinked As SAPbouiCOM.LinkedButton
Public Sub SetApplication()
Dim SboGuiApi As SAPbouiCOM.SboGuiApi = New SAPbouiCOM.SboGuiApi
Dim sConnectionString As String
sConnectionString = Environment.GetCommandLineArgs.GetValue(1)
SboGuiApi.Connect(sConnectionString)
SBO_Application = SboGuiApi.GetApplication()
End Sub
Private Function SetConnectionContext() As Short
Dim sCookie As String
Dim sConnectionContext As String
ocompany = New SAPbobsCOM.Company
sCookie = ocompany.GetContextCookie
sConnectionContext = SBO_Application.Company.GetConnectionContext(sCookie)
If ocompany.Connected = True Then
ocompany.Disconnect()
End If
SetConnectionContext = ocompany.SetSboLoginContext(sConnectionContext)
End Function
Public Sub LoadFromXML(ByRef FileName As String)
Dim oXmlDoc As Xml.XmlDocument
oXmlDoc = New Xml.XmlDocument
Dim sPath As String
sPath = IO.Directory.GetParent(Application.StartupPath).ToString
oXmlDoc.Load(sPath & "\" & FileName)
SBO_Application.LoadBatchActions(oXmlDoc.InnerXml)
End Sub
Private Function ConnectToCompany() As Short
ConnectToCompany = ocompany.Connect
End Function
Public Sub con()
If Not SetConnectionContext() = 0 Then
SBO_Application.StatusBar.SetText("Connection Failed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
End
End If
If Not ConnectToCompany() = 0 Then
SBO_Application.StatusBar.SetText("Connection Failed", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
End
End If
End Sub
Public Sub New()
MyBase.New()
SetApplication()
con()
LoadFromXML("manoj.srf")
oform = SBO_Application.Forms.Item("sbo")
oform.Visible = True
AddChooseFromList()
oedit = oform.Items.Item("t1").Specific
oedit.DataBind.SetBound(True, "@INDIAN", "U_Name")
oedit.ChooseFromListUID = "CFL1"
oedit.ChooseFromListAlias = "DocNum"
oitem = oform.Items.Item("l1")
olinked = oitem.Specific
olinked.LinkedObjectType = SAPbouiCOM.BoLinkedObject.lf_Order
End Sub
Public Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
If pVal.ItemUID = "t1" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
oCFLEvento = pVal
Dim sCFL_ID As String
sCFL_ID = oCFLEvento.ChooseFromListUID
Dim oForm As SAPbouiCOM.Form
oForm = SBO_Application.Forms.Item(FormUID)
Dim oCFL As SAPbouiCOM.ChooseFromList
oCFL = oForm.ChooseFromLists.Item(sCFL_ID)
If oCFLEvento.BeforeAction = False Then
Dim oDataTable As SAPbouiCOM.DataTable
oDataTable = oCFLEvento.SelectedObjects
Dim val As String
If pVal.ItemUID = "t1" Then
Try
oitem = oForm.Items.Item("t1")
oedit = oitem.Specific
val = oDataTable.GetValue("DocNum", 0)
oedit.Value = val
Catch ex As Exception
End Try
End If
End If
End If
End Sub
Private Sub AddChooseFromList()
Try
Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
oCFLs = oForm.ChooseFromLists
Dim oCFL As SAPbouiCOM.ChooseFromList
Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
oCFLCreationParams.MultiSelection = False
oCFLCreationParams.ObjectType = "17"
oCFLCreationParams.UniqueID = "CFL1"
oCFL = oCFLs.Add(oCFLCreationParams)
Catch
MsgBox(Err.Description)
End Try
End Sub
End Class -
How to create a matrix with constant values and multiply it with the output of adc
How to create a matrix with constant values and multiply it with the output of adc
nitinkajay wrote:
How to create a matrix with constant values and multiply it with the output of adc
Place array constant on diagram, drag a double to it, r-click "add dimension". There, a constant 2D double array, a matrix.
/Y
LabVIEW 8.2 - 2014
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
G# - Free award winning reference based OOP for LV -
Matrix with DataTable - GetLineData and SetLineData B1 8.8 Bug
Hi experts,
I have a matrix bounded to a DataTable and I succefully load the matrix with:
DataTable dt = form.DataSources.DataTables.Item("matDT");
dt.ExecuteQuery(sql);
Matrix mat = form.Items.Item("mat").Specific as Matrix;
mat.LoadFromDataSource();
mat.AutoResizeColumns();
Now in Event et_VALIDATE(after), i would like to change some not editable column of the matrix
[B1Listener(BoEventTypes.et_VALIDATE, false)]
public virtual void OnAfterValidate(ItemEvent pVal) {
if(pVal.ItemUID!="mat")
return;
Form form = B1Connections.theAppl.Forms.Item(pVal.FormUID);
Matrix mat = form.Items.Item("mat").Specific as Matrix;
DataTable dt = form.DataSources.DataTables.Item("matDT");
//Pont 1)
mat.GetLineData(pVal.Row)
//Point 2
//Change Values
int minutes = dt.GetValue("U_Minutes", pVal.Row-1);
dt.SetValue("U_Hours",pVal.Row-1, (double) minutes / 60);
//Point 3
mat.SetLineData(pVal.Row);
Now I will expain the problem:
For simplicity assume the matrix has 2 rows after load. After the user edit a column, validate event fires and:
-) After the call of GetLineData in Point 1) I verified that all DataTable Rows are identical (derived from the first row in the matrix)
-) If I substitute GetLineData in point 1) with FlushToDataSource, DataTable became corret but after the call of SetLineData in point 3) all the matrix rows are identical (derived from the first DataTable row).
-) If I also substitute SetLineData in point 3) with LoadFromDataSource, all works fine but i loose focus and performances
Is it a B1 8.8 Bug?Yes, but sap said that my customer is not officially approved.
the following is the original text.
Please note that SAP Business One Release 8.8 has only been released for
Ramp-Up. Because of this, only approved projects for productive usage a
re fully supported by SAP Business One Support. However feedback on prod
uct quality or bugs reporting from all partners - even from partners who
are not part of the Ramp-Up - is welcome and highly appreciated.
According to the information we have, your customer is not officially ap
proved for Ramp-Up yet. Due to the difficulty to estimate the number of
messages that will be submitted, SAP cannot commit itself to solving all
issues reported about projects not officially approved for Ramp-Up, nor
guarantee any response times.
Kind regards,
SAP Business One Support -
Loading a grid or matrix with external data
Hi, we have two SAP companies defined, from one company I need to perform a search on the second company and provide a grid or a matrix with the results.
We are using the 2007 SDK is it possible to do this?
Many thanks.
Mike.i think you can use the Recordset object like "oRs.DoQuery("select [company2].dbo.table.....
-
How to create a matrix with choosefromlist? the value of my choosefromlist is a UDO.
I have already registered my UDO.
Under collection tab, i added choosefromlist where my objectType is the name of my UDO.
In columns tab, i set the following:
databound = True
Table = @userTable
Type = it_Edit
Specific:
ChooseFromListAlias = u_ItemNo
ChooseFromListUID = CFL_4
Still, when in preview mode, there is no choosefromlist visible.
Is there something i did wrong?
Thanks in advance. =)>
Yatsea Li wrote:
> Hello Gabbo,
>
> Just set the object type as your UDO type. Don't forget the set the find columns when define the UDO. e.g..
>
' Adding 2 CFL, one for the button and one for the edit text.
> oCFLCreationParams.MultiSelection = False
> oCFLCreationParams.ObjectType = "SMC_OMOV"
> oCFLCreationParams.UniqueID = "CFL1"
>
> Kind Regards, Yatsea
Hi Yatsea!
How about in screen painter instead of coding? Is there a way? Thanks!
and I have another problem, I created matrix from screen painter, it's working okay, but when I load it from code, I cannot select a column (the column is "it_edit" so I should be able to input data from it). I am sure that I have set the matrix and its columns as editable but yet it's not working. Any idea why? Thanks! =) -
Hi All,
I need to create a 5/5 matrix in SSRS report. The data will be :
Col_Side Col_Header Col_data
1 1 1
1 1 1
1 2 1
1 5 1
1 5 1
1 5 1
2 3 1
2 5 1
3 1 2
3 1 2
3 1 2
4 2 1
4 4 1
5 1 1
5 1 1
5 5 1
So, the matrix column will be Col_Header and matrix row will be Col_Side and count(Col_data) will be on the data.
Finally, it will create a 5 by 5 matrix with Count(Col_data) as its data for each combinations. If there is no combination (for ex: in the above data we do not have no combination of (1,3) , (1,4) , (2,1) etc..) then the matrix will be filling that corresponding
cell with zero.
Here I need to fill the cells with some colors based on some criteria.
I need to fill (5,3), (5,4), (5,5) combination with "Red" color. Like this , I need to give different colors in each of the cells. Here, (5,5) combination will be having 1 in its cell. (5,4) and (5,3) will be having zero in its corresponding
cells. I 'm trying to fill all the 3 cells with "Red" color. But, I am able to fill only (5,5) with "Red" color. Since the other 2 cells (5,3) and (5,4), has zero in their cells, it will not fill the cells with "Red" color.
How can I fill those two cells (5,3) and (5,4) with red color?
I know this is very vague. I have no option to give the picture here..
Please suggestHi Julie,
According to your description, there is a 5/5 matrix with three fields: Col_Side, Col_Header, Col_data. You drag Col_Side field to Rows, Col_Header to Columns and Col_data to Data, then filling blank cells with zero using expression. Now you want to fill
(5,3), (5,4), (5,5) cells with red color using expression, but it has no effect on cells (5,3) and (5,4).
According to my test, the expression has on effect on cells (5,3) and (5,4) since there is no corresponding data and the cells are blank. As a workaround, we can insert data for cells (5,3) and (5,4) in dataset, then use expression by following steps:
In the dataset, insert two sets of data (5,3,0), (5,4,0).
Right-click the cell of data, click Text Box Properties.
Click Fill in left pane, click (fx) button, then type the expression like below, then click OK.
=iif(Fields!Col_Side.Value=5 and Fields!Col_Header.Value >=3 ,"red","white" )
The following screenshot is for your reference:
If you have any more questions, please feel free to ask.
Thanks,
Wendy Fu -
How to create Matrix with Group report layout in xml
Hi,
i would be glad if anyone could tell me How to create Matrix with Group report layout in xml?
Here i am attaching the required design doc
below is the code
select COST_CMPNTCLS_CODE,
-- crd.RESOURCES,
NOMINAL_COST,
cmm.COST_MTHD_CODE,
-- crd.COST_TYPE_ID,
gps.period_code
-- ORGANIZATION_ID
from CM_RSRC_DTL crd,
gmf_period_statuses gps,
CM_MTHD_MST cmm,
CR_RSRC_MST crm,
CM_CMPT_MST ccm
where gps.period_id = crd.PERIOD_ID
and crd.cost_type_id = cmm.cost_type_id
and crd.RESOURCES = crm.RESOURCES
and crm.COST_CMPNTCLS_ID = ccm.COST_CMPNTCLS_ID
and gps.period_code in (:p_period1, :p_period2, :p_period3)
group by COST_CMPNTCLS_CODE, cmm.COST_MTHD_CODE, gps.period_code,NOMINAL_COST
order by 1,2,3,4.
The o/p of the report shoud be as given below
Period-1 Period-2 Period-3 Period-4
COMPONENT
LABOUR - DIRECT
Actual 1 2 3 4
Actual Rate 10 10 10 10
Standard Rate
Var%
DEPRICIATION-DIRECT
Actual
Actual Rate
Standard Rate
Var%
OVERHEAD - DIRECT
Actual
Actual Rate
Standard Rate
Var%
LABOUR - IN DIRECT
Actual
Actual Rate
Standard Rate
Var%
Thanks in advanceYour friend is obviously not a reliable source of HTML
information.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"Mr.Ghost" <[email protected]> wrote in
message
news:f060vi$npp$[email protected]..
> One of my friends advised me to develop my whole site on
the layout mode
> as its
> better than the standard as he says
> but I couldnot make an ordinary table with rows and
columns in th layout
> mode
> is there any one who can tell me how to?
> thanx alot
> -
Hi,
I like to fill system Matrix with data; please find the code below.
Thank you very much for your good work and support.
Thank you,
Rune
CODE
#region SalesOrderItemLine_GetDataFromDataSource
public void SalesOrderItemLine_GetDataFromDataSource( SAPbouiCOM.Form oForm, bool Matrix77_AddRefresh )
try
if ( Matrix77_AddRefresh )
oForm.DataSources.DataTables.Add("SYS_77");
oForm.DataSources.DataTables.Item("SYS_77").ExecuteQuery("SELECT [Code],[Name],[U_Weight],[U_PoNo],[U_CoopName],[U_Consignee],[U_PalGroup],[U_Container],[U_ItemCode],[U_CheckBoxSelect] FROM [dbo].[@MyTable] WHERE [U_MatrixAorB] = 'A' AND [U_WRKsalesOrderYN] = 'N'");
( ( SAPbouiCOM.Matrix ) ( oForm.Items.Item("77").Specific ) ).Columns.Item("1").DataBind.Bind("SYS_77", "U_ItemCode");
( ( SAPbouiCOM.Matrix ) ( oForm.Items.Item("77").Specific ) ).Clear();
( ( SAPbouiCOM.Matrix ) ( oForm.Items.Item("77").Specific ) ).LoadFromDataSource();
( ( SAPbouiCOM.Matrix ) ( oForm.Items.Item("77").Specific ) ).AutoResizeColumns();
catch ( Exception Error )
oApplication.MessageBox("Add-On Error-3232: = " + Error.Message, 1, "Ok", "", ""); // My Error Code
#endregionHi David!
This is a Product Development Collaboration suggestion!
I like to load data into system matixes...that could be really nice!
(No my problem is still out there...
Thank you,
Rune -
Alligning Group labels to center in Matrix with Group report
Hi there!
I am facing difficulty in alligning the group labels produced using matrix(cross tab) query in to center across direction. As it only stretches to first column of the underlying Matrix Across Column and Cell. Please help me in solving this prob.
Thanks in advance.
ImranFor Simple HTML output, you can only get horizontal lines out of Reports. You will lose all vertical lines as well as other graphical objects (eg: polygons, polylines, etc.) This is because these objects are not supported natively within HTML.
However, for HTMLCSS, you should be able to get a lot closer since rectangles are supported. Though again; polygons, polylines, etc. are not supported.
Not sure what is happening to your text, possibly an issue with browser settings or you may need to reduce the font size in Reports to get what you want.
As has already been suggested, for better WYSIWYG output for the web from Reports, PDF is the way to go. -
NEED HELP IN MATRIX WITH GROUP REPORT
Dear All,
I need small help in MATRIX WITH GROUP REPORT In Report Builder Test Report
In my report, having periods as rows and location as columns as shown below,
1) LOC-A
JAN-10 FEB-10
ITEM-GROUP -1 1 2
ITEM-GROUP-2 3 4
ITEM-GROUP 3 5 6
2) LOC- B
MAR-10 APR-10
ITEM-GROUP -1 7 8
ITEM-GROUP-2 9 10
ITEM-GROUP-3 11 12
But comming to my requirement, the periods should be in fix in matrix as shown below
1) JAN-10 FEB-10 MAR-10 APR-10
LOC-A
ITEM-GROUP -1 1 2
ITEM-GROUP-2 3 4
ITEM-GROUP 3 5 6
LOC- B
ITEM-GROUP -1 0 0 7 8
ITEM-GROUP-2 0 0 9 10
ITEM-GROUP-3 0 0 11 12
I am unable to get this kind of output format
Please kindly waiting for reply from our team....
Regards
krishna.PFor the periods, create a seperate dummy query and then use it as column group in the multi query matrix.
-
More than one summary level for a matrix with group
Hello friends at www.oracle.com ,
I have a report where I need to create a summary level for each row and column. In the Report wizard, it works finely, creating the summary for the 1st matrix group level.
However, if I have some extra matrix group levels - that is, a 2nd or a 3rd level -, it seems that Reports doesn't create its summary levels.
How can I create other summary levels at the matrix, outside the inner matrix?
Best regards,
Franklin Goncalves Jr.Hello petpandian,
I have a little example that intends to demonstrate what I really need. Hope it is clear enough.
(Below you can see the output I am looking for)
..................MONTH/YEAR
CITY REGION 04/2005.....05/2005
AA.....BB......$ 10,00.....$ 15,00
...............$ 11,00.....$ 16,00
Totals for BB: $ 21,00.....$ 31,00
..................MONTH/YEAR
CITY REGION 04/2005.....05/2005
AA.....CC......$ 30,00.....$ 11,00
...............$ 40,00.....$ 15,00
Totals for CC: $ 70,00.....$ 26,00
Totals for AA: $ 91,00.....$ 57,00 <-- Totals separated for each region and month/year.
As you can see, I need a matrix with group(s) around it. 1st group level is the city (AA), and I have its regions BB and CC. After showing BB values, I have BB totals for each month/year. Same applies to CC totals.
However, I expect that these results can be showed for its outside group (in this example, CITY AA), and what I have in return is the sum of all values in a single field:
Totals for CC: $ 70,00.....$ 26,00
Totals for AA:.....................$148,00 <--- The sum of all totals: it's not separated as above.
I think I should have a matrix inside a matrix, so I would have totals for each region, and totals for each city, separating by its regions and month/year.
The only solution I found was to calculate it manually via PL/SQL and inserting it into a temporary table. However, I think it is not the ideal solution because PL/SQL instructions have to handle the totals, something that Reports should do, and that's why I need help.
Your help will be greatly appreciated. Thanks in advance.
Best regards,
Franklin Goncalves Jr. -
Dear colleagues,
I have a table with a number, date, description and a text.
I want a form where I can scroll the records in a matrix (or grid) and then see the text belonging to the highlighted record in a textbox below.
How can I do this?
Something with a datasource?
Can someone help me a little?
Kind regards,
JohnHi
More samples you can find in SAP SDK Samples and this forum.
For your example, I used MatrixAndDataSources sample (look COM UI\VB.NET\06.MatrixAndDataSources\2003).
To have form what do you want need adding of some rows of vb code.
1) Open project 06.MatrixAndDataSources\2003 and paste this sub
what create the text field. See comments.
Private Sub AddMyTextField()
'// we will use the following object to add items to our form
Dim oItem As SAPbouiCOM.Item
'// to have space for our field :)... change Width of the Phone field text box from 163 to 80
oItem = oForm.Items.Item("txtPhone")
oItem.Width = 80
'// Adding a Text Edit item "txtMyField"
oItem = oForm.Items.Add("txtMyField", SAPbouiCOM.BoFormItemTypes.it_EDIT)
oItem.Left = 428
oItem.Width = 80
oItem.Top = 172
oItem.Height = 14
'// Matrix: so we set single row selection mode
oMatrix.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Single
End Sub
2) At the last row of CreateFormWithMatrix() sub add row with call to our AddMyTextField() sub
Private Sub CreateFormWithMatrix()
'// AFTER THIS ROW ...
AddMatrixToForm()
' +++++++++++++++++++++++++++++++++++++
' ADD Call to my text field subroutine
' +++++++++++++++++++++++++++++++++++++
Call AddMyTextField()
End Sub
3) Add matrix row selection event catching: in the Sub SBO_Application_ItemEvent(...) add this code:
Private Sub SBO_Application_ItemEvent( _
ByVal FormUID As String, _
ByRef pVal As SAPbouiCOM.ItemEvent, _
ByRef BubbleEvent As Boolean _
) Handles SBO_Application.ItemEvent
' +++++++++++++++++++++++++++++++++++++++++++++++++
' CATCHING SELECT ROW EVENT
' +++++++++++++++++++++++++++++++++++++++++++++++++
If (pVal.FormUID = "UidFrmMatrix") Then
If ((pVal.ItemUID = "Matrix1") And _
(pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK) And _
(pVal.Before_Action = False)) Then
' So we get value of CardCode cell (column DSCardCode) in the selected row
Dim i As Integer = pVal.Row
Dim oEdit As SAPbouiCOM.EditText
oEdit = oMatrix.Columns.Item("DSCardCode").Cells.Item(i).Specific
Dim sValue As String = oEdit.String
' So we set value of txtMyField
oEdit = oForm.Items.Item("txtMyField").Specific
oEdit.Value = sValue
' So we stop catching events
BubbleEvent = False
Else
BubbleEvent = True
End If
End If
End Sub
Run SAP Client and launch the project.
Hope it help you.
Sierdna S. -
Hi:
I need to combine two complex queries to form a report. I was able to create Matrix with Groups style for the first query, but I could not create the second one with the same style.
Is it possible for creating a second query with a Matrix with Groups Style by using Additional Default Layout in the Layout Model?
Thanks in advance for any help.
Tracy
nullhello,
the report wizard only supports the creation of one layout. however by using the report block wizard (additional default layout) you can add another layout to your report. but be aware that this wizard assumes you already have the datamodel for it. if not you have to invoke the datawizard first and then invoke the report-block wizard.
regards,
the oracle reports team
Maybe you are looking for
-
How to undo "This solved my question" on this Using iPhone forum?
How to undo "This solved my question" on this "Using iPhone" forum? new to this forum... how do you undo this?
-
How can I hide a text label as I would a control or indicator?
As I have multiple indicators that must have the same identifier to the operator I can not use the indicator label as the items identifier. At times I want to hide the indicator and label. How can I hide the label? Please recall a text label just sit
-
Unable to access vpn box internal address after vpn
Hi all. My office network is protected by asa5510 firewall with vpn configured. When i vpn into my office network i could not access the firewall via the firewall's internal address using telnet etc even though i have already enable telnet. The firew
-
I have a connection problem I can't find a fix for.
? I browsed a bunch of connection issue threads here but couldn't find one that addressed the particular issue i'm having. I've succesfully connected my Zen V Plus to my PC in the past but havn't done so in a while as I've not had the need to edit or
-
Unusual Audio Streaming Problem
I have Comcast cable, Linksys cable modem and Airport Extreme router. I monitor a web site that offers a live audio feed which I am unable to receive via cable UNLESS I run ethernet directly from the modem to my computer. HOWEVER, I can get the feed