I am having issues with Viewing report that I added to my project and I need your help please.
I am using Access DB, VB 2010, .NET4.5 and As you can tell I am in learning process, so I am new to VB. Any help given is highly appreciated.
HERE are the Two error I am getting: 1 st one. I want to view Total Profits for all times. Error "A data source instance has not been supplied for the date source 'AllTimeReportDataset'
I named this on the wizard when I was creating the report wizard but how do I add the data source.
2nd Error: Happens when I want to view Total profits between two Date: HERE is the Error: The Report definition for the report 'TBS.TotalProfitsBetweenTwoDates.rdlc' has not been specified.
Here is my code:
Private Sub ShowReportBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShowReportBtn.Click If ReportComboBox.Text = "Total Profits for all Times" Then
'Fill the information for the report Selected.
Dim TA As New TBSDSTableAdapters.TotalProfitForALLTimeTableAdapter Dim SelectedDS As New TBSDS TA.Fill(SelectedDS.TotalProfitForALLTime)
'Clear previous report run (Data Source) and Display the new report selected
'Create a new Data Source now ---selected report from Combo box ---In this case Total report for all time 'Dim RDS As New Microsoft.Reporting.WinForms.ReportDataSource("TBS_TotalProfitForAllTime", SelectedDS.TotalProfitForALLTime)
Dim rds As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource
ElseIf ReportComboBox.Text = "Total Profits between two Date" Then
Dim TA As New TBS_RestDSTableAdapters.TotalProfitForALLTimeTableAdapter Dim SelectedDS As New TBSDS TA.FillByFilteringBetweenTwoDates(SelectedDS.TotalProfitForALLTime, DateTimePicker1.Value, DateTimePicker2.Value)
'Clear previous report run (Data Source) and Display the new report selected
'Create a new Data Source now ---selected report from Combo box ---In this case Total report for all time ''''Dim RDS As New Microsoft.Reporting.WinForms.ReportDataSource("TBS_TotalProfitForAllTime", SelectedDS.TotalProfitForALLTime)
Dim rds As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource rds.Name = "TBS_TotalProfitForAllTime" rds.Value = SelectedDS.TotalProfitForALLTime
'tell the report control to use the data source 'also use the report template created (rds)
sir actually my main aim is to call the notepad .exe in the system using parallel port. for that i thought i will arrange an ir interrupt to the parallel port and the parallel port which is connected to the system. In the system using the vb script and interfacing the parallel port with it can help me in calling the notepad.exe file Now i am not knowing how to write the program in the vb script...plz plz plz help me..
You can concatenate all the values in the textboxes and insert them into a column. Or delimit them with a character and insert them. Either way you can only have one piece of information inside a column.
Calls the method "IsMatch" on the Regex class (from the "System.Text.RegularExpressions" namespace), with the arguments of the current keycharacter (provided by an event you did not copy/paste) and a RegEx. Then it inverses the outcome.
Not very helpful, is it? It compares a key with a RegEx and reports whether they match. You'd have to look up the "\\d+" part on this page[^] from MSDN, I don't know the regex-code from my head.
my youtube video downloader app was working but it stopped working due to Dec-2012 YouTube changes. my code is unable to load the download format. Currently, the video info loads but the application is unable to load the available download formats and download the video.
Download the VB6 Source here http://www.abhisoft.com/misc/UTubeVB6.zip
I hope anyone is able to take a look at the code and see what's wrong? I think the error is in here:
It's my first question in this forum...just read a response to another guy that helped me a lot.
I am working for some project in my university and they asked me to make an application in vb.net. Then I had to save different data for every user in order to check his own work, so I used SQL management studio to import some information to arrays there.
The big problem that I face now, it that they would like to work this project online, so as users can open it through their website. I have no idea if all the code I wrote in vb.net and connections between VISUAL studio and SQL studio could be transfered online ! Maybe I could convert most of them so as to run the project online.
Can anyone help me ???? I would really appreciate every advice or help !!! I am searching for a solution so as not to lose my project( that I almost finshed ).
Aw, sorry for using C#-terminology; it's called "Overridable" in VB.NET.
We have several programs with multiple forms that we need to do this on.
Can you please give concrete examples?
Take an empty form, and modify it like below;
' This call is required by the designer.
' Add any initialization after the InitializeComponent() call.
Next, change your existing form to Inherit from the BaseForm like below;
PublicClass Form1 : Inherits BaseForm
This would give you a method that's called when the form is constructed (just like InitializeComponents), and give you the option to override it's implementation for a specific form;
I wonder why you wouldn't just call your customized initialization from within the Load event in your source code for each Windows Form. Doing so, you don't have to touch the Windows Form Designer generated code file (*.Designer.vb).
Your code is essentially correct but what you haven't done is to read the type of data stored in each name-value pair so that the correct cast can be applied.
The raw data obtained from GetValue(valueName) is typed as Object and the ToString() conversion gives a correct representation in most cases, the exceptions being when the actual type is an array (REG_BINARY, REG_MULTI_SZ)
The technique is read the type via GetValueKind(valueName) and then apply a cast to the Object returned from GetValue(valueName). The incomplete method below shows the basics and in your case formatting the values ready for display should be done in the gaps left as "do something appropriate".
PrivateSub InterpretValue(rawValue asObject, interpretAsType as RegistryValueKind)
' REG_BINARYDim byteArray AsByte() = DirectCast(rawValue, Byte())
' Do something appropriateExitSelectCase RegistryValueKind.DWord
' REG_DWORDDim signedValue32 AsInteger = DirectCast(rawValue, Integer)
' Do something appropriateExitSelectCase RegistryValueKind.QWord
' REG_QWORDDim signedValue64 AsLong = DirectCast(rawValue, Long)
' Do something appropriateExitSelectCase RegistryValueKind.Unknown, RegistryValueKind.String, RegistryValueKind.ExpandString
Dim stringValue asString = rawValue.ToString()
' Do something appropriateExitSelectCase RegistryValueKind.MultiString
' REG_MULTI_SZDim stringArray AsString() = TryCast(rawValue, String())
' Do something appropriateExitSelectEndSelectEndSub
Thanks for the explanations. I understand that I should be considering the data type. I can change my code accordingly. But what about the "Last Write Time" information that is displayed in the exported text data for these keys? How can I access that? My goal is to capture the History of each USB device that was used in the system, with dates and times. I'm assuming that the Last Write Time on the exported text will give me this information, but I don't see how my code, even with the data type considerations, will access that.
The .NET RegistryKey exposes a small subset of the full Windows Registry API and to get the LastWriteTime requires the Windows RegQueryInfoKey function. Microsoft made this really difficult prior to .NET 4, as the RegistryKey class did not expose the operating system registry key handle.
With the restriction of .NET 4 it should be a simple matter of using P/Invoke to call RegQueryInfoKey with the twelve parameters set correctly! I haven't done this but most of them are optional, so can probably be set to null or IntPtr.Zero.
If you have to work on a lower (lesser?) version of .NET then I don't think this will be an easy task as there is no facility to exchange handles between the .NET RegistryKey class and the native Windows functions. I think the only option would be using RegOpenKeyEx to get the handle and then call RegQueryInfoKey.
I designed my report using the Report Viewer control. The data on my report is not tabular. It is a fixed-field form that spans several pages. I set the data source to a collection of an object that I developed and all the data for the report comes from my collection (which will always only have one item in it).
The report seems to be working fine, I setup a header and footer. When my code refreshes the report, my data is displayed nicely on the report as i designed it. However, when I convert to Print view, the report seems to be inserting page breaks while rendering. my nice little 4-page form becomes a 10 page report with page breaks occurring on every other page and some extra at the end.
What can I look at to determine why these extra page breaks occur in the rendering process? I thought it may be page layout related, so I changed the margins to all zeros and still see the additional page breaks.
Also, another thing I noticed is that when I added the footer, the footer height is about 2.5 inches and the designer will not allow me to change it.
Thanks for your quick reply. My page size is 8.5x11. Page Units = Inches. Orientation in Portrait. I originally had the margins set at .5 for all, but I also tried changing them all to 0 with no change in the resulting number of pages.
In designing my report I used the Report Ruler to ensure that my data is only setup between 1 inch on the left and 7inch on the right. I used a Rectangle control to contain the different sections of my form so I can insure that each rectangle is only 6 inches long, starting at 1 inch on the right and all my field data is contained within a rectangle control. I am currently not specifying page breaks in the properties of any of my rectangle controls, although I did try to add a page break property on some rectangles which did not affect the additional page breaks when printing.
So my issue now is how can I determine what is specifically causing a page break.
my pc's operating system windows 7 ultimate 32 bit -------------------------
i am working on a project that will control 5 devices through pc parallel port/printer port. when i run the program it will first appear a loginform then when i enter. it always returns that the port doesnt exist. even though i have the port it cant detect it.. i dont know what is wrong with my code.
-------------------------------------------------------- Dim FILE_NAME As String = "LPT1"
If System.IO.File.Exists(FILE_NAME) Then Dim objWriter As New System.IO.StreamWriter(FILE_NAME) objWriter.Write("hi") objWriter.Close() MsgBox("ok") Else MsgBox("port does not exist") End If ------------------------------------------------------ then after the login the next form is homepage. there you'll see the switch buttons that will turn on and off a device. when i clicked any of this buttons an error will prompt. its say that object reference not set to an instance of an object
NullReferenceException was unhandled.
Private Sub btn_app1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_app1.Click If btn_app1.Text = "ON" Then btn_app1.Text = "OFF" btn_app1.BackColor = Color.Red io(0) Else btn_app1.Text = "ON" btn_app1.BackColor = Color.Green io(1) End If End Sub
Private Sub btn_app2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_app2.Click If btn_app2.Text = "ON" Then btn_app2.Text = "OFF" btn_app2.BackColor = Color.Red io(0) Else btn_app2.Text = "ON" btn_app2.BackColor = Color.Green io(2) End If End Sub
Private Sub btn_app3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_app3.Click If btn_app3.Text = "ON" Then btn_app3.Text = "OFF" btn_app3.BackColor = Color.Red io(0) Else btn_app3.Text = "ON" btn_app3.BackColor = Color.Green io(4) End If End Sub
Private Sub btn_app4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_app4.Click If btn_app4.Text = "ON" Then btn_app4.Text = "OFF" btn_app4.BackColor = Color.Red io(0) Else btn_app4.Text = "ON" btn_app4.BackColor = Color.Green io(8) End If End Sub
Private Sub btn_app5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_app5.Click If btn_app5.Text = "ON" Then btn_app5.Text = "OFF" btn_app5.BackColor = Color.Red io(0) Else btn_app5.Text = "ON" btn_app5.BackColor = Color.Green io(16) End If End Sub
Private Sub io(ByVal bit As Integer) val = axHwinterface1.InPort(888) axHwinterface1.OutPort(888, CShort(val Or bit)) End Sub
-------------------------------------------------------- please help me im new in this.. i need your help guys.. thank you in advance.. every response is very much appreciated
if you want to see my whole project you can Download it here
There is an important and great technology: it's called debugging. Set a break point somewhere in your code, e.g at Private Sub btn_app1_Click(...) and then run the code step by step. Thus you will detect the line of code where the exception is thrown. I guess it happens at Private Sub io(...). Either axHwinterface1 is Nothing, or InPort(888) returns Nothing, then the next line fails. Debugging will tell you the exact reason.
Last Visit: 31-Dec-99 19:00 Last Update: 28-Mar-17 6:50