Results 1 to 15 of 15

Thread: Change the section of a control

  1. #1

    Thread Starter
    Hyperactive Member Jupiter-SL9's Avatar
    Join Date
    Apr 2001
    Location
    Porto Alegre
    Posts
    289

    Change the section of a control

    Hi
    Im using data report to make a report and I need to show one picture by record in details section.

    I have read that isn't possible to load dinamically pictures in details section, but my alternative is load my pictures in another section and then move to details section.

    I accept sugestions to use another Report Generator, except Crystal reports.

    How can I do it?
    Another sugestion?
    Thanks
    Daniel
    If you want to be loved, first love who God gave to you.

    "Se você quer ser amado, primeiro ame quem Deus te deu"

    (Acts 20:35)

  2. #2
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Thumbs up Re: Change the section of a control

    except Crystal reports.

    Why you do not want to use the crystal report , you are saying here expect crystal report so i am asking you this question.

    Next code is for dynamically loadthe picture in the data report.
    VB Code:
    1. Private Sub DataReport_Initialize()
    2. Set Me.Sections("SectionHeader").Controls("Image1").Picture = LoadPicture(App.Path & "\LH1.jpg") 'Image Name
    3. End Sub
    Last edited by shakti5385; Oct 27th, 2006 at 12:10 PM.

  3. #3

    Thread Starter
    Hyperactive Member Jupiter-SL9's Avatar
    Join Date
    Apr 2001
    Location
    Porto Alegre
    Posts
    289

    Re: Change the section of a control

    Hi
    except crystal because I cannot buy crystal. I have crystal 4.1 version, but this version don't load dinamically pictures. Or not?

    Thanks for your code, but I need to show dinamically pictures in details section. My idea was to load dinamically pictures in header section and after, move to details section.

    Any sugestion?

    Daniel
    If you want to be loved, first love who God gave to you.

    "Se você quer ser amado, primeiro ame quem Deus te deu"

    (Acts 20:35)

  4. #4
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Wink Re: Change the section of a control

    I send you code for the data report not for the crystal report, so if you not have the crystal report then you can use the data report in your project too.

  5. #5

    Thread Starter
    Hyperactive Member Jupiter-SL9's Avatar
    Join Date
    Apr 2001
    Location
    Porto Alegre
    Posts
    289

    Re: Change the section of a control

    Hi

    my problem isn't load a image dinamically in data report. My problem is load a image dinamically in "details" section of data report, one different image per record.

    thanks for your reply
    Daniel
    If you want to be loved, first love who God gave to you.

    "Se você quer ser amado, primeiro ame quem Deus te deu"

    (Acts 20:35)

  6. #6
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Thumbs up Re: Change the section of a control


    Can you please tell me that where you are saving your image that is in the databse or in the other folder.
    Have you dave the image in the databse?
    Last edited by shakti5385; Oct 30th, 2006 at 12:13 PM.

  7. #7

    Thread Starter
    Hyperactive Member Jupiter-SL9's Avatar
    Join Date
    Apr 2001
    Location
    Porto Alegre
    Posts
    289

    Re: Change the section of a control

    Im loading images from ImageList control directly in VB.
    If you want to be loved, first love who God gave to you.

    "Se você quer ser amado, primeiro ame quem Deus te deu"

    (Acts 20:35)

  8. #8
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: Change the section of a control


    I want to say one thing that as I give you the code in the above post, did you try for it. Using this code you are able to change the image also at the run time. Make a loop for your search record shoe the section according to the searched data, after it search the picture according to the record and load the picture.
    This is batter if you try for it. Just make a try then if you get any problem the tell again.


  9. #9

    Thread Starter
    Hyperactive Member Jupiter-SL9's Avatar
    Join Date
    Apr 2001
    Location
    Porto Alegre
    Posts
    289

    Re: Change the section of a control

    I try your code and it load the image in Picture box dinamically. But...

    Making a loop, and loading different images to each step of loop, in the end of loop, when the report is showed, all images are the same, the last image loaded.
    If you want to be loved, first love who God gave to you.

    "Se você quer ser amado, primeiro ame quem Deus te deu"

    (Acts 20:35)

  10. #10
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: Change the section of a control


    I think that you are making some mistake in the code also, also just check the image name in your code is it the same or different, trace the code using the F8 Key then you are able to know properly that how the code is running.

  11. #11

    Thread Starter
    Hyperactive Member Jupiter-SL9's Avatar
    Join Date
    Apr 2001
    Location
    Porto Alegre
    Posts
    289

    Re: Change the section of a control

    I don't know how to resolve this problem. My code is:

    VB Code:
    1. For i = 1 To npasse
    2.         rs_impri.AddNew
    3.         rs_impri!passes_gaiola = NomeGaiola(i - 1)
    4.         Set relatorio_.Sections("details").Controls("image1").Picture = novo_calibra.il2.ListImages.Item(i).Picture
    5.         rs_impri.Update
    6.     Next
    7.      
    8.     Set relatorio_.DataSource = rs_impri
    If you want to be loved, first love who God gave to you.

    "Se você quer ser amado, primeiro ame quem Deus te deu"

    (Acts 20:35)

  12. #12
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Change the section of a control

    I don't know how to resolve this problem.
    You cannot set a different picture for each detail record. The DataReport.rptImage control is not a bound control, ie it does not have the neccessary properties (DataMember, DataField etc.) to bind each instance to a data source.

  13. #13

    Thread Starter
    Hyperactive Member Jupiter-SL9's Avatar
    Join Date
    Apr 2001
    Location
    Porto Alegre
    Posts
    289

    Re: Change the section of a control

    Hi
    Don't exist another way to make this functionality?
    Thanks
    Daniel
    If you want to be loved, first love who God gave to you.

    "Se você quer ser amado, primeiro ame quem Deus te deu"

    (Acts 20:35)

  14. #14
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Change the section of a control

    Don't exist another way to make this functionality?
    No. The DataReport is pretty limited. It has no "processing per detail record" capabilities whatsoever.

    How complex is your report? Using the Printer object directly might be an option for you.

  15. #15

    Thread Starter
    Hyperactive Member Jupiter-SL9's Avatar
    Join Date
    Apr 2001
    Location
    Porto Alegre
    Posts
    289

    Re: Change the section of a control

    My report is complex, actually it is printed with Printer Object, but has very bugs and problems. Im converting the report to another more friendly tool.

    I have the advantage to know the limit of records, so, I will use only the header section of report, and load images dinamically in this section.

    thanks for your reply
    Daniel
    If you want to be loved, first love who God gave to you.

    "Se você quer ser amado, primeiro ame quem Deus te deu"

    (Acts 20:35)

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