|
Hello,
I'm trying to set up a report so that it will have several different columns for the same set of fields (like creating columns in word) that my data will be displayed in. For example... I have about 100 records to display on each page of the data report... The way it is right now, if I want to print out a report of those records it prints off several pages with just one column of the set of fields. I want to set up multiple columns for the same fields so that they will all fit on one page.
Instead of having
Field1 Field2 Field3 on a page, I will have
Field1 Field2 Field3 : Field1 Field2 Field3 : Field1 Field2 Field3 on a page
I hope that made sense. Thanks so much for your anticipated help.
TimDasa
|
|
|
|
|
How are you generating the report? Using Crystal Reports? Or are you using code you wrote to send data to the printer?
How are you tracking your data? Using a RecordSet object? Or using an Array?
Need just couple more details here!
RageInTheMachine9532
|
|
|
|
|
Thanx for your response.
I have the data in a microsoft access database. I designed the report using vb 6 data report which gets it data from a data environment. I then used an SQL statement to filter the records.
If you have a better way of extracting the data from the tables pls let me have it.
Thanx.
|
|
|
|
|
OK. In that case, you should be using a RecordSet object to track the data in your app.
Next, you didn't mention how you were generating your report, so I'll assume your writing the code for it yourself.
Now, you'd have to print the data out, something like this (assuming 50 rows per column):
Rec(0).Field1 Rec(0).Field2 Rec(0).Field3 : Rec(50).Field1 Rec(50).Field2 Rec(50).Field3
Rec(1).Field1 Rec(1).Field2 Rec(1).Field3 : Rec(51).Field1 Rec(51).Field2 Rec(51).Field3
A simplified view of the code might look something like this (not actual code):
Dim Index as Integer
Dim rsData as RecordSet (Your data is in here)
Dim strOutput as String
'Output your headers here
'
For Index = 0 to rsData.Count - 1
strOutput = rsData(Index).Fields(1).ToString & " " & _
rsData(Index).Fields(2).ToString & " " & _
rsData(Index).Fields(3).ToString
Try
strOutput = strOutput & " : " & _
rsData(Index + 50).Fields(1).ToString & " " & _
rsData(Index + 50).Fields(2).ToString & " " & _
rsData(Index + 50).Fields(3).ToString
Catch
End Try
Print strOuput
Next
Again, this is a greatly simplified example and will NOT compile! But it should be enough to give you an idea of what is going on.
RageInTheMachine9532
|
|
|
|
|
please tell me difference in detail between com component and .net component
tbhattacharjee
|
|
|
|
|
say suppose there is lots of parent and child nodes in treeview and checkbox is attached with all the nodes and i want to show the name of node which checked.please help me with sample code.
tbhattacharjee
|
|
|
|
|
please tell me how can i insert picture in the cell of the datagrid and provide small sample code.
tbhattacharjee
|
|
|
|
|
http://aspalliance.com/articleViewer.aspx?aId=141&pId=
http://www.dotnetbips.com/displayarticle.aspx?id=101
try to visit the site and you see the sample codes.
Dabuskol![Blush | :O](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_redface.gif)
|
|
|
|
|
Hello, I am tring to create a program to help my work schedual Pull Stock. I have a problem getting the value of the variables into a spreadsheet. This is some test code I am trying to get to work:
Public Sub Insertdata()
'Insert data typed in txt boxes into ExcelData1.xls
Dim conn1 As New System.Data.OleDb.OleDbConnection(m_sConn1)
conn1.Open()
Dim cmd As New System.Data.OleDb.OleDbCommand()
Dim strID As String
Dim strName As String
Dim Birthdate As Date
strID = txtID.Text
strName = txtName.Text
Birthdate = txtBirthdate.Text
cmd.Connection = conn1
'******Here is where the trouble is***********************
cmd.CommandText = "INSERT INTO [EmployeeData$] (ID, Name, BirthDate) values (strID, strName, Birthdate)"
'****** the values of:(strID, strName, Birthdate)will not pass**********
cmd.ExecuteNonQuery()
conn1.Close()
End Sub
Any advice would be greatly appreciated
Thanks!
|
|
|
|
|
DawgTagz wrote:
'******Here is where the trouble is***********************
cmd.CommandText = "INSERT INTO [EmployeeData$] (ID, Name, BirthDate) values (strID, strName, Birthdate)"
You might want to try this instead:
cmd.CommandText = "INSERT INTO [EmployeeData$] (ID, Name, BirthDate) values (" & strID & "," & strName & "," & Birthdate & ")"
That way, you're passing the actual values of strID, strName, and Birthdate instead of the text string "strID, strName, Birthdate".
RageInTheMachine9532
|
|
|
|
|
Thanks! I will try that tonight.
|
|
|
|
|
Nope, That didn't work. I keep getting:
"No value given for one or more parameters."
|
|
|
|
|
Even when I try passing the actual value of the textBox instead of the variables.
|
|
|
|
|
In that case, it's the SQL INSERT statement that is bad or not formated correctly.
After looking up the INSERT statement on MSDN, I've found that it should look something like this:
cmd.CommandText = "INSERT INTO [EmployeeData$] (ID, Name, BirthDate) values ('" & strID & "', '" & strName & "', #" & Birthdate & "#)"
Where string values must be enclosed in single quotes. Date values must be passed something like #1/1/1999# (enclosed in pound signs).
I haven't tested this, but it should work according to the docs. You might have to make sure that the Birthdate gets passed in the correct format.
RageInTheMachine9532
|
|
|
|
|
Looking for a little help in getting started with what is required to do telephony with VB.Net. Really any information would help. Have used VB for several years, but never in this manner.![Confused | :confused:](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_confused.gif)
|
|
|
|
|
A lot depends on your defintion of telephony.
Currently the only way to do Telephony via TAPI is using TAPI 3 via COM interop. (Unless you have access to a third party telephony component that comes with your telephony hardware)
There may be third party libraries which can help, try doing a google for VB.NET and TAPI.
If you can give more details about your hardware/software set-up, I might be able to offer further advice. (Most of my work is done with PABX's, using COM interop in C# and my own COM objects)
Michael
Blue canary in the outlet by the light switch
Who watches over you
Make a little birdhouse in your soul - They Might Be Giants
|
|
|
|
|
We have a lot of nurses that work out of the office. What we want is for them to call in from the patients home and our system to be able to determine the patient from the phone number the call is placed from and then our system ask a couple of questions that the nurse answers via selecting from options and entering that correct response and the information (phone number, time and her responses) being stored in a SQL server database. This is as far as we have gotten with this. And as we have never worked with TAPI. Also we were told that MCI or another company has a patent and that any telephony development must pay them a fee. Do you have any info on this??
Any guidance to get us started will be appreciated.
![Big Grin | :-D](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_biggrin.gif)
|
|
|
|
|
You don't have to pay MCI or any other company a fee if your not selling or distributing this thing. You'll have to talk to a patent lawyer if you suspect the someone has a patent on what your doing and you want to sell it.
RageInTheMachine9532
|
|
|
|
|
Brooksy wrote:
Any guidance to get us started will be appreciated.
First, I've never heard of the MCI patent and I've been working with Telephony for the last 4 years developing similiar systems, but then I'm a developer now a lawyer.
What you describe is basically an IVR system (Interactive Voice Response). A lot depends on what you have answering the call. I assume it is a proper phone PABX rather than a modem?
Knowing the hardware will allow you to define your software requirements. Most decent phone systems will already have an IVR that you can purchase which will do what you require.
Some phone systems support TAPI, others have their own API's. So the first step is to identify the hardware that is answering the calls.
Michael
Blue canary in the outlet by the light switch
Who watches over you
Make a little birdhouse in your soul - They Might Be Giants
|
|
|
|
|
We have a ERP system that lets me write macros in Vb script and I use them to pass data to an access application. below is a sample:
Dim objShell
dim strLaunch
Set objShell = CreateObject("WScript.Shell")
If [ORDER_ID] <> "" Then
strLaunch = """C:\Program Files\Microsoft Office\Office\Msaccess.exe"" ""C:\Allocation.mdb"" /cmd """ & [ORDER_ID] & """"
objShell.Run strLaunch
Else
msgbox "Please enter a Customer Order ID"
End if
is it possible to pass data to a vb.net application instead of using access?
Chris
|
|
|
|
|
Sure. It all depends on how the VB.NET app is written. Is this an app that you wrote or something you don't have the source code for? Is it an idea for a future app?
We'll need a few more details about exactly what your doing, the details about the application, and the type of data you want to pass in.
RageInTheMachine9532
|
|
|
|
|
hmm yes that would help wouldn't it. Its a "in the idea stage app" but I am thinking something like this - We have a customer order in our erp system that uses a vb script macro that will pass the customer order id number to my future vb.net application. What I would like to happen is the data gets passed to the application and on the form load event it uses the passed data as a parameter in a sql query that will populate other data on the vb.net form. Hope this helps
|
|
|
|
|
OK. In that case, your best bet is to have your app check the command line parameters, probably in the form load event. That way, you can have the greatest flexibility as far as interface with various scripting languages or other applications you may write for the front end of the project.
Now, you might also want to consider writing your app as a component (aka control). That way, you still have the flexibility of using your component in other scripting and app projects and you also get the added bonus of return values and greater flexibility of error traping and control in your front end app/script.
RageInTheMachine9532
|
|
|
|
|
can someone help please
i have a button used for adding numbers from a textbox to a listbox, at the bottom of my form i have a label that shows the total(sum) of the numbers entered in the listbox for example if 3 and 8 were in the listbox i would want the label at the botton to show 11, and if another number was entered in the listbox i would want the label to update
i know it may be easy but i am new to VB, please could someone help
many thanks
![OMG | :OMG:](https://www.codeproject.com/script/Forums/Images/smiley_OMG.gif)
|
|
|
|
|
OK. You and the other guy keep saying 'listbox'. Is it a listbox or a TextBox?
The thing to do would be to add code to the Changed event of the textboxes. This sample uses one function to handle the Changed events of TWO Textboxes. IF YOU USE THIS CODE EXACTLY, YOUR INSTRUCTOR WILL MORE THAN LIKELY KNOW YOU DIDN'T WRITE IT!
Private Sub tbChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbNumber1.TextChanged, tbNumber2.TextChanged
Dim Result As Single
Dim Operand1, Operand2 As Single
' Try and convert the text in the first textbox to a Single.
Try
Operand1 = CSng(tbNumber1.Text)
Catch ex As Exception
Operand1 = 0.0
End Try
' Try and convert the text in the second textbox to a Single.
Try
Operand2 = CSng(tbNumber2.Text)
Catch ex As Exception
Operand2 = 0.0
End Try
Result = Operand1 + Operand2
lblResult.Text = Result.ToString
End Sub
The form contains two textboxes, tbNumber1 and tbNumber2, and a label control called lblResult. If you type in either textbox, this function will convert both textboxes to Single precision numbers, if possible, add them, then show the result in the label control.
Now, you could easily change this so the code only runs when you click on a button instead of relying on the Change event of a TextBox. But that, I'll leave up to you.
RageInTheMachine9532
|
|
|
|