Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Power Pack Visual Studio 2008   PrintForm1

Posted on 2013-06-28
2
Medium Priority
?
786 Views
Last Modified: 2013-07-03
Windows forms  visual studio 2008  I  am using the following code to print a form  
this is working fine but I have to issues

1-I need to insert the Date  on the file name, with this code it does but it only puts the year
example  "2013 Enh A Shift"   I need to be the   Month/Date/Year + File name

2-  I need to hardcode the path to the file to be save right now by default comes on the document folders. I want a Network Share path

 Dim a As Date
        a = Format(Today, "short date")
        Dim pf As New PrintForm
        pf.Form = Me
        pf.Form.BackColor = Color.White
        pf.Form.Controls.Remove(bntprint)
        pf.Form.Controls.Remove(bntcryovac)
        pf.PrinterSettings.DefaultPageSettings.Landscape = True
        pf.PrintAction = Printing.PrintAction.PrintToPrinter
        pf.PrinterSettings.PrinterName = "Adobe PDF"
        pf.DocumentName = a & " " & "ENH A SHIFT"
        pf.Print()
        pf.Form.Controls.Add(bntprint)
        pf.Form.Controls.Add(bntcryovac)




Can you provide me with some samples. thanks
0
Comment
Question by:teogos
2 Comments
 
LVL 15

Accepted Solution

by:
angus_young_acdc earned 1400 total points
ID: 39284660
Your date won't be in the correct format, the slash '/' will be taken as a breakdown of folders.

Instead you could use this:
a = Today.ToString("MM-dd-yyy")

That will give you the month, day and year.   The rest of the code would remain as it is.

I don't use the PowerPacks so can't help with setting the default path for PrintForm.
0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 600 total points
ID: 39287206
You are printing to a printer so why is file path involved? Are you printing to PDF? If yes then the save as dialog as shown by pdf print driver so you may not be able to  control that.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question