Hi there
I'm attempting to put together a string that will line up in columns and then insert this into a pdf form! I've managed this before, but for some reason the columns do not line up this time - been over every inch of the code and cannot fnd a reason - if anyone can spot the obvious I'd really appreciate it! -
Dim vInfo As New System.Text.StringBuilder()
-
-
vInfo.AppendFormat("{0, -14} {1, 30} {2, 30}", "Earnings", "This Period", "Year to Date")
-
vInfo.Append(vbCr)
-
vInfo.Append(vbCr)
-
vInfo.AppendFormat("{0, -14} {1, 30} {2, 30}", "Basic Pay", Format(vBasic, "###,##0.00"), Format(vYTDBasic, "###,##0.00"))
-
vInfo.Append(vbCr)
-
vInfo.AppendFormat("{0, -14} {1, 30} {2, 30} ", "IEC Pay", Format(vIEC, "###,##0.00"), Format(vYTDIEC, "###,##0.00"))
-
vInfo.Append(vbCr)
-
vInfo.AppendFormat("{0, -14} {1, 30} {2, 30}", "Sick Pay", Format(vSickPay, "###,##0.00"), Format(vYTDSickPay, "###,##0.00"))
-
vInfo.Append(vbCr)
-
vInfo.AppendFormat("{0, -14} {1, 30} {2, 30}", "Vacation Pay", Format(vVacationPay, "###,##0.00"), Format(vYTDVacationPay, "###,##0.00"))
-
vInfo.Append(vbCr)
-
vInfo.AppendFormat("{0, -14} {1, 30} {2, 30}", "Bonus", Format(vBonusPay, "###,##0.00"), Format(vYTDBonus, "###,##0.00"))
-
-
-
-
-
-
-
-
Dim TK As APToolkitNET.Toolkit
-
Dim vOutput As String
-
Dim sString As String = Request.ServerVariables("APPL_PHYSICAL_PATH")
-
Dim rtnOutput As Object
-
Dim rtnInput As Object
-
-
TK = New APToolkitNET.Toolkit
-
vOutput = sString & "Secure\Admin\Management\Accounting\pdf\PayCheck.pdf"
-
rtnOutput = TK.OpenOutputFile(vOutput)
-
If rtnOutput <> 0 Then
-
MsgBox1.alert("PDF output file error " & rtnOutput)
-
Exit Sub
-
End If
-
-
rtnInput = TK.OpenInputFile(Server.MapPath("Chq.pdf"))
-
If rtnInput <> 0 Then
-
MsgBox1.alert("PDF input file error " & rtnInput)
-
Exit Sub
-
End If
-
-
'Get all the information together to add to the advice
-
Dim vInsert As String = vInfo.ToString
-
-
TK.FormNumbering = True
-
-
'Get the info for the pdf form
-
TK.SetFormFieldData("Text1", vtToday, -998)
-
TK.SetFormFieldData("Text2", vPayee, -998)
-
TK.SetFormFieldData("Text3", vNet, -998)
-
TK.SetFormFieldData("Text4", vNetWords, -998)
-
TK.SetFormFieldData("Text5", "Payroll Check", -998)
-
TK.SetFormFieldData("Text7", vInsert, -998)
-
-
-
-
-
-
-
TK.FlattenRemainingFormFields = True
-
Dim vCopyForm = TK.CopyForm(0, 0)
-
If vCopyForm <> 1 Then
-
MsgBox1.alert("PDF copyform failed, " & vCopyForm)
-
End If
-
TK.CloseOutputFile()
-
TK.CloseInputFile()
-
TK = Nothing
-
-
0 1770 Sign in to post your reply or Sign up for a free account.
Similar topics
by: hplloyd |
last post by:
I am using some code off the web that requires a string builder in a script
within a web page.
In order to get the script to work I need to include the relevant library in
the references section...
|
by: Bob |
last post by:
I am using an API that needs a function pointer with the following
prototype:
void CALLBACK DXLExportStreamFunc ( const BYTE *bytes, DWORD length,
void far *Context )
I get to pass it the...
|
by: Arne Adams |
last post by:
Hi
changing a StringBuilder through a deduced type throws an exception - Sample Code
void editBuilder(System::Text::StringBuilder* t
System::String* insertThis = S"inserted"...
|
by: Ben |
last post by:
I have several pages written in aspx, but sometime the aspx page return the
following error. And it hapeen, the whole web application gives this error,
that means all the aspx files get affected....
|
by: John A Grandy |
last post by:
when using StringBuilder to build-up a block of text (which is then assigned
to a Label control) is it possible to underline a portion of the text ?
it would seem that...
|
by: Mark Rae |
last post by:
Hi,
Has anyone successfully used the FTP stuff in the System.Net namespace
against a VMS FTP server?
I'm trying to do this at the moment and can't even get a directory listing,
although there...
|
by: ramhog |
last post by:
Hello all,
I would like to use AppendFormat to replace tokens in a string with
actual string values. The problem I am running into however is that my
string uses {} around a string that I do not...
|
by: Peter Larsen [] |
last post by:
Hi,
I have two questions related to the Label control.
How do i prevent the label from expand the canvas into 2 lines (word wrap)
??
At the moment i set AutoSize to false (to prevent the word...
|
by: SSekar |
last post by:
Hi,
I am getting this exceptions when I am trying to access the Frotran dll. Here
is sample code for that.
using System;
using System.Collections.Generic;
using System.Text;
using...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |