hongji.li
2023-11-07 192c736b8ac4b2d84cb823ac71f17e507948a5e8
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
46
47
48
49
50
51
52
53
Quintiq file version 2.0
#parent: Toolbar/btnPrint
Response OnClick () id:Response_Toolbar_btnPrint_OnClick
{
  #keys: '[100708.0.582187766]'
  Body:
  [*
    // Generate report
    reportname := StringSelectionReportsList.Text();
    background := CheckBoxBackground.Checked();
    
    format := BirtRenderFormat::Html();
    
    if ( StringSelectionReportFormat.BoundValue() = "PDF" )
    {
      format := BirtRenderFormat::Pdf();
    }
    else if( StringSelectionReportFormat.BoundValue() = "DOC" )
    {
      format := BirtRenderFormat::Doc();
    }
    else if( StringSelectionReportFormat.BoundValue() = "XLS" )
    {
      format := BirtRenderFormat::Xls();
    }
    else if( StringSelectionReportFormat.BoundValue() = "PPT" )
    {
      format := BirtRenderFormat::Ppt();
    }
    
    Dialog.EndModal(1);
    
    if ( reportname.Length() > 0 )
    {
    
      options := ApplicationLibMacroPlanner.CreateBirtGenerateOptions();
    
      if ( background )
      {
        ApplicationLibMacroPlanner.GenerateAndRenderReport( reportname,  format, options );
      }
      else
      {
        ApplicationLibMacroPlanner.ReportManager().PreviewBirtReport( reportname, options );
      }
    }
  *]
  DefinitionID: 'Responsedef_GUIButtonBase_OnClick'
  Precondition:
  [*
    StringSelectionReportsList.Text().Length() > 0
  *]
}