|
I know that, but I want something that does the following:
- Generate a PDF (or print into a PDF file)
- Print it (for real, to a printer previously designed by the user)
- Merge all the PDFs created (the whole batch that has been sent to the printer) into one file (named by the user)
The client is already using a PDF printer, but he must rename each file and he can't merge them together.
Is it clear enough NOW?
|
|
|
|
|
SentencedToLive wrote: Is it clear enough NOW?
Gee - given the attitude, maybe I shouldn't bother replying.
You have two options, brainiac.
1 - buy a PDF library and write some code to generate PDFs ( which still means writing code to stream all the jobs into one )
2 - write printing code that runs all your reports into one, and run that one print job through the PDF printer you can get for free
Is that clear enough now ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hey, I never meant to be rude...
As I said before, the problem is that this is not my app, but a commercial one. Imagine this is MS Word. The app would need to look like a printer to windows in order to do this, right? Is that possible?
|
|
|
|
|
You want to control printing in a third party app ? You could do it with Word, as it provides a .NET interface to allow you to control it. Were that not the case, I guess you'd have to write your own printer driver that collects documents before being told to finalise into one PDF. Or, you could buy a PDF library that lets you load and merge PDFs.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
You can't write a standard printer driver using .NET (nor VB6) as it has to be an old-style dll.
You can, however, set printers to have teh setting "Keep printed documents after printing" and archive the spool files off each night - this is how many companies do what yours seem to be looking for. There are many apps around that can view spool files should that be required at a later date.
|
|
|
|
|
I want to create cv but i dont know how i can start. I use sql db and vb.net. Cv include person information (personality info, education, different language,etc.)
Thanks
|
|
|
|
|
Is this homework, or a work assignment ? If the former, talk to your teacher. If the latter, talk to your boss.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Dear all
I have got an academic project where, in the part 1 of the project, I need to read an usb device and get its PID, VID and other info. I need to do it in VB.Net.
Is there any procedure while working from Visual studio SDK, after surfing thru net for sometime I have learnt that there is one 'HID Class' which is supported only in Microsoft DDK .
Please help me regarding this matter.
|
|
|
|
|
Ok, I'm sure someone out here has a fix for this....
I have a project at work (in VB 2005) which has a couple mutually exclusive .dll's which are loaded at runtime. Occasionally, especialy when I switch which one gets compiled and included in the Debug, the symbols don't get loaded properly for the .dll, which means I am unable to debug anything inside it. Usually, I'm able to get it working without too much effort (though I'm never entirely sure what actually fixes it), but this time, nothing I do seems to fix it.
I have tried deleting the file from both the folder the .dll compiles in, and the the folder the scripting copies the folder to for runtime. I have tried Cleaniing the Solution. I have tried doing all the above and rebooting. I have checked the Debug settings: Debug is enabled, Optimizations are not. I have tried loading the .pdb manually, but VB says it doesn't match. And I have tried any number of other supposed fixes that haven't worked.
Does anybody else have any ideas on how to get the symbols to load so I can debug? This is getting very irritating, and so far has cost me a day of work for just this one incident.
Please help!
|
|
|
|
|
OK, so after trying pretty much everything under the sun, I gave up and decided to just put in a MsgBox where I wanted it to break. Not as useful as an actual Breakpoint, but at least I could check one of the things I was wanting to check.
So, I compiled and ran.
My MsgBox didn't appear. The application didn't get to the MsgBox line................
....................
....................
....................
...because it stopped at my Breakpoint.
Don't you just love Microsoft?
|
|
|
|
|
I amhaving problems with my db connection. In a form connected to the db through a table adaptor if i restore using CancelEdit, and then add new again the dataset retains the next sequential autonumber. i.e addnew id is 79, restore, addnew id is 80, when no 79 was actually created in the access db. I have tried restore etc to no avail. How can i reset the dataset to match the current autonumbers in the db. Thanks
|
|
|
|
|
First - why do you care what happened to ID 79 as long as the record was not saved.
Second - learn about ID fields, they should not have a use other than identifying the record. If your system is failing because there is no 79 you are using 79 for other than id. STOP.
This is a classic mistake all new programmers encounter.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The reason i care :P is that when you try to delete the newly created record it uses the id as its Id into the back end (Db), there is no match so i get an error every time. so 79 in the dataset is actually say 77 in the Access db (Autonumber). In an ideal world this wouldn't happen however.. BTW yes i am new (trying to self teach) but am aware that an id is just that, a record placer.
|
|
|
|
|
I am trying to set a picturebox's image property to my database. The database column is called "Picture" and it is in binary format.
I am using this code for the textboxes:
textbox1.databindings.add("Text", BindingSource1, "FName")
Now this part works great but when I apply the same theory to the picturebox control, it will not bind.
Here is the picturebox control code for binding the binary data in the MS Access database:
picturebox.databindings.add("Image", BindingSource1, "Picture")
Could someone assist?
thanks,
jason
I'd rather have a bottle in front of me than a frontal lobotomy.
|
|
|
|
|
Hi Jason,
Please know that Images are stored in database as BLOB short for Binary Large OBject, a collection of binary data stored as a single entity in a database management systems (DBMS). BLOBs are used primarily to hold multimedia objects such as images, videos, and sound, though they can also be used to store programs or even fragments of code. Not all DBMSs support BLOBs.
Therefore, to read or write an image we need to use array of Byte. Below is a code snippet to read an image from a database and to show it on a picture box.
----------------------------------------------------------------------------------------------------
BEGIN CODE
' Construct a SQL string and a connection object
Dim sql As String = "SELECT UserPhoto FROM Users"
Dim conn As OleDbConnection = New OleDbConnection
conn.ConnectionString = connectionString
' Open connection
If conn.State <> ConnectionState.Open Then
conn.Open()
End If
Dim cmd As OleDbCommand = New OleDbCommand(sql, conn)
Dim fs As FileStream
Dim bw As BinaryWriter
Dim bufferSize As Integer = 300000
Dim outbyte(300000 - 1) As Byte
Dim retval As Long
Dim startIndex As Long = 0
Dim pub_id As String = ""
Dim reader As OleDbDataReader = cmd.ExecuteReader(CommandBehavior.SequentialAccess)
' Read first record
reader.Read()
fs = New FileStream(savedImageName, FileMode.OpenOrCreate, FileAccess.Write)
bw = New BinaryWriter(fs)
startIndex = 0
retval = reader.GetBytes(0, 0, outbyte, 0, bufferSize)
bw.Write(outbyte)
bw.Flush()
' Close the output file.
bw.Close()
fs.Close()
reader.Close()
' Display image
curImage = Image.FromFile(savedImageName)
PictureBox1.Image = curImage
PictureBox1.Invalidate()
' Clean up connection
If conn.State = ConnectionState.Open Then
conn.Close()
' Dispose connection
conn.Dispose()
End If
End Sub
END CODE
----------------------------------------------------------------------------------------------------
Hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Hi John-
Thanks for replying back. I have some questions about your code.
My connection setup is all done on the GUI side (using Dataset, bindingsource, and bindingnavigator). What I am doing is loading my data on startup of my app...my data loads fine (including the picbox) and the app is working great. What I was trying to do is create a checkbox on the form that, when checked, would parse the data out to display only the information in my new dataset, connectionstring, and query. And when unchecked, it would go back to its original state.
I got all that to work as well except for in the picbox. What I am doing is clearing all the databinding and then manually re-binding the data in the code. Everything updates when I do this except for the picbox.
Now to my question
I am using the code you provided and things needed modified but I am getting an error on "curImage". Can you elaborate on this part? I will provide your code again...you can then see the changes that were necessary to make (but may not be knowing that my connection setup is fine).
'Construct a SQL string and a connection object
Dim sql As String = "SELECT PK, FName, LName, CO, Street, City, State, Zip, Zip2, Email, SentDate, Sent, ReceivedDate, Received, Notes, Location, AddySource, Success, RTS, Fee, Preprint, Profession, TypedLetter, Picture, International, SentEmail FROM(ADDRESSES)WHERE(Success = 'Success')ORDER BY LName"
Dim conn As OleDb.OleDbConnection = New OleDb.OleDbConnection
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\jasons\Desktop\Autographs\bin\Autographs.mdb"
' Open connection
If conn.State <> ConnectionState.Open Then
conn.Open()
End If
Dim cmd As OleDb.OleDbCommand = New OleDb.OleDbCommand(sql, conn)
Dim fs As FileStream
Dim bw As BinaryWriter
Dim bufferSize As Integer = 300000
Dim outbyte(300000 - 1) As Byte
Dim retval As Long
Dim startIndex As Long = 0
Dim pub_id As String = ""
Dim reader As OleDb.OleDbDataReader = cmd.ExecuteReader(CommandBehavior.SequentialAccess)
' Read first record
reader.Read()
fs = New FileStream("Picture", FileMode.OpenOrCreate, FileAccess.Write)
bw = New BinaryWriter(fs)
startIndex = 0
retval = reader.GetBytes(0, 0, outbyte, 0, bufferSize)
bw.Write(outbyte)
bw.Flush()
' Close the output file.
bw.Close()
fs.Close()
reader.Close()
' Display image
curImage = Image.FromFile("Picture")
picImage.Image = curImage
picImage.Invalidate()
Thanks,
jason
I'd rather have a bottle in front of me than a frontal lobotomy.
|
|
|
|
|
Hi All,
i have set date format to dd/MM/yyyy in my application developed in vb.net. i don't know what will the system date format of my client'pc, so i want to set the date format of my client's pc according to my application's settings and restore its original settings when my application closed. all this i want at run time in vb.net.
thanks
|
|
|
|
|
Hi,
I would suggest you to try the following code snippet to change the date format of the system.
-----------------------------------------------------------------------------------------------
BEGIN CODE
Imports Microsoft.Win32
Dim reg As RegistryKey
reg = Registry.Users.OpenSubKey("S-1-5-21-1757981266-861567501-682003330-500\Control Panel\International", True)
If Convert.ToString(reg).Trim = String.Empty Then
MsgBox("Blank")
Else
reg.SetValue("sShortDate", "dd/MM/yyyy")
reg.SetValue("sLongDate", "dd/MM/yyyy")
End If
END CODE
-----------------------------------------------------------------------------------------------
Hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
DON'T.
In your application, display the date in whatever format that you like, using ToString(formatstring), but _don't_ change the machine date time format.
|
|
|
|
|
I agree. Just change the display format, but not how the machine is set. Changing machine settings too much can be dangerous and probably piss off user.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
hi every body
i want to change the start up form name according to the user choice he choose the form name from combo box and then suppose to save his choice in Application.myapp in the main form element , How Can i do that ???
Thanks
Mona
LA ELAH ELA ALLAH MOHAMED RASOL ALLAH
|
|
|
|
|
I have written a macro in XL VBA that at the touch of a button will copy two of the worksheets from a "Master" to a new worksheet, and then will save that worksheet by a unique name made from concatenation of several cells.
(it is a Purchase order, consists of Sitecode, Suppliercode and unique index number, these then form the name of the file, which is the Order Number, ie PUL-CAT01-001)
I know it is possible at this point to save the file to a SPECIFIC LOCATION, ie have the path set up so that it will save to a subdirectory based on the Site.
Damned if I can work out how to do this. I have spent quite some time looking around at various VBA sites, but alas seem incapable of locating anything like what I need.
Does anyone know of a site where I can be helped? or possibly suggest the line of code that needs to replace what is currently just a generic save into the top level directory?
I wouldn't ask, I would normally try to solve this, but time constraints and a certain ennui involved in looking at loads of VBA sites that help everything else but this have eroded my patience.
All and any help gratefully accepted!
------------------------------------
I try to appear cooler,
by calling him Euler.
|
|
|
|
|
AFAIK, the Workbook.SaveAs function takes a fully qualified path name argument.
|
|
|
|
|
hi,
i have search all about tcplistener, but many of the sample is about using console application, i am using windows application for vb.net want to create TCPListener server application, did anyone can tell about any reference of example in using TCPListener windows application.
please..
|
|
|
|
|
if you have vs2003 installed, you will find a sample app in the folder below,
"Program Files\Microsoft Visual Studio .NET 2003\Vb7\VB Samples"
else
send me your mail address and i will send you the app
thanks
Anoop
|
|
|
|
|