Relation and Parameters problems!

edited 1:21AM in FastReport .NET
HI~

I have two problems for Relation and Parameters.

Problem 1-
When i design MASTER-DETAIL report follow example in "FRNetUserManual-en.pdf",
and i find i must add two data bands to create MASTER-DETAIL relation,
but if i used Fast Report 3 does not add two data bands to create MASTER-DETAIL relation. it just set the MASTER relation.

how can i used like Fast Report 3 just add one data bands and design MASTER-DETAIL report ?
(Now in Fast Report@NET if only one data band and set the MASTER relation, the DETIAL DATA will not work.)

Problem 2-
When i set SQL in Query Wizard, and i also set new paramter,
Can auto add parameter in "DEFIND PARAMETER" ?

Thank you!

Comments

  • edited 1:21AM
    Hello,

    1) Sorry, I don't understand your question. FastReport.Net can't be compared with FastReport3 - they have different architecture. If you want to print master-detail report, you must have two data bands (master and detail).

    2) It's impossible to parse SQL query to get parameters contained in it. Different database engines work with parameters in a different way. For example, MS SQL uses named parameters (@paramname), MS Access parameters don't have name (they denoted using ? mark) and so on.
  • edited 1:21AM
    HI~

    I want to desgin MASTER-DETAIL report, but i just want to show the summary of DETAIL DATA in MASTER Data band,
    how can i do this??

    Example:
    THe MASTERdata is customer and the DETAIL data is goods that customer buy, i want to show total money of detail goods, for every customer.
  • edited 1:21AM
    Hello,

    Use the Footer band attached to a detail data. See example in the demo, "General/Master-Detail" report. The DataFooter1 band can be used here to show totals by category.
  • edited 1:21AM
    HI!

    I had see example in the demo "General/Master-Detail" report,
    but my problme is when i design report which only one data band, the data band is MASTER data, i also have related DETAIL data, these related DETAIL data was queried MASTER data ,
    Cna i design the report which cantain MASTER data and reslut of queried DETAIL data??


    If i use DataFooter1 band, i must set two data bands(for MASTER,DETAIL) right??
  • edited 1:21AM
    If you want totals, you have to use two data bands. You may make the detail data band empty and set its height to 0.
  • edited 1:21AM
    HI

    i attach my report,
    in ths report, i have three data columns-SUBJECT,BUD,ACT.
    And every data row the reslut of BUD/the reslut of BUD in set a SQL query with SUBJECT data.
    How can i design??

    The data od BUD,ACT is related SUBJECT.

    Thank you!
  • edited 1:21AM
    May be you need the GROUP report? In this case you will need one databand and a group header/footer bands. Read about it in the "Report creation/Groups and totals" chapter in the user's manual.
  • edited July 2009
    HI!

    I am sorry, this attach report will show what i want.
    In this report, we can see the MASTER DATA that is "KIND",
    and there are four DETAIL DATA-LAST YEAR/MONEY-1/MONEY-2/MONEY-3,
    these DETAIL DATA is queried by each different MASTER DATA -"KIND".
    So every DATA ROW contain one MASTER DATA and three DETAIL DATA.

    I explain each LAST YEAR/MONEY-1/MONEY-2/MONEY-3 are queried SQL statement like CODEBOX
    and parameter KIND will change in MASTER DATA BANDS
    select SUM(MONEY) as MONEY-1
      from TB
     where KIND=@KIND
    
    therefore i can't use GROUP, i want to show ONE DATA ROW contains the MASTER DATA
    and Other related DETAIL DATA-LAST YEAR/MONEY-1/MONEY-2/MONEY-3,
    i don't know how to set these DATIAL SQL statement in MASTER DATA BANDS.

    Thank you!
  • edited 1:21AM
    Hello,

    Try to change your main SQL so it will contain all master and detail columns - "KIND", "LAST YEAR", "MONEY-1", "MONEY-2", "MONEY-3". In this case you may use one data band with five Text objects on it.
  • edited 1:21AM
    HI!

    I know how to use one main SQL to desgin the report,
    but can i use different SQL to find the result of LAST YEAR/MONEY-1/MONEY-2/MONEY-3?

    All of my reports was designed by Fast Report 3,
    in Fast Report 3, i can use different SQL to find the result with parameters which is come from main DATA BADNS.

    Now i want to redesign with Fast Report NET, so i want to know how to implement this method.

    Thank you!
  • edited July 2009
    Hello,

    Please tell me how it was designed in FR3. I suppose you have used the main SQL to connect it to the master data band, and four SQL to show values on the data band?
  • edited 1:21AM
    HI~

    I used Fast Report 3 with "Masterdata" component,
    and in this "Masterdata", i set SQL-MAIN like:
    select SUBNO from TBACC
    and  YEARS=:YEARS
    
    and in this "Masterdata", i also set other SQL-DETAIL like:
    select ADDMONEY from TBAUDIT
    where YEARS=:YEARS and SUBNO like :SUBNO +'%'
    

    In these SQL statement are used ADOQUERY component, and in SQL-DETAIL,
    i set the parameter-:SUBNO is conneting to SQL-MAIN,
    so i can use one Masterdata to design different SQL result.
  • edited 1:21AM
    Could you send me FastReport 3 report file (.fr3)?
    tz@fast-report.com
  • edited 1:21AM
    Hi~

    i had send mail.
    the subject of mail is "The FastReport 3 report file - come from jain".

    Thank you!
  • edited 1:21AM
    Hello,

    You need to create a master-master report where different databands are on the same level and don't connected to each other. See user's manual, "Report creation/Master-master report" chapter.
  • edited July 2009
    HI!

    If i use master-master report,
    the data don't have connecting to each others.
    But, i want to design like Master-Detail reports,
    when i create Master data,the Detail data is queried by Master data.

    So, in master-master report,how can i design?

    i had try to design report,
    and i found if i want to query Detail data with Master data,
    i must design like user's manual, "Report creation/Master-Detial report" chapter.
    In Detial data band i can set nothing, but it must exist,
    then in Master data band i can show the result of query Detail data with Master data,
    and relation must be one Master by one Detail.

    It's mean if i want set several Deatil data,i must desgin several level to query?

    Thank you!

    i desgin simple report for example, and i send mail to you,
    the mail subject is "MSATER-DETAIL report from jain"
  • edited 1:21AM
    Hello,

    If I understood you correctly, you want to have master data band and display in it some values from different datasources. These datasources are connected to the master datasource via SQL parameters.

    You need to call Init() method of the detail datasource, in order to refresh it. This can be done in the BeforePrint event of the master data band:
        private void Data1_BeforePrint(object sender, EventArgs e)
        {
          Report.GetDataSource("slaveTable").Init();
        }
    
  • edited 1:21AM
    HI!!

    This method is working,
    so, in the Fast Report NET, i can't use Fast Report 3's method,
    i must use different DATA BANDS or INIT() function?

    thank you!
  • edited 1:21AM
    Yes, exactly. In your case you have to use Init().

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.