fpspread Grouping

Posted by: redahashem-fp on 8 September 2017, 2:06 pm EST

  • Posted 8 September 2017, 2:06 pm EST

    <FONT color=#ff0066 size=4>i use fpspread Grouping to show invoice head and invoice details its works fine but i want to Filter the tables by  invoice date or invoice number</FONT>


    <FONT color=#ff0066 size=4>i use this code and give me wrong and error</FONT>


    <FONT size=3>========================</FONT>

    <FONT color=#0000ff size=3>

    Dim</FONT><FONT size=3> cmd </FONT><FONT color=#0000ff size=3>As</FONT><FONT size=3> </FONT><FONT color=#0000ff size=3>New</FONT><FONT size=3> OleDbCommand()


    </FONT><FONT color=#0000ff size=3>Dim</FONT><FONT size=3> da </FONT><FONT color=#0000ff size=3>As</FONT><FONT size=3> </FONT><FONT color=#0000ff size=3>New</FONT><FONT size=3> OleDbDataAdapter()


    </FONT><FONT color=#0000ff size=3>Dim</FONT><FONT size=3> ds </FONT><FONT color=#0000ff size=3>As</FONT><FONT size=3> </FONT><FONT color=#0000ff size=3>New</FONT><FONT size=3> DataSet()


    </FONT><FONT color=#0000ff size=3>cn.open</FONT><FONT size=3>


    </FONT><FONT color=#0000ff size=3>With</FONT><FONT size=3> cmd


    .Connection = cn


    .CommandType = CommandType.TableDirect


    .CommandText = </FONT><FONT color=#a31515 size=3>"select code,invoice_no,my_date,invoice_date,suplier_no,suplier_name,total,fara3_name,closed from tbl_invoice_buy_cash_head <FONT color=#a31515 size=3>where(tbl_invoice_buy_cash_head.my_date=#"</FONT><FONT color=#000000 size=3> & DateEdit1.Text & </FONT><FONT color=#a31515 size=3>"#)</FONT>"

    </FONT><FONT size=3>

    </FONT><FONT color=#0000ff size=3>End</FONT><FONT size=3> </FONT><FONT color=#0000ff size=3>With

    </FONT><FONT size=3>

    da.SelectCommand = cmd


    da.Fill(ds, </FONT><FONT color=#a31515 size=3>"tbl_invoice_buy_cash_head"</FONT><FONT size=3>)


    cmd.CommandText = </FONT><FONT color=#a31515 size=3>"select ivoice_no,item_no,item_name,quantity,price,total_price from tbl_invoice_buy_cash_details"

    </FONT><FONT size=3>

    da.SelectCommand = cmd


    da.Fill(ds, </FONT><FONT color=#a31515 size=3>"tbl_invoice_buy_cash_details"</FONT><FONT size=3>)


    ds.Relations.Add(</FONT><FONT color=#a31515 size=3>"Root"</FONT><FONT size=3>, ds.Tables(</FONT><FONT color=#a31515 size=3>"tbl_invoice_buy_cash_head"</FONT><FONT size=3>).Columns(</FONT><FONT color=#a31515 size=3>"code"</FONT><FONT size=3>), ds.Tables(</FONT><FONT color=#a31515 size=3>"tbl_invoice_buy_cash_details"</FONT><FONT size=3>).Columns(</FONT><FONT color=#a31515 size=3>"ivoice_no"</FONT><FONT size=3>))


    FpSpread1.DataSource = ds


     thanks 4 help


    <img src="/emoticons/emotion-1.gif" alt="Smile" /> <img src="/emoticons/emotion-1.gif" alt="Smile" /> <img src="/emoticons/emotion-1.gif" alt="Smile" /> <img src="/emoticons/emotion-1.gif" alt="Smile" />


     


     

    </FONT>
  • Replied 8 September 2017, 2:06 pm EST

    it doent work if i have more than dates in my table and this is the error message-<FONT color=#cc3333>This constraint cannot be enabled as not all values have corresponding parent values.</FONT>


    <BLOCKQUOTE><div><img src="/wp-content/uploads/CS_images/icon-quote.gif"> Reeva Dhingra:</div><div>


    <SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman">In addition to this, if you want to use the filtering feature of fpSpread with grouping feature (as is evident from the subject line of Post), then please note that Grouping and Filtering do not work together. If you want to use grouping, you should not use filtering and you should clear the filter under the Grouping event.<o:p></o:p></FONT></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><o:p><FONT face="Times New Roman"> </FONT></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><o:p> </o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><o:p></o:p></SPAN><SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman">Reeva Dhingra<o:p></o:p></FONT></SPAN>


    <o:p><FONT face="Times New Roman">GrapeCity Farpoint</FONT></o:p>


    <o:p><FONT face="Times New Roman" size=3> </FONT></o:p>


    </div></BLOCKQUOTE>


    <FONT color=#cc3333>your sample using to filter the child table- and me not   i want to filter parent table</FONT>


    <FONT color=#cc3333></FONT> 


    <FONT color=#cc3333>thanks 4 help</FONT>

  • Replied 8 September 2017, 2:06 pm EST

    <SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman">Hi Redahashem,<o:p></o:p></FONT></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><o:p><FONT face="Times New Roman"> </FONT></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman">In your code there is data type mismatch in expression criteria. For Date/ Time data type, you need to use the <B>DateValue</B> function. The <B>DateValue</B> function converts a string to a date. S<SPAN style="mso-bidi-font-style:italic;">tring</SPAN> can be a date ranging from January 1, 100 to December 31, 9999. <B>DateValue</B> also recognizes unambiguous dates that contain month names, either in long or abbreviated form. <o:p></o:p></FONT></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><o:p><FONT face="Times New Roman"> </FONT></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman">Here is the sample code to achieve the required functionality of filtering the tables by InvoiceDate OR InvoiceNumber.<o:p></o:p></FONT></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><o:p><FONT face="Times New Roman"> </FONT></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman">Private Sub GroupingAndFiltering_Load(sender As Object, e As EventArgs)<o:p></o:p></FONT></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman"><SPAN style="mso-spacerun:yes;">   </SPAN>Dim ds As New DataSet()<o:p></o:p></FONT></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman"><SPAN style="mso-spacerun:yes;">   </SPAN>Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Microsoft Office\OFFICE11\SAMPLES\Northwind.mdb"<o:p></o:p></FONT></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman"><SPAN style="mso-spacerun:yes;">   </SPAN>Dim con As New OleDbConnection(connectionString)<o:p></o:p></FONT></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman"><SPAN style="mso-spacerun:yes;">   </SPAN>Dim qstringCustomers As String = "SELECT * FROM Customers"<o:p></o:p></FONT></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman"><SPAN style="mso-spacerun:yes;">   </SPAN>Dim qstringOrders As String = "SELECT OrderID, CustomerID, EmployeeID, InvoiceDate, RequiredDate, ShippedDate, InvoiceNumber FROM Orders WHERE InvoiceDate = <B>DateValue</B> ('04-Jul-1996') OR InvoiceNumber = 3"<o:p></o:p></FONT></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman"><SPAN style="mso-spacerun:yes;">  </SPAN></FONT></SPAN><SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman"><SPAN style="mso-spacerun:yes;">   </SPAN>Dim adapterCustomer As New OleDbDataAdapter(qstringCustomers, con)<o:p></o:p></FONT></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman"><SPAN style="mso-spacerun:yes;">   </SPAN>Dim adapterOrders As New OleDbDataAdapter(qstringOrders, con)<o:p></o:p></FONT></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman"><SPAN style="mso-spacerun:yes;">   </SPAN>adapterCustomer.Fill(ds, "Customers")<o:p></o:p></FONT></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman"><SPAN style="mso-spacerun:yes;">   </SPAN>adapterOrders.Fill(ds, "Orders")<o:p></o:p></FONT></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman"><SPAN style="mso-spacerun:yes;">   </SPAN>Dim customerToOrders As New DataRelation("customerToOrder",<SPAN style="mso-spacerun:yes;">   </SPAN>ds.Tables("Customers").Columns("CustomerID"), ds.Tables("Orders").Columns("CustomerID"))<o:p></o:p></FONT></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman"><SPAN style="mso-spacerun:yes;">   </SPAN>ds.Relations.Add(customerToOrders)<o:p></o:p></FONT></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman"><SPAN style="mso-spacerun:yes;">   </SPAN>fpSpread1.DataSource = ds<o:p></o:p></FONT></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman">End Sub 'GroupingAndFiltering_Load<o:p></o:p></FONT></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><o:p><FONT face="Times New Roman"> </FONT></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman">In addition to this, if you want to use the filtering feature of fpSpread with grouping feature (as is evident from the subject line of Post), then please note that Grouping and Filtering do not work together. If you want to use grouping, you should not use filtering and you should clear the filter under the Grouping event.<o:p></o:p></FONT></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><o:p><FONT face="Times New Roman"> </FONT></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><o:p> </o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;"><o:p></o:p></SPAN><SPAN style="FONT-SIZE:10pt;"><FONT face="Times New Roman">Reeva Dhingra<o:p></o:p></FONT></SPAN>


    <o:p><FONT face="Times New Roman">GrapeCity Farpoint</FONT></o:p>


    <o:p><FONT face="Times New Roman" size=3> </FONT></o:p>


    2009/10/FpSpreadGrouping.zip
  • Replied 8 September 2017, 2:06 pm EST

    i hve one problem with  relation grouping when primary key contains from 2 columns gives error


    i use this code


    =========================

    <FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> cmd </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> OleDbCommand()


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> da </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> OleDbDataAdapter()


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> ds </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> DataSet()


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Call</FONT></FONT><FONT size=2> cnopen()


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> sql1 </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>String

    </FONT></FONT><FONT size=2>

    sql1 = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"select*from tbl_invoice_sale_barcode_head "

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> sql2 </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>String</FONT></FONT><FONT size=2> = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"select* from tbl_invoice_sale_barcode_details"

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> head </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> OleDbDataAdapter(sql1, cn)


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> details </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> OleDbDataAdapter(sql2, cn)


    head.Fill(ds, </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"tbl_invoice_sale_barcode_head"</FONT></FONT><FONT size=2>)


    details.Fill(ds, </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"tbl_invoice_sale_barcode_details"</FONT></FONT><FONT size=2>)


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> parentColumns() </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> DataColumn


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> childColumns() </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> DataColumn


    parentColumns(0) = ds.Tables(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"tbl_invoice_sale_barcode_details"</FONT></FONT><FONT size=2>).Columns(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"doc_no"</FONT></FONT><FONT size=2>)


    parentColumns(1) = ds.Tables(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"tbl_invoice_sale_barcode_details"</FONT></FONT><FONT size=2>).Columns(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"casher_no"</FONT></FONT><FONT size=2>)


     


    childColumns(0) = ds.Tables(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"tbl_invoice_sale_barcode_details"</FONT></FONT><FONT size=2>).Columns(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"doc_no"</FONT></FONT><FONT size=2>)


    childColumns(1) = ds.Tables(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"tbl_invoice_sale_barcode_details"</FONT></FONT><FONT size=2>).Columns(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"casher_no"</FONT></FONT><FONT size=2>)


     


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> bConstraints </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Boolean</FONT></FONT><FONT size=2> = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>True

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>' Create DataRelation.

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> CustOrderRel </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> DataRelation = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> DataRelation( _


    </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"CustomersOrders"</FONT></FONT><FONT size=2>, parentColumns, childColumns, _


    bConstraints)


    </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>' Add the relation to the DataSet.

    </FONT></FONT><FONT size=2>

    ds.Relations.Add(CustOrderRel)

    </FONT><FONT size=2>

    FpSpread1.DataSource = ds


     

    </FONT>
  • Replied 8 September 2017, 2:06 pm EST

    thank you so 100000000000000000000000000000000000000000000000000000000 much


    it works good


     

  • Replied 8 September 2017, 2:06 pm EST

    Redahashem,


    For this you need to set constraint in DataRelation class to false.


    ds.Relations.Add(CustomerToOrder, parentCol, childCol, false)


    By default, when you create a relationship, it enforces foreign key constraints, by setting to false, you are telling it that you dont want to enforce the relationship.


     Reeva Dhingra


    GrapeCity FarPoint

  • Replied 8 September 2017, 2:06 pm EST

    Hello Redahashem,


    You need to set your code to this:


    <BLOCKQUOTE>

                parentColumns(0) = ds.Tables("tbl_invoice_sale_barcode_details").Columns("doc_no")
                parentColumns(1) = ds.Tables("tbl_invoice_sale_barcode_details").Columns("casher_no")
                childColumns(0) = ds.Tables("tbl_invoice_sale_barcode_head").Columns("doc_no")
                childColumns(1) = ds.Tables("tbl_invoice_sale_barcode_head").Columns("casher_no")

    </BLOCKQUOTE>

    instead of the code given below in order to make it work i.e. the parentColumns(0) and childColumns(0) should contain same columns but from different tables so that they can be mapped together and same for the parentColumns(1) and childColumns(1).


    <BLOCKQUOTE>

                parentColumns(0) = ds.Tables("tbl_invoice_sale_barcode_details").Columns("doc_no")
                parentColumns(1) = ds.Tables("tbl_invoice_sale_barcode_details").Columns("casher_no")
                childColumns(0) = ds.Tables("tbl_invoice_sale_barcode_details").Columns("doc_no")
                childColumns(1) = ds.Tables("tbl_invoice_sale_barcode_details").Columns("casher_no")

    </BLOCKQUOTE>

    Hope this will help you. Thanks.

  • Replied 8 September 2017, 2:06 pm EST

    thanks so much 4 help it works
  • Replied 8 September 2017, 2:06 pm EST

    Hello Redahashem,


    Please find the attched zipped project wherein the code mentioned above is working fine.


    Please let us know your further observations for the same.


    Thanks.


    2010/02/FpSpreadGrouping.zip
  • Replied 8 September 2017, 2:06 pm EST

    i  Modified the cod to this


    -----------------


                parentColumns(0) = ds.Tables("tbl_invoice_sale_barcode_details").Columns("doc_no");
                parentColumns(1) = ds.Tables("tbl_invoice_sale_barcode_details").Columns("casher_no");
                childColumns(0) = ds.Tables("tbl_invoice_sale_barcode_head").Columns("doc_no");
                childColumns(1) = ds.Tables("tbl_invoice_sale_barcode_head").Columns("casher_no");


    -------------------------------------------------------------------------------------------------------------------------------------------


    but still give error do u try it with my database it didnt work with me


     

  • Replied 8 September 2017, 2:06 pm EST

    Hello,


    You can not set the relations by setting the ParentColumns(0) and ChildColumns(0) of same table only, they has to be mapped from different tables. Hence, while setting the childColumns(0) and childColumns(1) the Table has to be <FONT color=#000000>tbl_invoice_sale_barcode_head instead of </FONT><FONT color=#000000>tbl_invoice_sale_barcode_details.</FONT>


    Hope this will help you, else you can get back to us. Thanks.

  • Replied 8 September 2017, 2:06 pm EST

    so how can i do to show grouping if primary key in database contains from 2 columns - cols[0]+cols[1] in Parent table  relations with cols[0]+cols[1] in Child table 


    this link for my database


    http://www.4shared.com/file/224165628/7dbebcd/Database1.html


     <FONT size=4>would you <SPAN id=result_box class=short_text><SPAN style="BACKGROUND-COLOR:#ebeff9;">Modified this code to fit me</SPAN></SPAN></FONT>

    <FONT size=4><SPAN class=short_text><SPAN style="BACKGROUND-COLOR:#ebeff9;"><FONT color=#0000ff size=2><FONT color=#0000ff size=2>

    Dim</FONT></FONT><FONT size=2> cmd </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> OleDbCommand()


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> da </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> OleDbDataAdapter()


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> ds </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> DataSet()


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Call</FONT></FONT><FONT size=2> cnopen()


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> sql1 </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>String

    </FONT></FONT><FONT size=2>

    sql1 = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"select*from tbl_invoice_sale_barcode_head "

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> sql2 </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>String</FONT></FONT><FONT size=2> = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"select* from tbl_invoice_sale_barcode_details"

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> head </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> OleDbDataAdapter(sql1, cn)


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> details </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> OleDbDataAdapter(sql2, cn)


    head.Fill(ds, </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"tbl_invoice_sale_barcode_head"</FONT></FONT><FONT size=2>)


    details.Fill(ds, </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"tbl_invoice_sale_barcode_details"</FONT></FONT><FONT size=2>)


     


     


     


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> headTodetails </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> DataRelation(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"headTodetails"</FONT></FONT><FONT size=2>, ds.Tables(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"tbl_invoice_sale_barcode_head"</FONT></FONT><FONT size=2>).Columns(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"doc_no "</FONT></FONT><FONT size=2>), ds.Tables(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"tbl_invoice_sale_barcode_details"</FONT></FONT><FONT size=2>).Columns(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"doc_no"</FONT></FONT><FONT size=2>), </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>False</FONT></FONT><FONT size=2>)


    FpSpread1.DataSource = ds

    </FONT></SPAN></SPAN></FONT>
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels