I am working on a Windows Application,Having trouble crating a RDLC Local report.
There are just 2 text boxes in the report, One is Employee Name & another one is address.
Everything is alright but I couldn't figure out how to pass RDLC Report variable & show its value in the Report text boxes or in the report .
Thanks
Check this post:
Using the WinForms ReportViewer Control
EDIT:
Suppose you have a TextBox Control "TxtParameter" where you enter the employee Social Security Number.
'Create a report parameter for the sales order number
Dim rpEmployeeSSN As New ReportParameter()
rpEmployeeSSN.Name = "SocialSecurityNumber"
rpEmployeeSSN.Values.Add(TxtParameter.Text)
'Set the report parameters for the report
Dim parameters() As ReportParameter = {rpEmployeeSSN}
localReport.SetParameters(parameters)
'Refresh the report
reportViewer1.RefreshReport()
*****Me.movingselectedTableAdapter.Fill(Me.LRCDBDataSet.movingselected)
'+++++++++++++ passing parameter
Dim repdate As Date = System.DateTime.Now.ToShortDateString()
Dim params(0), myparam As ReportParameter
'++++++++++++++++++try2
Dim myparams As New List(Of ReportParameter)
myparam = New ReportParameter("rptcrdate", repdate)
myparams.Add(myparam)
'Report_Parameter_1
ReportViewer1.LocalReport.SetParameters(myparams)
Me.ReportViewer1.RefreshReport()*****
Related
I have listbox with 1 columns populated with an Oracle based ADODB Recordset using
strsql = "SELECT '£' || expected_cost as ""Cost"""
lstComm.RowSourceType = "Table/Query"
Set lstComm.
Recordset = rs
The query returns £1.58, but the listbox displays #1.58.
If I use
strsql = "trim(TO_CHAR(round(expected_cost,2), 'L9999999999999.99')) as ""Cost"""
The query returns £1.58, but the listbox displays $1.58.
Is there a way to populate the column as UK currency, whilst keeping the RowSourceType as "Table/Query"?
Simple answer: Yes.
The easiest (and best) way to accomplish this is to use a Currency format type. From there you just change the Format field from Currency to £#,##0.00;(£#,##0.00)
I have one Table called tblEmployees - ID, First, Last. One unbound form called frmSearch with a textbox named Searchbox and a search button that searches by ID.I have one more unbound form called frmDisplay that displays the search result in it which I would like to edit when necessary. The textbox fields for this form are EID, Fname, Lname.
The problem I am having is when I enter the ID# in the searchbox and click the search button (where I linked both ID fields in the button wizard) it keeps on displaying the second record in my table. This is the code I currently have running
Private Sub Form_Load()
Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("SELECT * from tblEmployees WHERE ID=ID")
EID.Value = rst!ID
Fname.Value = rst!First
Lname.Value = rst!Last
end sub
When I change the code to read
("SELECT * tblEmployees WHERE ID=" & ID")
I get a syntax error missing operator in query expression ID="
ID must have some value. Then concatenate ID:
"Select * From tblEmployees Where ID = " & ID & ""
The recordset that's currently being opened will include all the records in your table, because for every record the condition ID = ID will always be true. It's purely coincidence that it's displaying the second record from your table. You didn't specify a sort on the recordset query so it could randomly pick up any record as the first one in the results. What you actually need is
Set rst = CurrentDb.OpenRecordset("SELECT * from tblEmployees WHERE ID = " & frmSearch!Searchbox)
I am having hard time clicking specific row in a Web Table. My code finding proper row, but when I use Child Item method it complains that Object is not found. Here is my code:
Desc = "Record to click"
If Browser("B").Page("P").WebTable("W").exist(10) Then
totalRows = Browser("B").Page("P").WebTable("W").RowCount()
For RowNum = 1 To totalRows
If aDesc = Browser("B").Page("P").WebTable("W").GetCellData(RowNum,2) Then
Browser("B").Page("P").WebTable("W").ChildItem(RowNum,2,"WebElement",0).click
End If
Next
End If
I spied on the value in the row it is Web Element, I tried to use Link- didn't work. Also I tried to Child Item(aDesc,2,"WebElement",0)- didn't work either. I used 0 for the index because there is only one element in the row - simple text. I keep getting this error in many other tests. On rare occasion this approach works in some tests, but most of the time it complains for absence of object.
Thank you very much for your help!
It happened with me as well. When I researched, I found in some of the old HP blogs that ChildItem method does not works correctly with WEBElement, but that was for QTP 9.0, and I was using 12.02.Anyhow, I can't figure out why its happening, and ended up using the following -
Set oExcptnDetail = Description.Create
oExcptnDetail("micclass").value = "WebElement"
oExcptnDetail("html tag").value = "TD"
Set chobj=Browser("").Page("").WebTable("Code").ChildObjects(oExcptnDetail)
chobj(0).Click
On a side note, in order to check a webelement/link exist in a certain row and column, use the following.
Browser("B").Page("P").WebTable("W").ChildItemCount(2,2,"WebElement")
Getcell data will return you anything that is in the desired row and column irrespective of what it is (link,webelement etc) and hence your assumption of if loop will go wrong.
Try this:
Browser("B").Page("P").WebTable("W").object.rows(rownum-1).cells(colnum-1).Click
I was trying to click the first link in my table and this code clicked the item
Set oDesc = Description.Create()
oDesc("html tag").Value = "A"
Set rc = Browser("B").Page("A").WebTable("html id:=gridTable").ChildObjects(oDesc)
rc(0).Click
'num = rc.Count() 'get the number of link in a page
'For i=0 to num-1
'ref = rc(0).GetROProperty("href") 'get the “href”propety of the i th link
'MsgBox ref
'Next
or
Browser("B").Page("A").WebTable("html id:=gridTable").ChildItem(2,8,"Link",0).click
successfully clicks the link I needed
I'm working in a VB6 project and there is an existing menu, created with the menu creator. I am having trouble to insert subMenu programmatically in a MenuItem.
The first menu is File. It contains two menu items : Choice and Exit.
I would like to insert each row of a query (only the first column) at run time in Choice.
My recordset works well, but i need some help in the code below :
Do While rs_choice.EOF = False
'add column1 in Choice
'~Something~ = rs_choice.Fields("column1").Value
rs_choice.MoveNext
Loop
PS : No one MenuItems have defined index.
Can someone help me ?
Using the designer give Choice a single sub-item called mnuDynamic, give it an index of 0.
Loop the recordset loading new items:
Dim i as long
Do While rs_choice.EOF = False
If (i > 0) Then Load mnuDynamic(i)
mnuDynamic(i).Caption = rs_choice.Fields("column1").Value
rs_choice.MoveNext
i = (i + 1)
Loop
Scenario:
I have a spreadsheet with info from a giveaway campaign in which I get paid per new Twitter follow my client receives through my campaign. Unfortunately the application I use does not track new followers vs existing ones because they offer an entry for new and existing followers for the "Follow on Twitter for 1 Entry". Because I also offer other means to gain entries I need to export the data and filter the results to show only those who've gained an entry on the Twitter Follow and then filter out those who are new vs existing by means of a separate application.
Problem:
There should be a separate column for each data type; name,email,action, etc. The action column is where I would expect to find the "Follow On Twitter" but the file is very disorganized and the action can be found in many different columns. Therefore I need a way to show only the rows in which there is a field with "Follow on Twitter". I am at a loss to try and figure out how to do this.
The following macro will search for "Follow On Twitter" in each cell. For each row, if a match is found, the row will be shown, else it will be hidden. You will have to adjust the macro to match your sheet's total number of rows/columns.
Sub Dummy()
GlobalScope.BasicLibraries.LoadLibrary("Tools")
Dim ActiveSheet As Object
ActiveSheet = ThisComponent.CurrentController.ActiveSheet
Dim r,c As Integer
For r = 0 To 25
Dim found As Boolean
found = False
For c = 0 to 10
Dim cell As Object
cell = ActiveSheet.getCellByPosition(c, r)
If cell.String = "Follow On Twitter" Then
found = True
Exit For
End If
Next c
Dim row As Object
row = ActiveSheet.getRows.getByIndex(r)
row.IsVisible = found
Next r
MsgBox "Done"
End Sub