473,748 Members | 2,887 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamic PDF in ASP.NET

1 New Member
Hello.



I am working on a project where users can automatically create personnel advices on the mainframe through a .NET Web Service.



My current problem is that I am trying to call a function multiple times to write out the advices to different folder, based on the color sent to the function. However, the program only writes the advices out to one folder. Can you help based on the code that I am attaching to the email?



_

Public Function DoAciFunction(B yVal Key As String, ByVal Flag As String, ByVal UserID As String, ByVal ChgType As String, ByVal OrgPH As String, ByVal DocType As String) As String

Dim SendKey As String = " " & Key

Dim Color As String = "Blank"

Dim ColorFile As String = "Goldenrod"

Dim ColorPayroll As String = "Yellow"

Dim ColorBenefits As String = "Green"

Dim z As Integer

Dim PDFColor()

PDFColor(0) = Color

PDFColor(1) = ColorFile

PDFColor(2) = ColorPayroll

Try

For z = 0 To 2

If PDFColor(z).Get Value = 0 Then

Exit For

End If

CreateP17PDF(Fl ag, UserID, SendKey, PDFColor(z)) ‘This is supposed to happen 3 times!!!!!!

Next z

Dim TestKey As String = Flag & SendKey & OrgPH

Return "0000" & TestKey 'Run without errors.

Catch ex As Exception

DoAciFunction = ex.ToString

Dim TestKey As String = Flag & SendKey & OrgPH

Return "999X" & ex.Message & TestKey 'Run with errors.

End Try



Public Function CreateP17PDF(By Val FlagCode As String, ByVal User As String, ByVal Key As String, ByVal Color As String) As String

Try

imp = ImpersonationHe lper.Impersonat e("SCDOT", Me.GetType(), "SCDOT")



For i = 0 To P17.EMP.Length - 1

If Trim(P17.EMP(i) ) = "" Then

i = P17.EMP.Length

Else

DocName = "P17" & Mid(Key, 4, 4) & Mid(Key, 2, 2) & Trim(P17.ORG(i) ) & Mid(P17.PH(i), 2, 2) & Trim(P17.EMP(i) ) & "A" & Trim(P17.LCX(i) ) & ".pdf"



Select Case Color

Case "Blank"

FolderPathColor = "Original\"

Case "Goldenrod"

FolderPathColor = "File\"

Case "Yellow"

FolderPathColor = "Payroll\"

Case Else

FolderPathColor = "Original\"

End Select



FolderPath = P17Doc() & "\" & Mid(Key, 4, 4) & Mid(Key, 2, 2) & FolderPathColor ‘This is supposed to print out to three different folders.

If Not System.IO.Direc tory.Exists(Fol derPath) Then

System.IO.Direc tory.CreateDire ctory(FolderPat h)

End If



If User = "" Then

DocEmpName = P17.EMP(i) & "ET.pdf"

Else

DocEmpName = P17.EMP(i) & "U" & User & ".pdf"

End If



'DocEmpName = P17.EMP(i) & ".pdf"

EmpFolderPath = P17Doc() & "\" & Mid(Key, 4, 4) & Mid(Key, 2, 2) & FolderPathColor & "\EmployeeI Ds\"



If Not System.IO.Direc tory.Exists(Emp FolderPath) Then

System.IO.Direc tory.CreateDire ctory(EmpFolder Path)

End If



OutputFile = FolderPath & DocName

OutputEmpFile = EmpFolderPath & DocEmpName



Dim x As Integer = 0

Dim P17Page As ceTe.DynamicPDF .Page

Dim P17Document As New MergeDocument

Dim Path As String



P17PageDims = New PageDimensions( PageSize, PageOrientation )

P17PageDims.Lef tMargin = LeftMargin

P17PageDims.Rig htMargin = RightMargin

P17PageDims.Top Margin = TopMargin

P17PageDims.Bot tomMargin = BottomMargin





Select Case Color ‘These are the different forms that the web service is pulling, based on the color sent.



Case "Blank"

Path = "BlankForms \P-17Blank.pdf"

Case "Goldenrod"

Path = "BlankForms \P-17File.pdf"

Case "Yellow"

Path = "BlankForms \P-17Payroll.pdf"

Case Else

Path = "BlankForms \P-17Blank.pdf"

End Select



P17Page = New Page(P17PageDim s)

P17Document.App end(Server.MapP ath(Path))

P17Page = P17Document.Pag es(x)



'Print P17 details

P17Name = New Label(P17.NAME( i), colName, Row1, Width(cwName), LineSize, Font, FontSize, Left)



P17Page.Element s.Add(P17.Name)



P17Document.Dra w(OutputFile)

P17Document.Dra w(OutputEmpFile )

End If

Next i



Thanks.


[/u]
Sep 10 '07 #1
1 1816
jhardman
3,406 Recognized Expert Specialist
Hi, Murdla, and Welcome to the Scripts Developer Network.

We have several technical forums here (this isn't one of them), and it looks like your question belongs in the .NET forum. I'll see if I can move it along for you.

Jared
Sep 10 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1891
by: Roel Wuyts | last post by:
CALL FOR CONTRIBUTIONS International Workshop on Revival of Dynamic Languages http://pico.vub.ac.be/~wdmeuter/RDL04/index.html (at OOPSLA2004, Vancouver, British Columbia, Canada, October 24-28, 200) Organization committee: Roel Wuyts (primary contact - roel.wuyts@ulb.ac.be), Gilad Bracha, Wolfgang De Meuter, Stéphane Ducasse and Oscar Nierstrasz.
0
2073
by: Pascal Costanza | last post by:
Dynamic Languages Day @ Vrije Universiteit Brussel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Monday, February 13, 2006, VUB Campus Etterbeek The VUB (Programming Technology Lab, System and Software Engineering Lab), ULB (deComp) and the Belgian Association for Dynamic Languages (BADL) are very pleased to invite you to a whole day of presentations about the programming languages Self, Smalltalk and Common Lisp by experts in...
5
2585
by: bearophileHUGS | last post by:
I often use Python to write small programs, in the range of 50-500 lines of code. For example to process some bioinformatics data, perform some data munging, to apply a randomized optimization algorithm to solve a certain messy problem, and many different things. For that I often use several general modules that I have written, like implementation of certain data structures, and small general "utility" functions/classes, plus of course...
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8830
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8243
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4606
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2783
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.