Question

Hi while develeoping bluetooth print inw windows mobile 6 and C# using EPL/ZPL code[ Zebra Printer] Not printing while adding dynamically data to it...

    SerialPort comPort1 = new SerialPort("COM5", 57600, Parity.None, 8, StopBits.One);
    comPort1.Open();
    StringBuilder sb = new StringBuilder();
    sb.Append(@"! 0 200 200 400 1
    LABEL
    CONTRAST 0
    TONE 0
    SPEED 5
    PAGE-WIDTH 600
    BAR-SENSE
    ;// PAGE 0000000006000400
    T 0 0 154 4 Location Transfer
    T 0 0 28 101 PDACode :
    T 0 0 5 77 Trans.Ref No:
    T 0 0 114 105 " + Utility.PdaCode + @"
    T 0 0 80 183 To:
    T 0 0 114 129 " + FromTrnsfr + @" 
    T 0 0 12 126 From.Ref No:
    T 0 0 54 223 Route:
    T 0 0 63 154 From:
    T 0 0 115 183 " + cbToLocation.Text + @"
    T 0 0 390 211 " + vehicleId + @"
    T 0 0 302 208 Vehicle No:
    T 0 0 115 156 " + cbFromLocation.Text.ToString() + @"
    T 0 0 289 184 Travel Mode:
    T 0 0 390 186 " + TraveType + @"
    BOX 100 275 446 299 1
    T 0 0 107 278 SL No
    T 0 0 246 278 MU Code
    T 0 0 115 224 " + RouteCode + @"
    BT 0 0 0
    VB 128 2 0 30 519 348 RefNo
    BT OFF
    LINE 172 298 172 277 2
    LINE 445 299 101 299 2
    T 0 0 114 83 DummyTrnsfrNu
    FORM
    PRINT
    ");
    comPort1.WriteLine(sb.ToString());//"PRINT");
    System.Threading.Thread.Sleep(800);
    comPort1.Close();

---------------> Above Is nothing printed.....

---------------->Below Is printing.......

                sb.Append(@"! 0 200 200 400 1
LABEL
CONTRAST 0
TONE 0
SPEED 5
PAGE-WIDTH 600
BAR-SENSE
;// PAGE 0000000006000400
T 0 0 154 4 Location Transfer
T 0 0 28 101 PDACode :
T 0 0 5 77 Trans.Ref No:
T 0 0 114 105 DummyPDACode
T 0 0 80 183 To:
T 0 0 114 129 Dummyfrom
T 0 0 12 126 From.Ref No:
T 0 0 54 223 Route:
T 0 0 63 154 From:
T 0 0 115 183 ToLocDummy
T 0 0 390 211 DummyVehicle
T 0 0 302 208 Vehicle No:
T 0 0 115 156 FromLoDummy
T 0 0 289 184 Travel Mode:
T 0 0 390 186 DummyMode
BOX 100 275 446 299 1
T 0 0 107 278 SL No
T 0 0 246 278 MU Code
T 0 0 115 224 DummyRoute
BT 0 0 0
VB 128 2 0 30 519 348 RefNo
BT OFF
LINE 172 298 172 277 2
LINE 445 299 101 299 2
T 0 0 114 83 DummyTrnsfrNu
FORM
PRINT");

anyone can help???

Was it helpful?

Solution

Are you sure those variables you are concatting are correct? In some instances you do a ToString() in other instances, you don't do anything. If you capture the string output of both your 'dynamic' and 'test' print, do they match before going to the printer? Also, make sure you have a CRLF after "PRINT" in order to print your label

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top