aspose file tools*
The moose likes C / C++ and the fly likes printing using fiscal printer  in c# com component bringing exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Languages » C / C++
Bookmark "printing using fiscal printer  in c# com component bringing exception" Watch "printing using fiscal printer  in c# com component bringing exception" New topic
Author

printing using fiscal printer in c# com component bringing exception

daniel ndonga
Greenhorn

Joined: May 07, 2012
Posts: 1
//class the calls the the second class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IncortexLibrary;

namespace ConsoleApp

{

class Program
{

static void Main(string[] args)
{
Class1 FiscPrinter = new Class1();
FiscPrinter.PrintBon();


}
}
}

//the second class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FiscPrinter = FiscPrnSys.FiscPrnIface;
using System.Runtime.InteropServices;




namespace IncortexLibrary
{
public class Class1
{
public List<String> salesITems = new List<String>();
public String user;
public String shop;
public double total;
public double subtotal;
public String tax;
public short data = (short) 8;
public short parity = (short)0;
public short stopbit = (short)1;
[STAThread]






public void PrintBon()
{


FiscPrnSys.FiscPrnIface FiscPrinter = new FiscPrnSys.FiscPrnIface(); //this is i get the com compont class not registered
// exception.
FiscPrinter.Connect("COM1", 96600, data, parity, stopbit);
FiscPrinter.TestPrinter((short)48, "1,0,1", "HELLO");
FiscPrinter.Sale("TEST ITEM 1", "A", 2, 2, 0);
FiscPrinter.Sale("TEST ITEM 1", "A", 2, 2, 0);
FiscPrinter.Sale("TEST STOCK ITEMS ZERO VAT", "B", 2, 2, 0);
FiscPrinter.Sale("Cooking Fat Always Ultra", "B", 2, 2, 0);
FiscPrinter.PrintFiscalText("TEST STOCK ITEMS VATABLE");
FiscPrinter.Sale("001000124", "A", 2, 2, 0);
FiscPrinter.PrintFiscalText("Kimbo 1 Kg");
FiscPrinter.Sale("598699484", "A", 5, 5, 0);
FiscPrinter.PrintFiscalText("Tily Cooking Fat");
FiscPrinter.Sale("484949404", "A", 2, 2, 0);
FiscPrinter.Sale("Always ULtra", "A", 10, 2, 0);
FiscPrinter.Disconnect();

}

public void setUser(String user)
{
this.user = user;
}

public void setShop(String shop)
{
this.shop = shop;
}

public void addSaleItem(String item)
{
salesITems.Add(item);

}

public void setDouble(double pTotal)
{
this.total = pTotal;
}

public void setSubTotal(double sTotal)
{
this.subtotal = sTotal;
}

public void setTax(String pTax)
{
this.tax = pTax;
}



}
}

//the reference to the .dll lbyaries are (incortexlibrary.dll,interop.fiscprinsys.dll,interop.vba.dll,interop.vbrun.dll,fiscprnsysdll.dll)
printer connected is connected and system is windows xp 32bit.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: printing using fiscal printer in c# com component bringing exception