Click here to Skip to main content
16,011,374 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How to access "my" toolbarbuttons from outside the main form Pin
Mycroft Holmes27-Jan-08 21:45
professionalMycroft Holmes27-Jan-08 21:45 
QuestionScroll data grid to the row where edit was clicked Pin
Sakshi Smriti26-Jan-08 1:44
Sakshi Smriti26-Jan-08 1:44 
GeneralRe: Scroll data grid to the row where edit was clicked Pin
Paul Conrad26-Jan-08 8:39
professionalPaul Conrad26-Jan-08 8:39 
QuestionOrganizational Chart Print ! Crystal or ? Pin
NasirLCCI200726-Jan-08 0:43
NasirLCCI200726-Jan-08 0:43 
AnswerRe: Organizational Chart Print ! Crystal or ? Pin
Paul Conrad26-Jan-08 8:40
professionalPaul Conrad26-Jan-08 8:40 
GeneralCall windows dialer with parameter Pin
Rupesh Kumar Swami26-Jan-08 0:32
Rupesh Kumar Swami26-Jan-08 0:32 
GeneralRe: Call windows dialer with parameter Pin
Paul Conrad26-Jan-08 8:40
professionalPaul Conrad26-Jan-08 8:40 
GeneralPrinting problem in Custom paper in Visual Basic 6 help needed Pin
imagetvr25-Jan-08 18:24
imagetvr25-Jan-08 18:24 
I am using

OS = Windows XP
Visual Basic Enterprise Edition 6


I have a problem in Printing in pre printed bill .

Bill Size

Height : 6 inches Width of paper : 9.1 inches

I wish to print bill by bill, Pre printed stationery is continious paper, I wish to print in one bill after one bill the paper automatically skip to other bill.
the problem is : while printing the paper moves for A4/Letter and i cann't able to enable the Tear off Mode.


Please go through the below three codes and help me fix paper size

==================================================================================

I used three codes to print . But problem contious. There is no paper size in VB for my paper setting ( height 6 inches , width 9.1 inches)



I used three methods to print one is
--------------------------------------------------------

Printer.ScaleMode = ScaleModeConstants.vbTwips

Printer.Width = 13104
Printer.Height = 8640
.............................
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



Printer.EndDoc
Printer.NewPage
End Function

the above method while printing the paper moves for A4/Letter and i cann't able to enable the Tear off Mode.

How can i set paper size of Height : 6 inches Width of paper : 9.1 inches
====================================================
2. Second code creating Text file and printing by creating text files one of my friend suggestes
=======================================================


Call modBillPrinter.OpenPrintFile
Call modBillPrinter.PrintPLine(Chr(12))


Call modBillPrinter.PrintPLine(Space(10) + MakeString(Trim(cname), 15, ALIGN_LEFT) + Space(5) + MakeString(Trim(bno), 10, ALIGN_LEFT))
Call modBillPrinter.PrintPLine(Space(10) + MakeString(Trim(place), 15, ALIGN_LEFT) + Space(5) + MakeString(bdate, 10, ALIGN_RIGHT))
Call modBillPrinter.PrintPLine(Chr(12))
Call modBillPrinter.PrintPLine(Space(5) + MakeString(" S.NO", 5, ALIGN_LEFT) + Space(3) + MakeString("Particulars", 20, ALIGN_LEFT) + Space(3) + MakeString("Grms", 6, ALIGN_RIGHT) + Space(3) + MakeString("Wastage", 7, ALIGN_RIGHT) + Space(3) + MakeString("Rate", 4, ALIGN_RIGHT) + Space(3) + MakeString("MC", 5, ALIGN_RIGHT) + Space(3) + MakeString("SC", 5, ALIGN_RIGHT) + Space(3) + MakeString("Amount", 10, ALIGN_RIGHT))
Call modBillPrinter.PrintPLine(Chr(12))


Print #1, Spc(8 - Len(CStr(psno))); psno; Spc(3); '8
Print #1, particulars; Spc(20 - Len(CStr(particulars))); '17
Print #1, Spc(9 - Len(CStr(grams))); grams; '7
Print #1, Spc(8 - Len(CStr(wastage))); wastage;
Print #1, Spc(11 - Len(CStr(trate))); trate; '7
Print #1, Spc(9 - Len(CStr(mc))); mc; '7
Print #1, Spc(8 - Len(CStr(sc))); sc; '7
Print #1, Spc(12 - Len(CStr(amount))); amount '11


Print #1, vbCr
Print #1, Spc(76 - Len(CStr(Netamttxt.Text))); Netamttxt.Text
Print #1, Chr(12)


modBillPrinter.ClosePrintReport
Shell App.Path & "\PRINT.BAT", vbHide
End Function

Here the problem is i cannot change font size ,
And i wish the usage of follwing for what following command used

1. Print #1, vbCr ?
2. Print #1, Chr(12)
3. Print #1, Spc(12
4. Print #1, vbCrLf


