Results 1 to 19 of 19

Thread: Data Report and MSFlexgrids

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2009
    Posts
    98

    Angry Data Report and MSFlexgrids

    In VB6 in a form there are 10 labels and associated 10 textboxes and 2 MSFlexGrids. There are 5 columns in the first MSFGrid and 7 in the second MSFGrid. There are 3 rows in the first grid and 4 in the second. I want to generate a report (may be using DataEnvironment and DataReport, as I don’t have Crystal Report) in such a way the its output should be as follows:

    7 Labels and associated 7 textboxes

    Data in First MSFlexGrid (first row showing headings of columns and next 3 rows data)

    Data in second MSFlexGrid (in similar fashion as for first grid)

    Remaining 3 labels and 3 textboxes in the form


    Please help me, if possible by attaching an example program.

    Thanks in advance.

  2. #2
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,513

    Re: Data Report and MSFlexgrids

    Thers no way to answer your question without alot more info.

    Where is the data coming from?
    How are the grids loaded?
    Is this a single page report or multi page?
    Is there grouping?
    What are you having problems doing?

    Basically your question is to general. You need to ask a specific question, regarding a problem with the report that you can't seem to solve.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2009
    Posts
    98

    Re: Data Report and MSFlexgrids

    Thanks for the attention.
    Actually I am filling some text boxes and adding the data in those text boxes to MSFlexgrids, row by row.
    So grids are loaded from data being filled in textboxes. (When using Search data is being filled from two tables, one for first MSFGrid & other for second MSFGrid).
    The report may be single as well as multi page depending on the number of rows in MSFlexGrids. If rows are less, report will be of single page.
    What do you mean by grouping is not understood by me? For each record data in grids will be different.
    Actually I want to get output on report in such a way that both the MSFlexGrid data is shown as different tables in the report. First table for first MSFGrid and next for other MSFGrid.

    I think I made all the things clear. If any doubt please ask again. It will be very helpful to get the solution.

  4. #4
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,513

    Re: Data Report and MSFlexgrids

    What are you having a problem with? DataEnvironment? DataReport?

    You could post what you have so far and I'd be glad to take a look at it.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Aug 2009
    Posts
    98

    Re: Data Report and MSFlexgrids

    I have attached a doc file to make my problem clear. Please have a look at it and help me.

    Actually what happens is that with each record row field names row is also displayed (before record row).

    Thanks for taking interest.
    Attached Files Attached Files

  6. #6
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,513

    Re: Data Report and MSFlexgrids

    What is the relation between Table1 and Table2? I can't see any relationship between the two grids from viewing the document you posted. You have to have a field in both both tables that you use for relating them to each other. Then you can setup a Command and Child command in the dataenvironment. In the properties section of the Child Command, use the "relation" tab to setup the relation between the two tables. Then set that dataenvironment as the reports datasource. Right click the report and select "retrieve Structure". this will setup the report sections for you.

    I've attached an example;

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Aug 2009
    Posts
    98

    Re: Data Report and MSFlexgrids

    The two tables are related by 'ID'. New file is attached for reference. Actually I have already done this but problem is that with each record Field Names also appear. Please post both DataEnvironment as well as DataReport designed to suit my problem. The output should be as required.
    Thanks once again.
    Attached Files Attached Files

  8. #8
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,513

    Re: Data Report and MSFlexgrids

    I'll be glad to help with a specific question but I will not design the report for you. Post your DataEnvironment and Report with the question.

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Aug 2009
    Posts
    98

    Re: Data Report and MSFlexgrids

    I have attached 3 zip files of the project. One having project, DataReport, DataEnvironment,Form second having data file .mdb and third explaining problem in .doc file.
    Attached Files Attached Files

  10. #10
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,513

    Re: Data Report and MSFlexgrids

    That makes things alot clearer. I see your problem. I think your going to need to create a table and load the report details for each person in it. I don't have time this weekend but will try and send you something Monday.

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Aug 2009
    Posts
    98

    Re: Data Report and MSFlexgrids

    Dear wes4dbt

    I will eagerly wait for Monday.

    Thaaaanks once again.

  12. #12
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,513

    Re: Data Report and MSFlexgrids

    Made a small report but I think you'll see how to solve your problem. you will have to change the connection string for "dataenvironment1".

    Good Luck

    EDIT; sorry, don't download, use the download in next post
    Last edited by wes4dbt; Aug 30th, 2009 at 07:06 PM.

  13. #13
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,513

    Re: Data Report and MSFlexgrids

    Use this

  14. #14

    Thread Starter
    Lively Member
    Join Date
    Aug 2009
    Posts
    98

    Re: Data Report and MSFlexgrids

    Thanks wes4dbt

    I have modified it for different no. of fields in Table 2 & Table3. Now I will try to have border lines around fields (specially of reportdata) as for Table2 only 6 fields are used & for Table3 7 fields are used. If I draw them in DataReport then for Table2 a blank border for last column will be displayed which is not required.

    Thanks once again.

    Actually yesterday I read on one forum site to use grouping but actually I don't know much about grouping. Will try to find out on net. Meanwhile if u know some good site, plz tell me the address.

    Thanks.

  15. #15

    Thread Starter
    Lively Member
    Join Date
    Aug 2009
    Posts
    98

    Re: Data Report and MSFlexgrids

    One more help from u. I want to display data from Table 2 & Table3 only for a particular ID from Table1 (based on data in text box on form). I tried it but could not succeed in ur program. Plz help.

  16. #16
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,513

    Re: Data Report and MSFlexgrids

    This is how to use a parameter.

  17. #17

    Thread Starter
    Lively Member
    Join Date
    Aug 2009
    Posts
    98

    Re: Data Report and MSFlexgrids

    Thanks wes4dbt
    I am attaching a zip file. Please see it and help me further.
    First, I have added a .AddNew so that last record of last table is also added, otherwise it was never added to reportdata & report.
    Second, if u test ur program, it displays data for first time inserted ID in text box unless the program is stopped and re run. Why data for new ID entered in textbox is not shown without stopping & rerunning the program. Plz help.
    Third, I have modified the program by u. Plz check it & help. In this program even I have used .Refresh for DataReport but it is not refreshing. Suppose first time I enter ID 1, it displays report with no record for any ID. Now I have to stop the program & re run it. Suppose now I enter ID=2, it will now display records for ID=1 (entered previously)? I want to get output for entered ID when it is entered and also without re running the program.
    Fourth, I want to display border lines around each record (which can be drawn around text boxes in DataReport). My question is how to not display these border lines for a particular record (say 2nd record of table2).

    A lot of questions but with a confidence to get answers soon.

    Thanks again.

  18. #18
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,513

    Re: Data Report and MSFlexgrids

    Use ".Update" to update a recordset.

    this will solve your refresh problem
    Code:
    If DataEnvironment1.rsCommand1_Grouping.State = adStateOpen Then
        DataEnvironment1.rsCommand1_Grouping.Close
    End If
    DataEnvironment1.Commands("command1_grouping").Parameters("param1").Value = CInt(Text1.Text)
    DataReport1.Show

  19. #19

    Thread Starter
    Lively Member
    Join Date
    Aug 2009
    Posts
    98

    Re: Data Report and MSFlexgrids

    Sorry, I forgot to attach zip file. Now it is attached.
    Thanks wes4dbt. Last night I solved the problem in the program attached by u by using unload & load property of dataenvironment1 before showing datareport. But the problems for my program are still there. I am going to try the method told by u. Meanwhile plz have a look at the attched file & suggest.
    Thanks.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width