Solved

Power Pack Visual Studio 2008   PrintForm1

Posted on 2013-06-28
2
766 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
angus_young_acdc earned 350 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 150 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

615 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