[REPORT] Create a loop in detailsection

6 posts, 1 answers
  1. H
    H avatar
    9 posts
    Member since:
    Apr 2013

    Posted 09 Apr 2013 Link to this post

    Hi,
    I'm trying to generate a labeling report form which contains several text boxes, a bar-code section and quantity.
    What I would like to do is that setting up a column and create a loop to iterate the column as much an exact number the quantity values.
    (FYI : the column has a two sided labels.)

    I think, all I need to do is create a loop only in Detail section/OR create a loop WITH Detail section.
    So, I generated a form and put all boxes and a barcode in the detail section.
    I wrote a code behind by using method; ReportItemBase[] ItemCollection in C#

    http://www.telerik.com/community/forums/reporting/telerik-reporting/loop-through-all-controls.aspx

    Unfortunately, I can not create a loop to iterate the column as much an exact number of the quantity values.

    Change settings, conditional formatting and code behind
    Any concerns and comments would be appreciated it.

    Sincerely,
    H

  2. Milen
    Admin
    Milen avatar
    180 posts

    Posted 12 Apr 2013 Link to this post

    Hi H,

    The best way of implementing label report is to use our Report Wizard (Section Select Report Type) which has label report template.

    See also:
    How to: Create a Multi-Column Report

    Regards,
    Milen
    the Telerik team

    Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

  3. H
    H avatar
    9 posts
    Member since:
    Apr 2013

    Posted 12 Apr 2013 Link to this post

    Hi Milen, 

    First and foremost, I am thanking Telerik team for support the solution.
    I have been looking Report Wizard.
    Maybe I could not explain circumstances clearly.

    The below is another post I've been asking to the community.

    Repeat Details area based on data value


    I am wondering that there is a way to have the details section repeat based on a data value.

    I have a table of items ordered (OrderDetails) with the columns (OrderDetailID, ProductID, Quantity, etc)
    I have a second table with the product information (Products) with columns (ProductID, ProductName, Barcode, etc.)

    What i am trying to do is create a report with the barcodes for all the items sold.  
    The catch is, i need the details area of the report to print once for each Quantity rather than once for each record.
    For instance,  if i have product #1 quantity 4, the barcode for product #1 should print 4 times, rather than once.

    Best Regards,
    H


  4. Answer
    IvanY
    Admin
    IvanY avatar
    417 posts

    Posted 17 Apr 2013 Link to this post

    Hello,

    You will need to prepare your data prior to passing it to the report. What you have to do is to repeat each row of data according to the value in the column. If you are using ObjectDataSource that should be fairly easy since all you have to do is write your own custom logic that checks the column value and then repeats the row the number of times needed. With sql it is a little different, but can be achieved with a simple query - for more information on how to prepare the query please check this article.

    Greetings,
    IvanY
    the Telerik team

    Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

  5. H
    H avatar
    9 posts
    Member since:
    Apr 2013

    Posted 29 Apr 2013 Link to this post

    Hi IvanY,

    Thank Telerik support.
    I solved multiply the required records with ObjectDataSource component and doing code behind.

    Sincerely,
    H. Lim
  6. bob
    bob avatar
    1 posts
    Member since:
    Oct 2014

    Posted 07 Oct 2014 in reply to H Link to this post

    You said you wrote a code behind by using method; ReportItemBase[] ItemCollection in C#?Can you teach me how to do this?
Back to Top