How to design the sub report ?

mohanarajmohanaraj 600001
edited December 2009 in FastReport .NET
Hello,

I want to create the report as in attachments file "Default.Rtf".

In my report Each user have an Extension number and that number is belongs to the particular department i my "deptstruct.bmp" shows the department structure.

My report is generate according to that tree level of the Department with user details.

e.g. 1 page for each orglevelX summary and a new page for each user???s details.
Sequence should be:
Orglvl0 summary, (It having all orglvl1 department's summary details )
first Orglvl1 summary, first Orglvl1 user???s details, next Orglvl1 Summary, next Orglvl1 user???s details
first Orglvl2 summary, first Orglvl2 user???s details, next Orglvl2 Summary, next Orglvl2 user???s details
etc.


could you please help me to design this and how i can Create relations and how can i achieve the exact report as in the attachment.

Thanks in advance.
«1

Comments

  • edited 1:49PM
    Hello,

    Subreport is not necessary in your case. You may use as many nested data bands as needed.
    http://fast-report.com/documentation/UserM...ilrelations.htm
  • mohanarajmohanaraj 600001
    edited 1:49PM
    Dear Alex,

    I design the report without subreport, But i can't get the exact what i want.

    I attach the sample application with this please refer this and guide me where i done wrong in the design.

    I also attach the sample report want i expect.

    Please help me to do..
  • edited 1:49PM
    Sorry, the desired report structure is very unclear to me. I'm afraid I cannot help you with this.
  • mohanarajmohanaraj 600001
    edited 1:49PM
    AlexTZ wrote: »
    Sorry, the desired report structure is very unclear to me. I'm afraid I cannot help you with this.

    Dear Alex,

    My application for generate report for display the call details of Extension that belongs to the department.
    the department having any levels of sub department this will also having extensions (phone).

    In the first page of the report it display the Whole summary of the call details belongs to that department.
    ie in my sample report CLASE and PHONECONTROL is the root (level0) and phonecontrol having sub departments like Accounts,Development,Sales.. and each department having users with extension that was assigned to him.

    In my report second page display the summary details of LevelOth department summary and its direct user's summary and its Level1 summary details.

    Third page display the details about the sub department summary with its direct user's summary and then in next page if it (level1 department) have the subdepartment, the next page dispaly that (level2) sub department details

    the Next page display the Direct user's Extension details.

    and then next 0th level will follows as same as above.

    I this the tree level(department and sub department ) is any number of level. the report will also created according to this.
    i fell it will be designed by recursive program for display any level of detail.

    please help me.
  • edited 1:49PM
    Hello,

    To print tree-like structure, you may use databand with hierarchy. See details in the documentation:
    http://fast-report.com/documentation/UserM...nthierarchy.htm

    You use one databand to print a hierarchy of departments. This databand has a detail data band which prints the extension list of a department.
    I attach an example of a report with this structure.
  • mohanarajmohanaraj 600001
    edited 1:49PM
    Dear Alex,

    Thank you for your reply,

    By the reference of your sample i tried the sample with my data for hierarchic structure but they threw an error as
    "Specified cast is not valid."

    could you please point out my mistake done in this.

    Thanks.
  • edited 1:49PM
    Hello,

    There is no mistake in the report, but your data has wrong rows (for example, a row with Id = 0 and ParentId = 0). I will add a check to avoid wrong results in case of such data. Our build server is down now (we have holidays now till jan 10th), so the new version will be available after jan 10th.
  • mohanarajmohanaraj 600001
    edited January 2010
    Dear alex,

    Whats wrong in my data?, i can't understand what you mean. could you please explain how its wrong.

    Thanks.
  • edited 1:49PM
    You have one item with Id == ParentId. So the item "belongs to itself".
  • mohanarajmohanaraj 600001
    edited 1:49PM
    Dear alex,

    I created the application for generate the report that i mentioned previously by create the .frx file manually with the datasets needed for that report design, but it won't display the data header for the report, when i added the header for display the individual detail section ie Extension 320's detail it will not display even the details after i include header band. but if i not include the code to display header for that databand it will display the details - without header.
    How i display the header for this.

    And also while createing .frx file it take too much of time for generate the .frx file. my concept for create that .frx file is
    At first i Bind the dataset(dtOrgsummary) to display the details of the Level0 th summary and then dtOrgDeptDetail -- dataset display the direct user belonfgs to that Level0 department abd then the summary of sub department (dtOrgLevelSummary) then the dtuserdetail - for individual extension detail.

    this above stem is repeated to display the order details as
    1. ParentDepartment summary
    2. ParentDepartment Direct user's summary
    3. Sub Department belongs to the parent.
    4. Direct user's Extension Detail one by one .

    this will repeated for all department.
  • edited 1:49PM
    Hello,

    It looks like you have endless loop somewhere. I never see the "report created" message.
    Why are you trying to create the fixed report instead of using hierarchy bands? It should work with the latest build (I've fixed the Id==ParentId wrong behavior).
  • mohanarajmohanaraj 600001
    edited January 2010
    Dear Alex,

    Thanks for your update, Its works fine now i got my expected structure of the report.

    But I have to place the summary for the each, As in the .rtf file of previous quote.

    and also the the Data Header is not display for the sub Department levels.

    How i can design the report with summary and solve the issue to display the header.
    where can i place the summary band.

    Thanks in advance.
  • edited 1:49PM
    Hello,

    Use the data footer band to display a summary info for the hierarchy item.
  • mohanarajmohanaraj 600001
    edited 1:49PM
    AlexTZ wrote: »
    Hello,

    Use the data footer band to display a summary info for the hierarchy item.


    Hi Alex,

    Thanks,

    Shall you noticed that the header was not displayed for the sub department levels ?

    The header was displayed once for parent of same level.
    How i solve this ?

    Thanks in advance.
  • edited 1:49PM
    No, I did not noticed that. Which header (DataHeader1,DataHeader2,DataHeader3)? And where do you expect to see it?
  • mohanarajmohanaraj 600001
    edited January 2010
    AlexTZ wrote: »
    No, I did not noticed that. Which header (DataHeader1,DataHeader2,DataHeader3)? And where do you expect to see it?


    Hi Alex,

    DataHeader2 (middle one)
    Header was not print for sub department which have same level.
    Eg:

    Level 1
    Level 2
    Production --> Spices, Masala

    there are two sub department belongs to the production, header print only for the first sub department of the level 2 (Spices) not for others.
    Please refer the pdf attachment.
  • edited 1:49PM
    Ok, I see. Download the latest build and redesign your report a little:
    - move all objects from Data1 header to Data1 (above the data columns);
    - set Data1's StartNewPage and FirstRowStartsNewPage properties to true.
  • mohanarajmohanaraj 600001
    edited January 2010
    Dear Alex,

    Thanks for your build. i see the header displayed for all sub Department.

    But to display the summary of the page it too complex for me.

    I place the total field for display the summary and choose currency format for that text object. But it display the wrong result
    could you please look in to that, and provide the solution.

    I want to to display the summary for the band's result i marked in the attached .Jpg file and also the pdf for your reference.

    Please see my .FRX file (new.zip) and suggest your changes to achieve my need.
  • edited 1:49PM
    Hello,

    The summary format is wrong because your data is of String type. In this case the Sum function just concatenates strings. Make your data correct (all columns such as I/C, Mobile etc - must be of a numeric type, if you need to summarize thenm correctly).

    The reason why is your data is of string type maybe that you use xml data files without the schema. In this case all columns will be of string type. When you make xml files, use the DataSet.WriteXml(file, XmlWriteMode.WriteSchema) call.
  • mohanarajmohanaraj 600001
    edited 1:49PM
    Dear Alex,

    Thanks i will make it correct.

    How can i display the Summary for the Data band i marked in the previous quote.

    Please refer my PDF file for which summary.


    Thanks in advance.
  • edited 1:49PM
    Please correct the data and attach here, so I can proceed.
  • mohanarajmohanaraj 600001
    edited 1:49PM
    Dear Alex,

    I corrected the data in xml by using XmlWriteMode.WriteSchema.

    The format is displayed correct in summary but only first page is displayed other pages are not created please address my mistake.

    Thanks in advance.
  • edited 1:49PM
    You have renamed the dtOrgsummary.ParentId column to ParentDepartmentId, it causes the errors.
    - select Data2 databand and fix its ParentIdColumn property;
    - the relation between dtOrgsummary and dtLevelsummary datasources is not correct, you have to fix it as well. Select dtLevelsummary datasource, click + to expand it, select the dtOrgsummary item (it's a relation), go to the Properties window, click the ChildColumns property editor and replace "ParentId" with "ParentDepartmentId".
  • mohanarajmohanaraj 600001
    edited January 2010
    AlexTZ wrote: »
    You have renamed the dtOrgsummary.ParentId column to ParentDepartmentId, it causes the errors.
    - select Data2 databand and fix its ParentIdColumn property;
    - the relation between dtOrgsummary and dtLevelsummary datasources is not correct, you have to fix it as well. Select dtLevelsummary datasource, click + to expand it, select the dtOrgsummary item (it's a relation), go to the Properties window, click the ChildColumns property editor and replace "ParentId" with "ParentDepartmentId".


    Dear Alex,

    Thanks, i noticed that.

    Please replace the XML file (in the previous quote attached application ) with the new xml file attached here.

    I want to know how to display the summary for the details displayed for the marked data bands of the attached thumbnail.

    And also refer the pdf attached previously.

    Thanks in advance.
  • edited 1:49PM
    Since you need to sum values in different databands, you have to use several totals (one for each band), then sum totals.
    - add data band after the Data4 band, add footer to it. You will print totals here. The footer is needed to reset totals automatically;
    - to get Mobile sum, you need to create 3 totals (to sum Data2, Data3, Data4 values) and summarize it then:
    Total_Mobile1] + [Total_Mobile2] + [Total_Mobile3

    See the attached report.
  • mohanarajmohanaraj 600001
    edited January 2010
    AlexTZ wrote: »
    Since you need to sum values in different databands, you have to use several totals (one for each band), then sum totals.
    - add data band after the Data4 band, add footer to it. You will print totals here. The footer is needed to reset totals automatically;
    - to get Mobile sum, you need to create 3 totals (to sum Data2, Data3, Data4 values) and summarize it then:
    Total_Mobile1] + [Total_Mobile2] + [Total_Mobile3

    See the attached report.


    Dear alex,

    Thanks but i can't extract the file from downloaded zip.
  • mohanarajmohanaraj 600001
    edited 1:49PM
    Dear Alex,

    I add sum values in different databands, by crating several totals (one for each band), then sum totals as you mentioned.

    It display the summary but with wrong calculation.

    It sum all the values of that datasource instead of sum the values only displayed.

    Please refer the attached application and .Frx file.

    Please help in this regard.

    Thanks for your timely support.
  • edited 1:49PM
    Some mistakes:
    - you must specify the "Print on the band" option in each total (select "Data footer" band in which you print the total). In this case the total will reset after printing.
    - some totals were not set properly. For example, Org_Complete_Mobile2 (should be [dtOrgDeptsummary.Mobile]) and Org_Complete_Mobile3 (should be [dtOrgLevelsummary.Mobile]). I didn't check others.
  • mohanarajmohanaraj 600001
    edited 1:49PM
    Dear Alex,

    Thank you very much for your support, its works fine.

    I have one question, ie How i can filter the data for display the data in the data band.

    eg.

    DepartmentId -- Department Name

    0
    Unassigned
    1
    SuzlanFoods
    2
    Parcel

    I have to show only the departmentId = 0,
    How i filter the data in data band ?

    Thanks in advance.
  • edited 1:49PM
    Doubleclick the databand, select "Filter" tab and write the following expression:

    [TableName.ColumnName] == 0

    (replace TableName.ColumnName with actual table/column)

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.