xiaoding721
2023-11-13 e4edcfd0b987b239526f5375881b919789782dad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Quintiq file version 2.0
#parent: #root
Method GenerateBirtReport (
  String name,
  NamedValueTree parameters,
  String formatstring
) id:Method_ApplicationLibMacroPlanner_GenerateBirtReport
{
  #keys: '[107654.0.429175480]'
  Body:
  [*
    //Generate and show BIRT report
    mdsid := MDSID::Create( MacroPlan.MDSID() );
    options := BirtGenerateOptions::CreateUseMDS( mdsid, parameters );
    report := BirtReportDesign::LoadDesignFromQFS( name );
    document := report.Generate( options );
    //ApplicationMacroPlanner.ReportManager().PreviewBirtDocument( document );
    
    // output render format
    format := constnull( BirtRenderFormat );
    
    if ( formatstring = "HTML" )
    {
      format := BirtRenderFormat::Html();
    }
    else if ( formatstring = "PDF" )
    {
      format := BirtRenderFormat::Pdf();
    }
    else if( formatstring = "DOC" )
    {
      format := BirtRenderFormat::Doc();
    }
    else if( formatstring = "XLS" )
    {
      format := BirtRenderFormat::Xls();
    }
    else if( formatstring = "PPT" )
    {
      format := BirtRenderFormat::Ppt();
    }
    info( 'GenerateReport', formatstring, format.Extension() )
    ApplicationLibMacroPlanner.ReportManager().ShowBirtDocumentAs( document, format );
  *]
}