====================================================================
3 Third method - ( In this method no printing no out put in printer totally no print out
=====================================================================



Open "E:\jewelproject\DSREPO.TXT" For Output As #1
Call Header
psno = 1

While psno <= sno

If tcount > 5 Then
Print #1, Chr(12)
Call Header
tcount = 1
End If

mg1.Row = psno
mg1.Col = 2: particulars = mg1.Text
mg1.Col = 3: grams = mg1.Text
mg1.Col = 5: wastage = mg1.Text
mg1.Col = 6: trate = mg1.Text
mg1.Col = 7: mc = mg1.Text
mg1.Col = 8: sc = mg1.Text
mg1.Col = 9: amount = mg1.Text

Print #1, Spc(8 - Len(CStr(psno))); psno; Spc(3);
Print #1, particulars; Spc(17 - Len(CStr(particulars)));
Print #1, Spc(6 - Len(CStr(grams))); grams;
Print #1, Spc(8 - Len(CStr(wastage))); wastage;
Print #1, Spc(7 - Len(CStr(trate))); trate;
Print #1, Spc(7 - Len(CStr(mc))); mc;
Print #1, Spc(7 - Len(CStr(sc))); sc;
Print #1, Spc(11 - Len(CStr(amount))); amount

tcount = tcount + 1
psno = psno + 1

Wend

For i = 1 To 9 - tcount
Print #1, vbCr
Next i

Print #1, Spc(5); "Discount : "; disctxt.Text; Spc(5); "VAT : "; vattxt.Text
Print #1, vbCr
Print #1, Spc(76 - Len(CStr(Netamttxt.Text))); Netamttxt.Text
Print #1, Chr(12)

Close #1
'Shell App.Path & "\PRINT.BAT", vbHide
Shell "E:\jewelproject\PRINT.BAT", vbHide
'Shell "c:\1.txt", vbHide
End Function


Public Function Header()

cname = cnametxt.Text
bdate = datetxt.Text
place = cptxt.Text
bno = Bnotxt.Text

For i = 1 To 6: Print #1,: Next

Print #1, Spc(18); cname; Spc(42 - Len(Name)); bdate
Print #1, Spc(18); place; Spc(42 - Len(bno)); bno
Print #1, vbCrLf

Print #1, Spc(5); "Sl.No"; Spc(3); "Particulars"; Spc(6); " Grams";
Print #1, " Wastage"; Spc(3); "Rate"; Spc(3); "MC"; Spc(5); "SC"; Spc(6); "Amount"
Print #1, vbCrLf

My Problem : while printing the paper moves for A4/Letter and i cann't able to enable the Tear off Mode.

1. How can i modify above code to fix paper size Height : 6 inches Width of paper : 9.1 inches
QuestionHow to display current date Pin
zaimah25-Jan-08 17:05
zaimah25-Jan-08 17:05 
AnswerRe: How to display current date Pin
Luc Pattyn25-Jan-08 17:07
sitebuilderLuc Pattyn25-Jan-08 17:07 
GeneralRe: How to display current date Pin
Sipder26-Jan-08 18:46
Sipder26-Jan-08 18:46 
GeneralPutting a dataabase table column value into a variable Pin
AAGTHosting25-Jan-08 16:37
AAGTHosting25-Jan-08 16:37 
GeneralRe: Putting a dataabase table column value into a variable Pin
Andy_L_J26-Jan-08 12:30
Andy_L_J26-Jan-08 12:30 
Generalusing tcpclint Pin
Agbaria Ahmad25-Jan-08 12:15
Agbaria Ahmad25-Jan-08 12:15 
Questioneffective designing Pin
Agbaria Ahmad25-Jan-08 11:54
Agbaria Ahmad25-Jan-08 11:54 
GeneralRe: effective designing Pin
Christian Graus25-Jan-08 12:41
protectorChristian Graus25-Jan-08 12:41 
GeneralRe: effective designing Pin
darkelv26-Jan-08 2:55
darkelv26-Jan-08 2:55 
QuestionWindows Installer CustomActionData parameters Pin
mrgubbels25-Jan-08 11:43
mrgubbels25-Jan-08 11:43 
GeneralDisplaying Rows from a DataTable in a DataGrid Pin
AAGTHosting25-Jan-08 7:35
AAGTHosting25-Jan-08 7:35 
GeneralRe: Displaying Rows from a DataTable in a DataGrid Pin
Kschuler25-Jan-08 8:11
Kschuler25-Jan-08 8:11 
GeneralRe: Displaying Rows from a DataTable in a DataGrid Pin
AAGTHosting25-Jan-08 10:05
AAGTHosting25-Jan-08 10:05 
GeneralRe: Displaying Rows from a DataTable in a DataGrid Pin
Kschuler25-Jan-08 11:07
Kschuler25-Jan-08 11:07 
GeneralRe: Displaying Rows from a DataTable in a DataGrid Pin
AAGTHosting25-Jan-08 14:08
AAGTHosting25-Jan-08 14:08 
GeneralRe: Displaying Rows from a DataTable in a DataGrid Pin
Kschuler28-Jan-08 3:25
Kschuler28-Jan-08 3:25 
GeneralDoes any one know what i have done wrong Pin
solarthur0125-Jan-08 6:04
solarthur0125-Jan-08 6:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.