Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


DataReport with two tables


DataReport with two tables

Author
Message
Smartchap
Smartchap
Forum God
Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)

Group: Forum Members
Posts: 23, Visits: 90
I have two tables in one MSAccess database file and want to get output of them one after other. How to place controls in DataReport & how to relate tables in DataEnvironment (or through programming dynamically) is not known to me? Please help. For clarity of question I have attached one file. please lopen the file and understand my problem clearly.



Thanks.


Always Believe in GOD!
Attachments
2Tables.doc (746 views, 34.00 KB)
vb5prgrmr
vb5prgrmr
Forum God
Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)

Group: Forum Members
Posts: 167, Visits: 786
Sorry smartchap who is affected with a social mental disease but most people will not download and open something that could contain macros harmful to their computer...
Smartchap
Smartchap
Forum God
Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)

Group: Forum Members
Posts: 23, Visits: 90
U are right but I think before opening the file people can scan it. I think if u want to help someone, u have to have some pain, may be it is ur valuable time. If people don't want to help others, I think these helping forums could not exist. OK, I will try to clear my problem here itself. I am having a form containing several records. In each record there are two MSFlexGrids which are populated from data files while a particular record is displayed (by Searching). I want to print the displayed record with both MSFGrid data as they appear, i.e. as two tables. The number of columns for both the grids are different & no of rows depend on the data in these grids. In printout other labels, textboxes, combobox.text, etc must appear with data of both grids as two tables having top row as Field names (top row of MSFlexGrid) and other rows as data in cells. Both grids can be related with the unique ID of displayed record, e.g. for 7th record it is 7.

I think I am clear about my problem. Also I hope a person like u who took pain in seeing my problem will certainly help me.

I am using VB6 with DataReport & DataEnvironment. If done by programming, i.e. without DataEnvironment, it will be of great help.

Whenever I get Report it shows each row of data with row of field names before them.



Please help me.


Always Believe in GOD!
Smartchap
Smartchap
Forum God
Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)

Group: Forum Members
Posts: 23, Visits: 90
I have typed the contents of .doc file as below:



I have two tables as follows, in a MSAccess database file, say Data1. First table is named Table1 & second Table2. Upper row is field names in both the tables.



SNo   FName   LName   Address   ID

1   Ram    Agrawal   Lucknow   1

2   Shyam   Yadav   Jhansi   1





SNo   Name    Department   Designation    Remarks   ID

1   Mohan    Maint    Sr. Manager   Drive    1

2   Sohan    Civil    Manager    Road    1

3   Sandhya    Finance    Manager    Bills    1

4   Rajiv    Design    Ch. Manager   Motors   2





Both the tables are related to each other by ID. Now I want to get output in DataReport (of VB6) as follows:



SNo   FName   LName   Address

1   Ram    Agrawal   Lucknow

2   Shyam   Yadav   Jhansi



SNo   Name    Department   Designation    Remarks

1   Mohan   Maint    Sr. Manager   Drive

2   Sohan   Civil    Manager    Road

3   Sandhya   Finance   Manager    Bills



Actually when I take output row1 of table1 gets printed before each record for table1 and similarly for table2 also. Bur I want to print row1 only once and then all the records as above. In both the tables for Row1 I have used labels (RptLabel) & for records Text Boxes (RptTaxtBox).



Please help by telling me what things are to be placed in which section of the DataReport & how tables are to be related in DataEnvironment (or Shape command if doing dynamically).



Thanks.




Always Believe in GOD!
vb5prgrmr
vb5prgrmr
Forum God
Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)Forum God (39K reputation)

Group: Forum Members
Posts: 167, Visits: 786
>U are right but I think before opening the file people can scan it.

Why do I have to do something to help YOU when you could have had some forethought and posted it as a text file or if you wanted to keep some sort of formatting you could have posted a *.RTF file!

>I think if u want to help someone, u have to have some pain, may be it is ur valuable time.

Pain? Why do I have to go through pain to alievate your pain? Don't think so and you are right. It is our time and trying to decipher the u's, ur's, tks, etc. only adds to our pain or our time in trying to decipher exactly what you are trying to say.

>If people don't want to help others, I think these helping forums could not exist.

True

>OK, I will try to clear my problem here itself. I am having a form containing several records.

>In each record there are two MSFlexGrids which are populated from data files while a particular record is displayed (by Searching).

>I want to print the displayed record with both MSFGrid data as they appear, i.e. as two tables.

>The number of columns for both the grids are different & no of rows depend on the data in these grids.

>In printout other labels, textboxes, combobox.text, etc must appear with data of both grids as two tables having top row as Field names (top row of MSFlexGrid) and other rows as data in cells.

Okay, test project time. Start new standard exe, add MSFlexGrid and Name it FG.

Private Sub Form_Load()

FG.Row = 0

FG.Col = 0

FG.Text = "Record No"

FG.Col = 1

FG.Text = "Field1"

End Sub

Okay, that shows you how to enter information into any cell you want.

>Both grids can be related with the unique ID of displayed record, e.g. for 7th record it is 7.

>I think I am clear about my problem. Also I hope a person like u who took pain in seeing my problem will certainly help me.

>I am using VB6 with DataReport & DataEnvironment. If done by programming, i.e. without DataEnvironment, it will be of great help.

>Whenever I get Report it shows each row of data with row of field names before them.

BTW. I do not need to read about your beliefs nor do I need you to try and push your social mental disease upon me. This is a technical forum and not a social gathering forum so I keep or try to keep my beliefs to myself...

 

Good Luck

Smartchap
Smartchap
Forum God
Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)

Group: Forum Members
Posts: 23, Visits: 90
Dear



It seems either I could not explain my problem properly or u didn't understand it properly or u didn't read the problem. How to write data in MSFlexGrid is known to me. I want to get the output from two MSFlexGrids in a DataReport in tabular form with first row as fixed (field names) and subsequent rows having data from other rows. Both tables must appear separately. So tell me in which section of the DataReport what labels / textboxes will be placed and how these two tables will be related to each other / main record ID. Actually I am having a .mdb file having some records and each record has two MSFlexGrids having different no. of columns and diff. no. of rows. For each record no. of columns in MSFGrids is fixed but no. of rows may differ.



Now take some pain & help.



Thanks.




Always Believe in GOD!
Smartchap
Smartchap
Forum God
Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)

Group: Forum Members
Posts: 23, Visits: 90
I am attaching a zip file os .mdb file containing all 3 tables for exapmle purpose. These tables will make data clear.

If u want can open it.

Thanks


Always Believe in GOD!
Attachments
TwoTables.zip (760 views, 10.00 KB)
Smartchap
Smartchap
Forum God
Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)Forum God (6.8K reputation)

Group: Forum Members
Posts: 23, Visits: 90
Dear friends

I am still having hope to get solution from someone who wants to have pain helping me.


Always Believe in GOD!
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search