Click here to Skip to main content
14,605,052 members
   

C#

 
GeneralRe: Mutlithreading application threading and semaphores? Pin
auting8223-Mar-20 4:14
Memberauting8223-Mar-20 4:14 
GeneralRe: Mutlithreading application threading and semaphores? Pin
Dave Kreskowiak23-Mar-20 4:36
mveDave Kreskowiak23-Mar-20 4:36 
GeneralRe: Mutlithreading application threading and semaphores? Pin
Richard MacCutchan23-Mar-20 4:41
mveRichard MacCutchan23-Mar-20 4:41 
AnswerRe: Mutlithreading application threading and semaphores? Pin
Gerry Schmitz23-Mar-20 8:05
mveGerry Schmitz23-Mar-20 8:05 
AnswerRe: Mutlithreading application threading and semaphores? Pin
Bohdan Stupak24-Mar-20 1:14
professionalBohdan Stupak24-Mar-20 1:14 
QuestionRDLC printing without print preview Pin
Member 1419221622-Mar-20 21:20
MemberMember 1419221622-Mar-20 21:20 
AnswerRe: RDLC printing without print preview Pin
OriginalGriff22-Mar-20 21:34
mveOriginalGriff22-Mar-20 21:34 
GeneralRe: RDLC printing without print preview Pin
Member 1419221622-Mar-20 21:49
MemberMember 1419221622-Mar-20 21:49 
do I have to post my code that I used?
here is the code

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using Microsoft.Reporting.WinForms;

namespace POS_System_Inventory
{
public partial class frmReceipt : Form
{
String store = "LISINGI PC SOFTWARE Pvt Ltd";
String address = "13ième AV N°46 C/TSHOPO-KIS";
SqlConnection con = new SqlConnection();
SqlCommand cmd = new SqlCommand();
DBConnection dbcon = new DBConnection();
frmCashier f;
public frmReceipt(frmCashier frm)
{
InitializeComponent();
con = new SqlConnection(dbcon.MyConnection());
f = frm;
}

private void frmReceipt_Load(object sender, EventArgs e)
{

this.reportViewer1.RefreshReport();
}

public void LoadReport(string paracash, string parachange)
{
try
{
ReportDataSource rptDataSource;
this.reportViewer1.LocalReport.ReportPath = Application.StartupPath + @"\Reports\Report1.rdlc";
this.reportViewer1.LocalReport.DataSources.Clear();
DataSet1 ds = new DataSet1();
SqlDataAdapter da = new SqlDataAdapter();
con.Open();
da.SelectCommand = new SqlCommand("select c.id,c.transno,c.pcode,c.price,c.qty,c.disc,c.total,c.sdate,c.status,p.pdesc from tblCart as c inner join tblProduct as p on p.pcode=c.pcode where transno like '" + f.lblTrans.Text + "' ", con);
da.Fill(ds.Tables["dtSold"]);
con.Close();

ReportParameter pVatable = new ReportParameter("pVatable", f.lblVatable.Text);
ReportParameter pVat = new ReportParameter("pVat", f.lblVat.Text);
ReportParameter pDiscount = new ReportParameter("pDiscount", f.lblDiscount.Text);
ReportParameter pTotal = new ReportParameter("pTotal", f.lblTotal.Text);
ReportParameter pCash = new ReportParameter("pCash", paracash);
ReportParameter pChange = new ReportParameter("pChange", parachange);
ReportParameter pStore = new ReportParameter("pStore", store);
ReportParameter pAddress = new ReportParameter("pAddress", address);
ReportParameter pTransaction = new ReportParameter("pTransaction", "Facture N°: " + f.lblTrans.Text);
ReportParameter pCashier = new ReportParameter("pCashier", frmLogin2.UserDisplayName2.name2);

reportViewer1.LocalReport.SetParameters(pVatable);
reportViewer1.LocalReport.SetParameters(pVat);
reportViewer1.LocalReport.SetParameters(pDiscount);
reportViewer1.LocalReport.SetParameters(pTotal);
reportViewer1.LocalReport.SetParameters(pCash);
reportViewer1.LocalReport.SetParameters(pChange);
reportViewer1.LocalReport.SetParameters(pStore);
reportViewer1.LocalReport.SetParameters(pAddress);
reportViewer1.LocalReport.SetParameters(pTransaction);
reportViewer1.LocalReport.SetParameters(pCashier);

rptDataSource = new ReportDataSource("DataSet1", ds.Tables["dtSold"]);
reportViewer1.LocalReport.DataSources.Add(rptDataSource);
reportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);
reportViewer1.ZoomMode = ZoomMode.Percent;
reportViewer1.ZoomPercent = 50;


}
catch (Exception ex)
{
MessageBox.Show(ex.Message);

}
}
}
}

modified 23-Mar-20 4:14am.

GeneralRe: RDLC printing without print preview Pin
OriginalGriff22-Mar-20 21:51
mveOriginalGriff22-Mar-20 21:51 
GeneralRe: RDLC printing without print preview Pin
Member 1419221622-Mar-20 22:08
MemberMember 1419221622-Mar-20 22:08 
SuggestionRe: RDLC printing without print preview Pin
Richard Deeming23-Mar-20 0:22
mveRichard Deeming23-Mar-20 0:22 
AnswerRe: RDLC printing without print preview Pin
Gerry Schmitz23-Mar-20 7:49
mveGerry Schmitz23-Mar-20 7:49 
QuestionNotify User From Server Pin
Kevin Marois22-Mar-20 16:11
professionalKevin Marois22-Mar-20 16:11 
AnswerRe: Notify User From Server Pin
Dave Kreskowiak22-Mar-20 18:41
mveDave Kreskowiak22-Mar-20 18:41 
GeneralRe: Notify User From Server Pin
Kevin Marois22-Mar-20 18:50
professionalKevin Marois22-Mar-20 18:50 
GeneralRe: Notify User From Server Pin
Dave Kreskowiak23-Mar-20 4:18
mveDave Kreskowiak23-Mar-20 4:18 
GeneralRe: Notify User From Server Pin
Gerry Schmitz23-Mar-20 6:24
mveGerry Schmitz23-Mar-20 6:24 
QuestionCreate Custom File Property/Attribute Pin
Kevin Marois22-Mar-20 9:30
professionalKevin Marois22-Mar-20 9:30 
AnswerRe: Create Custom File Property/Attribute Pin
Tony Hill22-Mar-20 10:02
MemberTony Hill22-Mar-20 10:02 
AnswerRe: Create Custom File Property/Attribute Pin
OriginalGriff22-Mar-20 10:14
mveOriginalGriff22-Mar-20 10:14 
GeneralRe: Create Custom File Property/Attribute Pin
Kevin Marois22-Mar-20 13:02
professionalKevin Marois22-Mar-20 13:02 
AnswerRe: Abuse Standard File Property/Attribute Pin
Luc Pattyn22-Mar-20 10:36
sitebuilderLuc Pattyn22-Mar-20 10:36 
GeneralRe: Abuse Standard File Property/Attribute Pin
Kevin Marois22-Mar-20 13:04
professionalKevin Marois22-Mar-20 13:04 
Questionupdate problem Pin
ago248619-Mar-20 23:31
Memberago248619-Mar-20 23:31 
AnswerRe: update problem Pin
OriginalGriff20-Mar-20 0:03
mveOriginalGriff20-Mar-20 0:03 

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.