private void frmpaymentreport_Load(object sender, EventArgs e) { try { // RefreshCustomer(); PaymentReport rpt = new PaymentReport(); dsCommon ds = new dsCommon(); SQLiteConnection con = new SQLiteConnection("Data Source=" + System.IO.Path.Combine(AIO.path, AIO.file) + ";foreign keys=true;");//Password=5gs6hf7tjg86sjhfr6hkdg87grfj6ehgfr78lcmksd8; AIO.command = CID; SQLiteDataAdapter da = new SQLiteDataAdapter(AIO.command, con); da.Fill(ds, "Payment1"); AIO.command = "select abtComName as [Name],abtComAdd as [Add],abtComMob as [Mob],abtComEmail as [Email],abtVatTIN as [TIN],abtCstNo as [CST],abtPAN as [PAN],abtCIN as [CIN],abtEsta as [Esta] from AboutMe as [AM]"; da = new SQLiteDataAdapter(AIO.command, con); da.Fill(ds, "AM"); rpt.SetDataSource(ds); crvPyamentReport.ReportSource = rpt; crvPyamentReport.RefreshReport(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void frmTransactionReport_Load(object sender, EventArgs e) { TransactionReport rpt = new TransactionReport(); dsCommon ds = new dsCommon(); SQLiteConnection con = new SQLiteConnection("Data Source=" + System.IO.Path.Combine(AIO.path, AIO.file) + ";foreign keys=true;");//Password=5gs6hf7tjg86sjhfr6hkdg87grfj6ehgfr78lcmksd8; AIO.command = query; SQLiteDataAdapter da = new SQLiteDataAdapter(AIO.command, con); da.Fill(ds, "TR"); AIO.command = "select abtComName as [Name],abtComAdd as [Add],abtComMob as [Mob],abtComEmail as [Email],abtVatTIN as [TIN],abtCstNo as [CST],abtPAN as [PAN],abtCIN as [CIN],abtEsta as [Esta] from AboutMe as [AM]"; da = new SQLiteDataAdapter(AIO.command, con); da.Fill(ds, "AM"); rpt.SetDataSource(ds); crystalReportViewer1.ReportSource = rpt; crystalReportViewer1.RefreshReport(); }
private void frmExpenseReport_Load(object sender, EventArgs e) { try { ExpenseReport rpt = new ExpenseReport(); dsCommon ds = new dsCommon(); SQLiteConnection con = new SQLiteConnection("Data Source=" + System.IO.Path.Combine(AIO.path, AIO.file) + ";foreign keys=true;");//;foreign keys=true;Password=5gs6hf7tjg86sjhfr6hkdg87grfj6ehgfr78lcmksd8; AIO.command = EID; SQLiteDataAdapter da = new SQLiteDataAdapter(AIO.command, con); da.Fill(ds, "Expense1"); rpt.SetDataSource(ds); crystalReportViewer1.ReportSource = rpt; crystalReportViewer1.RefreshReport(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void frmMainBillView_Load(object sender, EventArgs e) { try { rptMainBill rpt = new rptMainBill(); dsCommon ds = new dsCommon(); SQLiteConnection con = new SQLiteConnection("Data Source=" + System.IO.Path.Combine(AIO.path, AIO.file) + ";foreign keys=true;");//Password=5gs6hf7tjg86sjhfr6hkdg87grfj6ehgfr78lcmksd8; AIO.command = "select abtComName as [Name],abtComAdd as [Add],abtComMob as [Mob],abtComEmail as [Email],abtVatTIN as [TIN],abtCstNo as [CST],abtPAN as [PAN],abtCIN as [CIN],abtEsta as [Esta] from AboutMe as [AM]"; SQLiteDataAdapter da = new SQLiteDataAdapter(AIO.command, con); da.Fill(ds, "AM"); AIO.command = "select tranNo as[No],tranDate as [Date],tranTotal as [Price],tranTax1 as [Tax1],tranTax2 as [Tax2],tranDiscPerc as [DiscPerc],tranDiscRs as [DiscRs],tranFinalTotal as [Total],tranInvoice as [Invoice],tranTax1Name as [tax1n],tranTax2Name as [tax2n] from Trans as [T] where id=" + ID; da = new SQLiteDataAdapter(AIO.command, con); da.Fill(ds, "Trans"); //AIO.command = "select id,itgQTY as [qty],itgPrice as [price],itgDesc as [desc] from TranItemsGrid where itgTranID=" + ID + " order by id asc"; //da = new SQLiteDataAdapter(AIO.command, con); //da.Fill(ds, "TG"); AIO.command = "select tcVal as [val] from TermsCond"; da = new SQLiteDataAdapter(AIO.command, con); da.Fill(ds, "TC"); AIO.command = "select bnkName as [name],bnkBranch as [branch],bnkACNo as [acno],bnkIFSC as [ifsc] from Banks where id=(select tranBankID from Trans where id=" + ID + ")"; da = new SQLiteDataAdapter(AIO.command, con); da.Fill(ds, "Bank"); AIO.command = "select custName as [name],custAdd as [add],custMob as [mob],custEmail as [email],custVatTIN as [vat],custCstNo as [cst],custPAN as [pan] from Customer where id=(select tranCustID from Trans where id=" + ID + ")"; da = new SQLiteDataAdapter(AIO.command, con); da.Fill(ds, "Cust"); AIO.command = "select todDeliveryNote as [tod1],todSupplierRef as [tod2],todMOP as [tod3],todOtherRef as [tod4],todBuyerNo as [tod5],todBuyerDated as [tod6],todDispatchDoc as [tod7],todDispatchDated as [tod8],todDispatchThrough as [tod9],todDestination as [tod10],todTerms as [tod11] from TranOtherDetails where todTransID=" + ID; da = new SQLiteDataAdapter(AIO.command, con); da.Fill(ds, "TOD"); //AIO.command = "select itgModID from TranItemsGrid where itgTranID="+ID; //var dt = a1.dataload(); //string models = ""; //foreach (DataRow row in dt.Rows) //{ // models += row["itgModID"].ToString()+","; //} //models = models.Remove(models.Length - 1, 1); //AIO.command = "select modCatID from model where id in (" + models + ")"; //var dt2 = a1.dataload(); //string coms = ""; //foreach (DataRow row in dt2.Rows) //{ // coms += coms + row["modCatID"].ToString() + ","; //} //coms = coms.Remove(coms.Length - 1, 1); AIO.command = "select (select comName from Company where id=(select catComID from Category where id=modCatID)) as [com],modName as [mod],itgQTY as [qty],itgPrice as [price],itgDesc as [desc] from model as m left join TranItemsGrid as tg on m.id=tg.itgModID where m.id in (select itgModID from TranItemsGrid where itgTranID=" + ID + ") and tg.itgTranID=" + ID + " order by tg.id ASC"; da = new SQLiteDataAdapter(AIO.command, con); da.Fill(ds, "CM"); AIO.command = "select tax1name,tax2name from GeneralSettings"; da = new SQLiteDataAdapter(AIO.command, con); da.Fill(ds, "General"); //ParameterFieldDefinitions crParameterFieldDefinitions; //ParameterFieldDefinition crParameterFieldDefinition; //ParameterValues crParameterValues = new ParameterValues(); //ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue(); //crParameterDiscreteValue.Value = "Purchase"; //crParameterFieldDefinitions = rpt.DataDefinition.ParameterFields; //crParameterFieldDefinition = crParameterFieldDefinitions["reportType"]; //crParameterValues = crParameterFieldDefinition.CurrentValues; //crParameterValues.Clear(); //crParameterValues.Add(crParameterDiscreteValue); //crParameterFieldDefinition.ApplyCurrentValues(crParameterValues); //rpt.SetParameterValue(0, "Purchase"); rpt.SetDataSource(ds); rpt.Refresh(); //rpt.ExportToDisk(ExportFormatType.PortableDocFormat, Path.Combine(Path.GetDirectoryName(Application.ExecutablePath) ,@"\Report\tmpExport.pdf")); //string path = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Fire Shadow"; //rpt.ExportToDisk(ExportFormatType.PortableDocFormat, System.IO.Path.Combine(path,ds.Tables["Trans"].Rows[0]["No"].ToString()) + ".pdf"); crvMainBill.ReportSource = rpt; crvMainBill.RefreshReport(); //crvMainBill.ExportReport(); } catch (Exception ex) { MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); dsCommon ds = new dsCommon(); global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "dtResultDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte())); ) { ; } if ((s1.Position == s1.Length)) { return type; } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return type; }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { dsCommon ds = new dsCommon(); global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny(); any.Namespace = ds.Namespace; sequence.Items.Add(any); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte())); ) { ; } if ((s1.Position == s1.Length)) { return type; } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return type; }