hi,
i have my print design in following way in asp
| Excise Regn. No : AAACY2820KXM001 Range : Kancheepuram Division : Tambaram, Chennai. | Commissionerate : Tambaram Service Tax Regn.No. : AAACY2820KST001 PAN : AAACY2820K | TIN : 33090762171 CST No : 877145/21.05.2007 Area Code : 0 3 9 |
Purchase Order
| PO NO | PO Date | |
| Address | Vendor Code: ECC No : Range No: Division : CST NO : TIN NO: Sales Tax: |
We are pleased to place the Order for the following on you, Subject to our Terms and Conditions printed Overleaf.
this is my print function which will call below function :
function PurchaseDetails()
{
// alert('hi');
var myGrid = $('#jqGrid'),
selRowId = myGrid.jqGrid('getGridParam', 'selrow'),
_id = myGrid.jqGrid('getCell', selRowId, 'POID');
$.ajax({
url: "../api/InventoryApi/PurchaseOrderPrintData",
type: "Post",
data: JSON.stringify([_id]), //{ Name: name, Address: address, DOB: dob },
contentType: 'application/json; charset=utf-8',
success: function (data) {
// var details = data.split('+');
document.getElementById("PurchaseOrder_Slip").innerHTML = data;
setTimeout("Terms_Table("+_id+")", 500)
//PrintSlip()
},
error: function () { }
});
}
this is my print function in controller:
public string PurchaseOrderPrintData(List _data)
{
string _pofId = _data[0];
string var_data = "";
string _sTotWords = "";
int var_Row_Count; decimal _Pomaintotal = 0; string ret_data = ""; string var_d = "";
int Count = 1;
try
{
using (SqlConnection obj_Connn = new SqlConnection(var_Con_Str))
{
if (obj_Connn.State == System.Data.ConnectionState.Closed)
obj_Connn.Open();
SqlCommand obj_Com = new SqlCommand();
SqlDataReader obj_Reader;
obj_Com.Connection = obj_Connn;
obj_Com.CommandText = "SELECT TBL_PURCHASE_ORDER_DETAIL.*, TBL_ITEM_MASTER.F_ITEM_NO, TBL_ITEM_MASTER.F_ITEM_NAME,TBL_ITEM_MASTER.F_DESCRIPTION_1,TBL_ITEM_MASTER.F_DESCRIPTION_2, TBL_ITEM_MASTER.F_UOM, TBL_PURCHASE_ORDER_DETAIL.F_BASIC AS BASIC FROM TBL_PURCHASE_ORDER INNER JOIN TBL_PURCHASE_ORDER_DETAIL ON TBL_PURCHASE_ORDER.F_ID = TBL_PURCHASE_ORDER_DETAIL.F_ID_PO INNER JOIN TBL_ITEM_MASTER ON TBL_PURCHASE_ORDER_DETAIL.F_ID_ITEM = TBL_ITEM_MASTER.F_ID WHERE TBL_PURCHASE_ORDER.F_ID=" + _pofId + "";
obj_Reader = obj_Com.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
DataTable obj_Data_tbl = new DataTable();
obj_Data_tbl.Load(obj_Reader);
var_Row_Count = obj_Data_tbl.Rows.Count;
foreach (DataRow obj_Data_Row in obj_Data_tbl.Rows)
{
decimal _poqty = Convert.ToDecimal(obj_Data_Row["F_QTY"].ToString());
decimal _pobasic = Convert.ToDecimal(obj_Data_Row["F_BASIC"].ToString());
decimal _poTotal = _poqty * _pobasic;
string _formtotal = String.Format("{0:#,###,###.##}", _poTotal);// String.Format("{0:n}", _poTotal);
_Pomaintotal = _Pomaintotal + _poTotal;
var_data += "" + Count + " " + obj_Data_Row["F_DESCRIPTION_1"] + "," + obj_Data_Row["F_DESCRIPTION_2"] + " " + obj_Data_Row["F_UOM"] + " " + Convert.ToDecimal(obj_Data_Row["F_QTY"]).ToString("0,0.00") + " " + Convert.ToDecimal(obj_Data_Row["F_BASIC"]).ToString("0,0.00") + " " + _formtotal + " ";
Count++;
}
// _Pomaintotal = 1000000000;
if (_Pomaintotal > 1000000000)
{
string _formmaintotal = String.Format("{0:#,###,###.##}", _Pomaintotal);
var_d += " " + _formmaintotal + " ";
}
else
{
_sTotWords = NumbersToWords(_Pomaintotal); string _formmaintotal = String.Format("{0:#,###,###.##}", _Pomaintotal);
var_d += "" + _sTotWords + " Only " + _formmaintotal + " ";
}
ret_data = var_data + var_d;
}
}
catch (Exception)
{ }
return ret_data;
}
my problem is i want to print in 1 page only 8 columns and repeat the header in each page how can i do that... can anyone help me out...
2 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Monica BundelPosted Feb 18, 2016, 12:53 AM
Shubham KumarPosted Feb 18, 2016, 12:49 AM