|
thanks Mycroft Holmes for the reply.
i think you are right, but i actually am not being able to figure this one out.
here is the code i have used in form load
Imports Microsoft.Reporting.WinForms.ReportDataSource
Public Class DailySalesReport
Private Sub Daily_Sales_Report_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim dt As New DataTable
'TODO: This line of code loads data into the 'innoerpDataSet.salesmen' table. You can move, or remove it, as needed.
Me.SalesmenTableAdapter.Fill(Me.innoerpDataSet.salesmen)
Me.ReportViewer1.LocalReport.DataSources.Clear()
Me.StoredProcedure2TableAdapter1.Fill(InnoerpDataSet1.StoredProcedure2, ComboBox1.Text)
Me.ReportViewer1.LocalReport.DataSources.Add(New Microsoft.Reporting.WinForms.ReportDataSource("dt", dt))
Me.ReportViewer1.RefreshReport()
End Sub
End Class
this is giving the error i have earlier mentioned.
|
|
|
|
|
Going to be difficult, I never work with the tableadapters, horrible things they are. What type does Me.StoredProcedure2TableAdapter1.Fill expect as it's forst parameter. Presumably salesman fills Ok so what are the differences between the 2 methods!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
fill wants data table of as the first parameter
|
|
|
|
|
thank you every one the problem has been resolved .
i just created another dataset specially to keep the data table values and then filled the table adapter and then refreshed the report viewer this solved the problem.
|
|
|
|
|
hello every one
i want to add columns in checklisbiox like listview so that i can make the width of column to zero which will be not visible to end user is there any code in .net which is helpful to me. in vb i had used checklistbox for the same and it worked but in .net the same is not working.
please suggest what to do..
thank u in advance..
|
|
|
|
|
I'm using instructions from Bob Powell's website [^] to save an edited image back to its original file name. Here's my problem:
This is a batch operation with multiple images receiving the same changes. Often, I'll get the GDI+ generic error caused when the original image in memory has not been disposed. The new image to be written back to the original is created one line before disposing of the original (locked) bitmap:
newImg = CreateNewImage(tmpBMP, newW, newH) 'created in function elsewhere in app
tmpBMP.Dispose()
'Following the above code is the code that sets the format and saves the image
The error does not occur if I do the following instead:
newImg = CreateNewImage(tmpBMP, newW, newH)
tmpBMP.Dispose()
If tmpBMP.Equals(Nothing) Then
MsgBox("NOTHING")
End If
'Following the above code is the code that sets the format and saves the image
The graphics object used to draw the new image in memory is disposed in the called function.
Am I correct in assuming that my app isn't getting enough time to dispose of the original before trying to write back to it? The msgbox NEVER actually opens either way, which also confuses me (I'm a newbie to GDI+).
If I do need to be sure the app has enough time to dispose of the original, what is a good way to create the necessary delay? Any suggestions appreciated.
AB
|
|
|
|
|
Dispose() does not set the object to Nothing, you need to do that yourself. I am guessing the extra code creates time for something to happen in the framework. Ultimately, you're struggling against a bug in .NET, I believe if you change the way you load your image, you can get around this.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Christian Graus wrote: I am guessing the extra code creates time for something to happen in the framework
Thanks Christian.
I moved the dispose() statement to the function that creates the new image. That seems to have solved the problem. If worse come to worse, I can probably drop a timer into the code somewhere.
|
|
|
|
|
Hey,
I am trying to print an overview with a For Each loop. Now, in this loop I check whether the current Y position exceeds the pages maximum Y, and if so, I set e.HasMorePages to True . However, this isn't working. It keeps printing and printing while it shouldn't. Here is an example of my code. (In the PrintDocument.PrintPage Event)
For Each Uitgave As Xml.XmlNode In UitgavenNode.ChildNodes(MonthToPrint).ChildNodes
...
StartY+=PrintFont.GetHeight
If StartY >= e.MarginBounds.Height Then
StartY = e.MarginBounds.Y
e.HasMorePages = True
Else
e.HasMorePages = False
End If
Next
So the bottom line is: When StartY >= e.MarginBounds.Height then it must jump to a blank page and continue printing. Please note that this all happens within a loop and printing must continue at the same position within the loop.
Please tell me what's wrong with this code, so I can fix it
Thanks in advance,
Zaegra
Motivation is the key to software development.
|
|
|
|
|
The PrintPage event is fired for each and every page that gets printed. Your code sample is a bit incomplete, but it looks like you're printing the same thing on every page. Are you printing only what fits on a page, saying the point in the loop that you're at and restarting the loop at the point you saved in the previous handling of the PrintPage event.
|
|
|
|
|
Hi there, I'm trying to migrate an existing vb6 mail application to vb 2008 but it fails conversion. Anyway I'm looking for a module to send email with attachments using outlook 2003. Code must be written in vb 2008. What I can't get is attaching a document to the email! What I have so far is:
Module Module1
Dim app As Object
Dim itm As Object
Dim myItem As Object
Dim myAttachments As Object
Sub sendmail()
app = CreateObject("Outlook.Application")
itm = app.CreateItem(0)
With itm
.To = "someone@yahoo.com"
.CC = "someone@hotmail.com"
.Subject = "test"
'.importance = "high"
'.BodyFormat = Microsoft.Office.Interop.OutlookolFormatHTML
.Body = "Test message"
.send()
End With
MsgBox("message sent", vbOKOnly, "sent....")
End Sub
End Module
All I do is call the sendmail() function from a cmd button! There are other example send mail applications out there but they are written in vb.net and uses smtp(which I don't need)
|
|
|
|
|
I'm pretty sure that itm should have an attachment property.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I hope it did, but vb2008 is different from vb6 (which had the attachment property).
|
|
|
|
|
It doesn't matter. The object you're using are not exposed by VB6 or VB.NET. They are exposed by the COM-based classes you are creating instances of. The properties would be identical.
|
|
|
|
|
I use this
Dim oMail As System.Net.Mail.MailMessage
Dim oFrom As System.Net.Mail.MailAddress
Dim oSmtp As System.Net.Mail.SmtpClient
oMail = New System.Net.Mail.MailMessage
oFrom = New System.Net.Mail.MailAddress("me@here.com")
oSmtp = New System.Net.Mail.SmtpClient("mail.here.com")
oMail.From = oFrom
oMail.To.Add("him@here.com, him@there.com, another@there.com)
oMail.Subject = "My Subject"
oMail.Priority = Net.Mail.MailPriority.Normal
oMail.IsBodyHtml = True
oMail.Body = "Body of rmail here"
oSmtp.Send(oMail)
|
|
|
|
|
Does this piece of code require you to setup an smtp server in IIS? If it does, then this piece of code will not work in my case. All I want to do is send an email with an attachment via outlook 2003 (connects to microsoft exchange) and the code needs to be compatible with vb2008.
My first post has working code (in vb2008) that can send email with outlook 2003, BUT without attachments!
|
|
|
|
|
I guess all you need to add is this line
<br />
.Attachments.Add("c:\myfolder\myfile.txt")
But this gives me security warning.
I will try to find how to avoid it.
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
I have now switch to office 2007 and adding these lines worked perfectly:
' Add an attachment
Dim sSource As String = "C:\somefile.extension"
Dim sBodyLen As String = oMsg.Body.Length
Dim sDisplayName As String = ""
Dim oAttachs As Outlook.Attachments = oMsg.Attachments
Dim oAttach As Outlook.Attachment
oAttach = oAttachs.Add(sSource, , , sDisplayName)
oMsg.Send()
|
|
|
|
|
how to create round shapes??
could this work-
in a label(backcolor set equal to form's) set a round image.
won't this increase the cpu time??
i am looking for an efficient way to create a round shape
like in vb6 we'd just chose the shape control.
but in vb2008 all controls that don't have handles are dropped
is there a way to do so??
eh?
TheMrProgrammer
|
|
|
|
|
System.Drawing.Graphics provides the facility to create diffrent types of shape as you want.
Set your Backcolor as forms color or set it to transparent.
If you can think then I Can.
|
|
|
|
|
Or you can Google for the "VB.NET Power Packs". The 3.0 version has shape controls in it like those that used to be in VB6.
|
|
|
|
|
hi
modified 28-Nov-12 8:23am.
|
|
|
|
|
|
Using cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\DB\E_Ensemb.mdb")
check this
remove only the ; from the end
|
|
|
|
|
I need to directly connect to the .dbf files and not with the .mdb files...
|
|
|
|